clients/client-storage-gateway/README.md
AWS SDK for JavaScript StorageGateway Client for Node.js, Browser and React Native.
<fullname>Storage Gateway Service</fullname>
<p>Amazon FSx File Gateway is no longer available to new customers. Existing customers of FSx File Gateway can continue to use the service normally. For capabilities similar to FSx File Gateway, visit <a href="https://aws.amazon.com/blogs/storage/switch-your-file-share-access-from-amazon-fsx-file-gateway-to-amazon-fsx-for-windows-file-server/">this blog post</a>.</p> <p>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.</p> <p>Use the following links to get started using the <i>Storage Gateway Service API Reference</i>:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html#AWSStorageGatewayHTTPRequestsHeaders">Storage Gateway required request headers</a>: Describes the required headers that you must send with every POST request to Storage Gateway.</p> </li> <li> <p> <a href="https://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html#AWSStorageGatewaySigningRequests">Signing requests</a>: Storage Gateway requires that you authenticate every request you send; this topic describes how sign such a request.</p> </li> <li> <p> <a href="https://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html#APIErrorResponses">Error responses</a>: Provides reference information about Storage Gateway errors.</p> </li> <li> <p> <a href="https://docs.aws.amazon.com/storagegateway/latest/APIReference/API_Operations.html">Operations in Storage Gateway</a>: Contains detailed descriptions of all Storage Gateway operations, their request parameters, response elements, possible errors, and examples of requests and responses.</p> </li> <li> <p> <a href="https://docs.aws.amazon.com/general/latest/gr/sg.html">Storage Gateway endpoints and quotas</a>: Provides a list of each Amazon Web Services Region and the endpoints available for use with Storage Gateway.</p> </li> </ul> <note> <p>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 <code>vol-AA22BB012345DAF670</code>. When you use this ID with the EC2 API, you must change it to <code>vol-aa22bb012345daf670</code>. Otherwise, the EC2 API might not behave as expected.</p> </note> <p>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 <a href="http://aws.amazon.com/ec2/faqs/#longer-ids">Longer EC2 and EBS resource IDs</a>.</p> <p>For example, a volume Amazon Resource Name (ARN) with the longer volume ID format looks like the following:</p> <p> <code>arn:aws:storagegateway:us-west-2:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABBCCDDEEFFG</code>.</p> <p>A snapshot ID with the longer ID format looks like the following: <code>snap-78e226633445566ee</code>.</p> <p>For more information, see <a href="http://forums.aws.amazon.com/ann.jspa?annID=3557">Announcement: Heads-up – Longer Storage Gateway volume and snapshot IDs coming in 2016</a>.</p>To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-storage-gatewayyarn add @aws-sdk/client-storage-gatewaypnpm add @aws-sdk/client-storage-gatewayThe 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";
To send a request:
send operation on the client, providing the command object as input.const client = new StorageGatewayClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new ListTapesCommand(params);
We recommend using the 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.
}
You can also use Promise chaining.
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
The aggregated client class is exported from the same package, but without the "Client" suffix.
StorageGateway extends StorageGatewayClient and additionally supports all operations, waiters, and paginators as methods.
This style may be familiar to you from the AWS SDK for JavaScript v2.
If you are bundling the AWS SDK, we recommend using only the bare-bones client (StorageGatewayClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { StorageGateway } from "@aws-sdk/client-storage-gateway";
const client = new 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 (not recommended).
client.listTapes(params, (err, data) => {
// process err and data.
});
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;
* }
*/
}
See also docs/ERROR_HANDLING.
Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
aws-sdk-js
on AWS Developer Blog.aws-sdk-js.To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.
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.
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Command API Reference / Input / Output
</details> <details> <summary> AddCache </summary>Command API Reference / Input / Output
</details> <details> <summary> AddTagsToResource </summary>Command API Reference / Input / Output
</details> <details> <summary> AddUploadBuffer </summary>Command API Reference / Input / Output
</details> <details> <summary> AddWorkingStorage </summary>Command API Reference / Input / Output
</details> <details> <summary> AssignTapePool </summary>Command API Reference / Input / Output
</details> <details> <summary> AssociateFileSystem </summary>Command API Reference / Input / Output
</details> <details> <summary> AttachVolume </summary>Command API Reference / Input / Output
</details> <details> <summary> CancelArchival </summary>Command API Reference / Input / Output
</details> <details> <summary> CancelCacheReport </summary>Command API Reference / Input / Output
</details> <details> <summary> CancelRetrieval </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateCachediSCSIVolume </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateNFSFileShare </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateSMBFileShare </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateSnapshotFromVolumeRecoveryPoint </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateStorediSCSIVolume </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateTapePool </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateTapes </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateTapeWithBarcode </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteAutomaticTapeCreationPolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteBandwidthRateLimit </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteCacheReport </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteChapCredentials </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteFileShare </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteGateway </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteSnapshotSchedule </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteTape </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteTapeArchive </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteTapePool </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteVolume </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeAvailabilityMonitorTest </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeBandwidthRateLimit </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeBandwidthRateLimitSchedule </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeCache </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeCachediSCSIVolumes </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeCacheReport </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeChapCredentials </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeFileSystemAssociations </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeGatewayInformation </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeMaintenanceStartTime </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeNFSFileShares </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeSMBFileShares </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeSMBSettings </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeSnapshotSchedule </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeStorediSCSIVolumes </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeTapeArchives </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeTapeRecoveryPoints </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeTapes </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeUploadBuffer </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeVTLDevices </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeWorkingStorage </summary>Command API Reference / Input / Output
</details> <details> <summary> DetachVolume </summary>Command API Reference / Input / Output
</details> <details> <summary> DisableGateway </summary>Command API Reference / Input / Output
</details> <details> <summary> DisassociateFileSystem </summary>Command API Reference / Input / Output
</details> <details> <summary> EvictFilesFailingUpload </summary>Command API Reference / Input / Output
</details> <details> <summary> JoinDomain </summary>Command API Reference / Input / Output
</details> <details> <summary> ListAutomaticTapeCreationPolicies </summary>Command API Reference / Input / Output
</details> <details> <summary> ListCacheReports </summary>Command API Reference / Input / Output
</details> <details> <summary> ListFileShares </summary>Command API Reference / Input / Output
</details> <details> <summary> ListFileSystemAssociations </summary>Command API Reference / Input / Output
</details> <details> <summary> ListGateways </summary>Command API Reference / Input / Output
</details> <details> <summary> ListLocalDisks </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTagsForResource </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTapePools </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTapes </summary>Command API Reference / Input / Output
</details> <details> <summary> ListVolumeInitiators </summary>Command API Reference / Input / Output
</details> <details> <summary> ListVolumeRecoveryPoints </summary>Command API Reference / Input / Output
</details> <details> <summary> ListVolumes </summary>Command API Reference / Input / Output
</details> <details> <summary> NotifyWhenUploaded </summary>Command API Reference / Input / Output
</details> <details> <summary> RefreshCache </summary>Command API Reference / Input / Output
</details> <details> <summary> RemoveTagsFromResource </summary>Command API Reference / Input / Output
</details> <details> <summary> ResetCache </summary>Command API Reference / Input / Output
</details> <details> <summary> RetrieveTapeArchive </summary>Command API Reference / Input / Output
</details> <details> <summary> RetrieveTapeRecoveryPoint </summary>Command API Reference / Input / Output
</details> <details> <summary> SetLocalConsolePassword </summary>Command API Reference / Input / Output
</details> <details> <summary> SetSMBGuestPassword </summary>Command API Reference / Input / Output
</details> <details> <summary> ShutdownGateway </summary>Command API Reference / Input / Output
</details> <details> <summary> StartAvailabilityMonitorTest </summary>Command API Reference / Input / Output
</details> <details> <summary> StartCacheReport </summary>Command API Reference / Input / Output
</details> <details> <summary> StartGateway </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateAutomaticTapeCreationPolicy </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateBandwidthRateLimit </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateBandwidthRateLimitSchedule </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateChapCredentials </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateFileSystemAssociation </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateGatewayInformation </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateGatewaySoftwareNow </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateMaintenanceStartTime </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateNFSFileShare </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateSMBFileShare </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateSMBFileShareVisibility </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateSMBLocalGroups </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateSMBSecurityStrategy </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateSnapshotSchedule </summary> </details> <details> <summary> UpdateVTLDeviceType </summary> </details>