|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 5 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 6 | + |
| 7 | +import { EC2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EC2Client"; |
| 8 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 9 | +import { CopyVolumesRequest, CopyVolumesResult } from "../models/models_1"; |
| 10 | +import { de_CopyVolumesCommand, se_CopyVolumesCommand } from "../protocols/Aws_ec2"; |
| 11 | + |
| 12 | +/** |
| 13 | + * @public |
| 14 | + */ |
| 15 | +export type { __MetadataBearer }; |
| 16 | +export { $Command }; |
| 17 | +/** |
| 18 | + * @public |
| 19 | + * |
| 20 | + * The input for {@link CopyVolumesCommand}. |
| 21 | + */ |
| 22 | +export interface CopyVolumesCommandInput extends CopyVolumesRequest {} |
| 23 | +/** |
| 24 | + * @public |
| 25 | + * |
| 26 | + * The output of {@link CopyVolumesCommand}. |
| 27 | + */ |
| 28 | +export interface CopyVolumesCommandOutput extends CopyVolumesResult, __MetadataBearer {} |
| 29 | + |
| 30 | +/** |
| 31 | + * <p>Creates a crash-consistent, point-in-time copy of an existing Amazon EBS volume within the same |
| 32 | + * Availability Zone. The volume copy can be attached to an Amazon EC2 instance once it reaches the |
| 33 | + * <code>available</code> state. For more information, see <a href="https://docs.aws.amazon.com/ebs/latest/userguide/ebs-copying-volume.html">Copy an Amazon EBS volume</a>.</p> |
| 34 | + * @example |
| 35 | + * Use a bare-bones client and the command you need to make an API call. |
| 36 | + * ```javascript |
| 37 | + * import { EC2Client, CopyVolumesCommand } from "@aws-sdk/client-ec2"; // ES Modules import |
| 38 | + * // const { EC2Client, CopyVolumesCommand } = require("@aws-sdk/client-ec2"); // CommonJS import |
| 39 | + * // import type { EC2ClientConfig } from "@aws-sdk/client-ec2"; |
| 40 | + * const config = {}; // type is EC2ClientConfig |
| 41 | + * const client = new EC2Client(config); |
| 42 | + * const input = { // CopyVolumesRequest |
| 43 | + * SourceVolumeId: "STRING_VALUE", // required |
| 44 | + * Iops: Number("int"), |
| 45 | + * Size: Number("int"), |
| 46 | + * VolumeType: "standard" || "io1" || "io2" || "gp2" || "sc1" || "st1" || "gp3", |
| 47 | + * DryRun: true || false, |
| 48 | + * TagSpecifications: [ // TagSpecificationList |
| 49 | + * { // TagSpecification |
| 50 | + * ResourceType: "capacity-reservation" || "client-vpn-endpoint" || "customer-gateway" || "carrier-gateway" || "coip-pool" || "declarative-policies-report" || "dedicated-host" || "dhcp-options" || "egress-only-internet-gateway" || "elastic-ip" || "elastic-gpu" || "export-image-task" || "export-instance-task" || "fleet" || "fpga-image" || "host-reservation" || "image" || "image-usage-report" || "import-image-task" || "import-snapshot-task" || "instance" || "instance-event-window" || "internet-gateway" || "ipam" || "ipam-pool" || "ipam-scope" || "ipv4pool-ec2" || "ipv6pool-ec2" || "key-pair" || "launch-template" || "local-gateway" || "local-gateway-route-table" || "local-gateway-virtual-interface" || "local-gateway-virtual-interface-group" || "local-gateway-route-table-vpc-association" || "local-gateway-route-table-virtual-interface-group-association" || "natgateway" || "network-acl" || "network-interface" || "network-insights-analysis" || "network-insights-path" || "network-insights-access-scope" || "network-insights-access-scope-analysis" || "outpost-lag" || "placement-group" || "prefix-list" || "replace-root-volume-task" || "reserved-instances" || "route-table" || "security-group" || "security-group-rule" || "service-link-virtual-interface" || "snapshot" || "spot-fleet-request" || "spot-instances-request" || "subnet" || "subnet-cidr-reservation" || "traffic-mirror-filter" || "traffic-mirror-session" || "traffic-mirror-target" || "transit-gateway" || "transit-gateway-attachment" || "transit-gateway-connect-peer" || "transit-gateway-multicast-domain" || "transit-gateway-policy-table" || "transit-gateway-route-table" || "transit-gateway-route-table-announcement" || "volume" || "vpc" || "vpc-endpoint" || "vpc-endpoint-connection" || "vpc-endpoint-service" || "vpc-endpoint-service-permission" || "vpc-peering-connection" || "vpn-connection" || "vpn-gateway" || "vpc-flow-log" || "capacity-reservation-fleet" || "traffic-mirror-filter-rule" || "vpc-endpoint-connection-device-type" || "verified-access-instance" || "verified-access-group" || "verified-access-endpoint" || "verified-access-policy" || "verified-access-trust-provider" || "vpn-connection-device-type" || "vpc-block-public-access-exclusion" || "route-server" || "route-server-endpoint" || "route-server-peer" || "ipam-resource-discovery" || "ipam-resource-discovery-association" || "instance-connect-endpoint" || "verified-access-endpoint-target" || "ipam-external-resource-verification-token" || "capacity-block" || "mac-modification-task", |
| 51 | + * Tags: [ // TagList |
| 52 | + * { // Tag |
| 53 | + * Key: "STRING_VALUE", |
| 54 | + * Value: "STRING_VALUE", |
| 55 | + * }, |
| 56 | + * ], |
| 57 | + * }, |
| 58 | + * ], |
| 59 | + * MultiAttachEnabled: true || false, |
| 60 | + * Throughput: Number("int"), |
| 61 | + * ClientToken: "STRING_VALUE", |
| 62 | + * }; |
| 63 | + * const command = new CopyVolumesCommand(input); |
| 64 | + * const response = await client.send(command); |
| 65 | + * // { // CopyVolumesResult |
| 66 | + * // Volumes: [ // VolumeList |
| 67 | + * // { // Volume |
| 68 | + * // AvailabilityZoneId: "STRING_VALUE", |
| 69 | + * // OutpostArn: "STRING_VALUE", |
| 70 | + * // SourceVolumeId: "STRING_VALUE", |
| 71 | + * // Iops: Number("int"), |
| 72 | + * // Tags: [ // TagList |
| 73 | + * // { // Tag |
| 74 | + * // Key: "STRING_VALUE", |
| 75 | + * // Value: "STRING_VALUE", |
| 76 | + * // }, |
| 77 | + * // ], |
| 78 | + * // VolumeType: "standard" || "io1" || "io2" || "gp2" || "sc1" || "st1" || "gp3", |
| 79 | + * // FastRestored: true || false, |
| 80 | + * // MultiAttachEnabled: true || false, |
| 81 | + * // Throughput: Number("int"), |
| 82 | + * // SseType: "sse-ebs" || "sse-kms" || "none", |
| 83 | + * // Operator: { // OperatorResponse |
| 84 | + * // Managed: true || false, |
| 85 | + * // Principal: "STRING_VALUE", |
| 86 | + * // }, |
| 87 | + * // VolumeInitializationRate: Number("int"), |
| 88 | + * // VolumeId: "STRING_VALUE", |
| 89 | + * // Size: Number("int"), |
| 90 | + * // SnapshotId: "STRING_VALUE", |
| 91 | + * // AvailabilityZone: "STRING_VALUE", |
| 92 | + * // State: "creating" || "available" || "in-use" || "deleting" || "deleted" || "error", |
| 93 | + * // CreateTime: new Date("TIMESTAMP"), |
| 94 | + * // Attachments: [ // VolumeAttachmentList |
| 95 | + * // { // VolumeAttachment |
| 96 | + * // DeleteOnTermination: true || false, |
| 97 | + * // AssociatedResource: "STRING_VALUE", |
| 98 | + * // InstanceOwningService: "STRING_VALUE", |
| 99 | + * // VolumeId: "STRING_VALUE", |
| 100 | + * // InstanceId: "STRING_VALUE", |
| 101 | + * // Device: "STRING_VALUE", |
| 102 | + * // State: "attaching" || "attached" || "detaching" || "detached" || "busy", |
| 103 | + * // AttachTime: new Date("TIMESTAMP"), |
| 104 | + * // }, |
| 105 | + * // ], |
| 106 | + * // Encrypted: true || false, |
| 107 | + * // KmsKeyId: "STRING_VALUE", |
| 108 | + * // }, |
| 109 | + * // ], |
| 110 | + * // }; |
| 111 | + * |
| 112 | + * ``` |
| 113 | + * |
| 114 | + * @param CopyVolumesCommandInput - {@link CopyVolumesCommandInput} |
| 115 | + * @returns {@link CopyVolumesCommandOutput} |
| 116 | + * @see {@link CopyVolumesCommandInput} for command's `input` shape. |
| 117 | + * @see {@link CopyVolumesCommandOutput} for command's `response` shape. |
| 118 | + * @see {@link EC2ClientResolvedConfig | config} for EC2Client's `config` shape. |
| 119 | + * |
| 120 | + * @throws {@link EC2ServiceException} |
| 121 | + * <p>Base exception class for all service exceptions from EC2 service.</p> |
| 122 | + * |
| 123 | + * |
| 124 | + * @public |
| 125 | + */ |
| 126 | +export class CopyVolumesCommand extends $Command |
| 127 | + .classBuilder< |
| 128 | + CopyVolumesCommandInput, |
| 129 | + CopyVolumesCommandOutput, |
| 130 | + EC2ClientResolvedConfig, |
| 131 | + ServiceInputTypes, |
| 132 | + ServiceOutputTypes |
| 133 | + >() |
| 134 | + .ep(commonParams) |
| 135 | + .m(function (this: any, Command: any, cs: any, config: EC2ClientResolvedConfig, o: any) { |
| 136 | + return [ |
| 137 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 138 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 139 | + ]; |
| 140 | + }) |
| 141 | + .s("AmazonEC2", "CopyVolumes", {}) |
| 142 | + .n("EC2Client", "CopyVolumesCommand") |
| 143 | + .f(void 0, void 0) |
| 144 | + .ser(se_CopyVolumesCommand) |
| 145 | + .de(de_CopyVolumesCommand) |
| 146 | + .build() { |
| 147 | + /** @internal type navigation helper, not in runtime. */ |
| 148 | + protected declare static __types: { |
| 149 | + api: { |
| 150 | + input: CopyVolumesRequest; |
| 151 | + output: CopyVolumesResult; |
| 152 | + }; |
| 153 | + sdk: { |
| 154 | + input: CopyVolumesCommandInput; |
| 155 | + output: CopyVolumesCommandOutput; |
| 156 | + }; |
| 157 | + }; |
| 158 | +} |
0 commit comments