ListLocalDisksCommand

Returns a list of the gateway's local disks. To specify which gateway to describe, you use the Amazon Resource Name (ARN) of the gateway in the body of the request.

The request returns a list of all disks, specifying which are configured as working storage, cache storage, or stored volume or not configured at all. The response includes a DiskStatus field. This field can have a value of present (the disk is available to use), missing (the disk is no longer connected to the gateway), or mismatch (the disk node is occupied by a disk that has incorrect metadata or the disk content is corrupted).

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { StorageGatewayClient, ListLocalDisksCommand } from "@aws-sdk/client-storage-gateway"; // ES Modules import
// const { StorageGatewayClient, ListLocalDisksCommand } = require("@aws-sdk/client-storage-gateway"); // CommonJS import
const client = new StorageGatewayClient(config);
const input = { // ListLocalDisksInput
  GatewayARN: "STRING_VALUE", // required
};
const command = new ListLocalDisksCommand(input);
const response = await client.send(command);
// { // ListLocalDisksOutput
//   GatewayARN: "STRING_VALUE",
//   Disks: [ // Disks
//     { // Disk
//       DiskId: "STRING_VALUE",
//       DiskPath: "STRING_VALUE",
//       DiskNode: "STRING_VALUE",
//       DiskStatus: "STRING_VALUE",
//       DiskSizeInBytes: Number("long"),
//       DiskAllocationType: "STRING_VALUE",
//       DiskAllocationResource: "STRING_VALUE",
//       DiskAttributeList: [ // DiskAttributeList
//         "STRING_VALUE",
//       ],
//     },
//   ],
// };

Example Usage

 There was an error loading the code editor. Retry

ListLocalDisksCommand Input

See ListLocalDisksCommandInput for more details

Parameter
Type
Description
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.

ListLocalDisksCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Disks
Disk[] | undefined

A JSON object containing the following fields:

  • ListLocalDisksOutput$Disks

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
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.