AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Contains the response data from the CreateVolume operation.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.EC2.Model.CreateVolumeResponse

Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z

Syntax

C#
public class CreateVolumeResponse : AmazonWebServiceResponse

The CreateVolumeResponse type exposes the following members

Constructors

NameDescription
Public Method CreateVolumeResponse()

Properties

NameTypeDescription
Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property Volume Amazon.EC2.Model.Volume

Gets and sets the Volume member

Examples

This example creates an 80 GiB General Purpose (SSD) volume in the Availability Zone ``us-east-1a``.

To create a new volume


var client = new AmazonEC2Client();
var response = client.CreateVolume(new CreateVolumeRequest 
{
    AvailabilityZone = "us-east-1a",
    Size = 80,
    VolumeType = "gp2"
});

string availabilityZone = response.AvailabilityZone;
DateTime createTime = response.CreateTime;
bool encrypted = response.Encrypted;
int iops = response.Iops;
int size = response.Size;
string snapshotId = response.SnapshotId;
string state = response.State;
string volumeId = response.VolumeId;
string volumeType = response.VolumeType;

            

This example creates a new Provisioned IOPS (SSD) volume with 1000 provisioned IOPS from a snapshot in the Availability Zone ``us-east-1a``.

To create a new Provisioned IOPS (SSD) volume from a snapshot


var client = new AmazonEC2Client();
var response = client.CreateVolume(new CreateVolumeRequest 
{
    AvailabilityZone = "us-east-1a",
    Iops = 1000,
    SnapshotId = "snap-066877671789bd71b",
    VolumeType = "io1"
});

List<VolumeAttachment> attachments = response.Attachments;
string availabilityZone = response.AvailabilityZone;
DateTime createTime = response.CreateTime;
int iops = response.Iops;
int size = response.Size;
string snapshotId = response.SnapshotId;
string state = response.State;
List<Tag> tags = response.Tags;
string volumeId = response.VolumeId;
string volumeType = response.VolumeType;

            

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer, 3.5