- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
AddCacheCommand
Configures one or more gateway local disks as cache for a gateway. This operation is only supported in the cached volume, tape, and file gateway type (see How Storage Gateway works (architecture) .
In the request, you specify the gateway Amazon Resource Name (ARN) to which you want to add cache, and one or more disk IDs that you want to configure as cache.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { StorageGatewayClient, AddCacheCommand } from "@aws-sdk/client-storage-gateway"; // ES Modules import
// const { StorageGatewayClient, AddCacheCommand } = require("@aws-sdk/client-storage-gateway"); // CommonJS import
const client = new StorageGatewayClient(config);
const input = { // AddCacheInput
GatewayARN: "STRING_VALUE", // required
DiskIds: [ // DiskIds // required
"STRING_VALUE",
],
};
const command = new AddCacheCommand(input);
const response = await client.send(command);
// { // AddCacheOutput
// GatewayARN: "STRING_VALUE",
// };
Example Usage
AddCacheCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
DiskIds Required | string[] | undefined | An array of strings that identify disks that are to be configured as working storage. Each string has a minimum length of 1 and maximum length of 300. You can get the disk IDs from the ListLocalDisks API. |
GatewayARN Required | string | undefined | The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and Amazon Web Services Region. |
AddCacheCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
GatewayARN | string | undefined | The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and Amazon Web Services Region. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServerError | server | An internal server error has occurred during the request. For more information, see the error and message fields. |
InvalidGatewayRequestException | client | An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields. |
StorageGatewayServiceException | Base exception class for all service exceptions from StorageGateway service. |