@aws-sdk/client-storage-gateway
TypeScript icon, indicating that this package has built-in type declarations

3.556.0 • Public • Published

@aws-sdk/client-storage-gateway

Description

AWS SDK for JavaScript StorageGateway Client for Node.js, Browser and React Native.

Storage Gateway Service

Storage Gateway is the service that connects an on-premises software appliance with cloud-based storage to provide seamless and secure integration between an organization's on-premises IT environment and the Amazon Web Services storage infrastructure. The service enables you to securely upload data to the Amazon Web Services Cloud for cost effective backup and rapid disaster recovery.

Use the following links to get started using the Storage Gateway Service API Reference:

  • Storage Gateway required request headers: Describes the required headers that you must send with every POST request to Storage Gateway.

  • Signing requests: Storage Gateway requires that you authenticate every request you send; this topic describes how sign such a request.

  • Error responses: Provides reference information about Storage Gateway errors.

  • Operations in Storage Gateway: Contains detailed descriptions of all Storage Gateway operations, their request parameters, response elements, possible errors, and examples of requests and responses.

  • Storage Gateway endpoints and quotas: Provides a list of each Amazon Web Services Region and the endpoints available for use with Storage Gateway.

Storage Gateway resource IDs are in uppercase. When you use these resource IDs with the Amazon EC2 API, EC2 expects resource IDs in lowercase. You must change your resource ID to lowercase to use it with the EC2 API. For example, in Storage Gateway the ID for a volume might be vol-AA22BB012345DAF670. When you use this ID with the EC2 API, you must change it to vol-aa22bb012345daf670. Otherwise, the EC2 API might not behave as expected.

IDs for Storage Gateway volumes and Amazon EBS snapshots created from gateway volumes are changing to a longer format. Starting in December 2016, all new volumes and snapshots will be created with a 17-character string. Starting in April 2016, you will be able to use these longer IDs so you can test your systems with the new format. For more information, see Longer EC2 and EBS resource IDs.

For example, a volume Amazon Resource Name (ARN) with the longer volume ID format looks like the following:

arn:aws:storagegateway:us-west-2:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABBCCDDEEFFG.

A snapshot ID with the longer ID format looks like the following: snap-78e226633445566ee.

For more information, see Announcement: Heads-up – Longer Storage Gateway volume and snapshot IDs coming in 2016.

Installing

To install the this package, simply type add or install @aws-sdk/client-storage-gateway using your favorite package manager:

  • npm install @aws-sdk/client-storage-gateway
  • yarn add @aws-sdk/client-storage-gateway
  • pnpm add @aws-sdk/client-storage-gateway

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the StorageGatewayClient and the commands you need, for example ListTapesCommand:

// ES5 example
const { StorageGatewayClient, ListTapesCommand } = require("@aws-sdk/client-storage-gateway");
// ES6+ example
import { StorageGatewayClient, ListTapesCommand } from "@aws-sdk/client-storage-gateway";

Usage

To send a request, you:

  • Initiate client with configuration (e.g. credentials, region).
  • Initiate command with input parameters.
  • Call send operation on client with command object as input.
  • If you are using a custom http handler, you may call destroy() to close open connections.
// a client can be shared by different commands.
const client = new StorageGatewayClient({ region: "REGION" });

const params = {
  /** input parameters */
};
const command = new ListTapesCommand(params);

Async/await

We recommend using await operator to wait for the promise returned by send operation as follows:

// async/await.
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}

Async-await is clean, concise, intuitive, easy to debug and has better error handling as compared to using Promise chains or callbacks.

Promises

You can also use Promise chaining to execute send operation.

client.send(command).then(
  (data) => {
    // process data.
  },
  (error) => {
    // error handling.
  }
);

Promises can also be called using .catch() and .finally() as follows:

client
  .send(command)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  })
  .finally(() => {
    // finally.
  });

Callbacks

We do not recommend using callbacks because of callback hell, but they are supported by the send operation.

// callbacks.
client.send(command, (err, data) => {
  // process err and data.
});

v2 compatible style

The client can also send requests using v2 compatible style. However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post on modular packages in AWS SDK for JavaScript

import * as AWS from "@aws-sdk/client-storage-gateway";
const client = new AWS.StorageGateway({ region: "REGION" });

// async/await.
try {
  const data = await client.listTapes(params);
  // process data.
} catch (error) {
  // error handling.
}

// Promises.
client
  .listTapes(params)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  });

// callbacks.
client.listTapes(params, (err, data) => {
  // process err and data.
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  const { requestId, cfId, extendedRequestId } = error.$metadata;
  console.log({ requestId, cfId, extendedRequestId });
  /**
   * The keys within exceptions are also parsed.
   * You can access them by specifying exception names:
   * if (error.name === 'SomeServiceException') {
   *     const value = error.specialKeyInException;
   * }
   */
}

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-storage-gateway package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

ActivateGateway

Command API Reference / Input / Output

AddCache

Command API Reference / Input / Output

AddTagsToResource

Command API Reference / Input / Output

AddUploadBuffer

Command API Reference / Input / Output

AddWorkingStorage

Command API Reference / Input / Output

AssignTapePool

Command API Reference / Input / Output

AssociateFileSystem

Command API Reference / Input / Output

AttachVolume

Command API Reference / Input / Output

CancelArchival

Command API Reference / Input / Output

CancelRetrieval

Command API Reference / Input / Output

CreateCachediSCSIVolume

Command API Reference / Input / Output

CreateNFSFileShare

Command API Reference / Input / Output

CreateSMBFileShare

Command API Reference / Input / Output

CreateSnapshot

Command API Reference / Input / Output

CreateSnapshotFromVolumeRecoveryPoint

Command API Reference / Input / Output

CreateStorediSCSIVolume

Command API Reference / Input / Output

CreateTapePool

Command API Reference / Input / Output

CreateTapes

Command API Reference / Input / Output

CreateTapeWithBarcode

Command API Reference / Input / Output

DeleteAutomaticTapeCreationPolicy

Command API Reference / Input / Output

DeleteBandwidthRateLimit

Command API Reference / Input / Output

DeleteChapCredentials

Command API Reference / Input / Output

DeleteFileShare

Command API Reference / Input / Output

DeleteGateway

Command API Reference / Input / Output

DeleteSnapshotSchedule

Command API Reference / Input / Output

DeleteTape

Command API Reference / Input / Output

DeleteTapeArchive

Command API Reference / Input / Output

DeleteTapePool

Command API Reference / Input / Output

DeleteVolume

Command API Reference / Input / Output

DescribeAvailabilityMonitorTest

Command API Reference / Input / Output

DescribeBandwidthRateLimit

Command API Reference / Input / Output

DescribeBandwidthRateLimitSchedule

Command API Reference / Input / Output

DescribeCache

Command API Reference / Input / Output

DescribeCachediSCSIVolumes

Command API Reference / Input / Output

DescribeChapCredentials

Command API Reference / Input / Output

DescribeFileSystemAssociations

Command API Reference / Input / Output

DescribeGatewayInformation

Command API Reference / Input / Output

DescribeMaintenanceStartTime

Command API Reference / Input / Output

DescribeNFSFileShares

Command API Reference / Input / Output

DescribeSMBFileShares

Command API Reference / Input / Output

DescribeSMBSettings

Command API Reference / Input / Output

DescribeSnapshotSchedule

Command API Reference / Input / Output

DescribeStorediSCSIVolumes

Command API Reference / Input / Output

DescribeTapeArchives

Command API Reference / Input / Output

DescribeTapeRecoveryPoints

Command API Reference / Input / Output

DescribeTapes

Command API Reference / Input / Output

DescribeUploadBuffer

Command API Reference / Input / Output

DescribeVTLDevices

Command API Reference / Input / Output

DescribeWorkingStorage

Command API Reference / Input / Output

DetachVolume

Command API Reference / Input / Output

DisableGateway

Command API Reference / Input / Output

DisassociateFileSystem

Command API Reference / Input / Output

JoinDomain

Command API Reference / Input / Output

ListAutomaticTapeCreationPolicies

Command API Reference / Input / Output

ListFileShares

Command API Reference / Input / Output

ListFileSystemAssociations

Command API Reference / Input / Output

ListGateways

Command API Reference / Input / Output

ListLocalDisks

Command API Reference / Input / Output

ListTagsForResource

Command API Reference / Input / Output

ListTapePools

Command API Reference / Input / Output

ListTapes

Command API Reference / Input / Output

ListVolumeInitiators

Command API Reference / Input / Output

ListVolumeRecoveryPoints

Command API Reference / Input / Output

ListVolumes

Command API Reference / Input / Output

NotifyWhenUploaded

Command API Reference / Input / Output

RefreshCache

Command API Reference / Input / Output

RemoveTagsFromResource

Command API Reference / Input / Output

ResetCache

Command API Reference / Input / Output

RetrieveTapeArchive

Command API Reference / Input / Output

RetrieveTapeRecoveryPoint

Command API Reference / Input / Output

SetLocalConsolePassword

Command API Reference / Input / Output

SetSMBGuestPassword

Command API Reference / Input / Output

ShutdownGateway

Command API Reference / Input / Output

StartAvailabilityMonitorTest

Command API Reference / Input / Output

StartGateway

Command API Reference / Input / Output

UpdateAutomaticTapeCreationPolicy

Command API Reference / Input / Output

UpdateBandwidthRateLimit

Command API Reference / Input / Output

UpdateBandwidthRateLimitSchedule

Command API Reference / Input / Output

UpdateChapCredentials

Command API Reference / Input / Output

UpdateFileSystemAssociation

Command API Reference / Input / Output

UpdateGatewayInformation

Command API Reference / Input / Output

UpdateGatewaySoftwareNow

Command API Reference / Input / Output

UpdateMaintenanceStartTime

Command API Reference / Input / Output

UpdateNFSFileShare

Command API Reference / Input / Output

UpdateSMBFileShare

Command API Reference / Input / Output

UpdateSMBFileShareVisibility

Command API Reference / Input / Output

UpdateSMBLocalGroups

Command API Reference / Input / Output

UpdateSMBSecurityStrategy

Command API Reference / Input / Output

UpdateSnapshotSchedule

Command API Reference / Input / Output

UpdateVTLDeviceType

Command API Reference / Input / Output

Readme

Keywords

none

Package Sidebar

Install

npm i @aws-sdk/client-storage-gateway

Weekly Downloads

82,060

Version

3.556.0

License

Apache-2.0

Unpacked Size

1.63 MB

Total Files

377

Last publish

Collaborators

  • mattsb42-aws
  • kuhe
  • amzn-oss
  • aws-sdk-bot
  • trivikr-aws