- 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.
DescribeVolumeAttributeCommand
Describes the specified attribute of the specified volume. You can specify only one attribute at a time.
For more information about EBS volumes, see Amazon EBS volumes in the Amazon EBS User Guide.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, DescribeVolumeAttributeCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, DescribeVolumeAttributeCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const input = { // DescribeVolumeAttributeRequest
Attribute: "autoEnableIO" || "productCodes", // required
VolumeId: "STRING_VALUE", // required
DryRun: true || false,
};
const command = new DescribeVolumeAttributeCommand(input);
const response = await client.send(command);
// { // DescribeVolumeAttributeResult
// AutoEnableIO: { // AttributeBooleanValue
// Value: true || false,
// },
// ProductCodes: [ // ProductCodeList
// { // ProductCode
// ProductCodeId: "STRING_VALUE",
// ProductCodeType: "devpay" || "marketplace",
// },
// ],
// VolumeId: "STRING_VALUE",
// };
Example Usage
There was an error loading the code editor. Retry
DescribeVolumeAttributeCommand Input
See DescribeVolumeAttributeCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Attribute Required | VolumeAttributeName | undefined | The attribute of the volume. This parameter is required. |
VolumeId Required | string | undefined | The ID of the volume. |
DryRun | boolean | undefined | Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is |
DescribeVolumeAttributeCommand Output
See DescribeVolumeAttributeCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
AutoEnableIO | AttributeBooleanValue | undefined | The state of |
ProductCodes | ProductCode[] | undefined | A list of product codes. |
VolumeId | string | undefined | The ID of the volume. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
EC2ServiceException | Base exception class for all service exceptions from EC2 service. |