All Products
Search
Document Center

:CreateStorageVolume

Last Updated:Nov 18, 2024

Creates a storage volume.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ens:CreateStorageVolumecreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
GatewayIdstringYes

The ID of the gateway.

sgw-****
StorageIdstringYes

The ID of the storage medium.

si-****
EnsRegionIdstringYes

The ID of the node.

cn-shenzhen-3
IsEnablestringNo

Specifies whether to enable the volume. Valid values:

  • 1 (default): enable the volume.
  • 0: disable the volume.
1
IsAuthstringNo

Specifies whether to enable authentication. Valid values:

  • 1: enable authentication.
  • 0 (default): disable authentication.
0
AuthProtocolstringNo

The authentication protocol. Set the value to CHAP.

CHAP
AuthUserstringNo

The username of the CHAP protocol.

User
AuthPasswordstringNo

The password of the CHAP protocol.

Password
VolumeNamestringNo

The name of the volume. The name must be 2 to 128 characters in length. The name cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).

testVolumeName
DescriptionstringNo

The description of the volume. The description must be 2 to 128 characters in length. The description cannot start with http:// or https://.

testDescription

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

7030AB96-57CF-1C68-9FEE-D60E547FD79C
VolumeIdarray

An array of volume IDs.

VolumeIdstring

The ID of the created volume.

["sv-***"]

Examples

Sample success responses

JSONformat

{
  "RequestId": "7030AB96-57CF-1C68-9FEE-D60E547FD79C",
  "VolumeId": [
    "[\"sv-***\"]"
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400OrderFailedOrder failed, please try again
400SaleControl.VerificationFailedYou did not pass the salecontrol verification.Please contact the product.Failed to pass the sales constraint verification when you create the resource.
400ERROR_VOLUME_STORAGE_STATUSThe cloud disk cannot be operated-
400ERROR_VOLUME_STORAGE_BINDEDThe cloud disk has been bound-
400ERROR_VOLUME_PROTOCOLThe wrong protocol-
400ERROR.STORAGE.BINDEDThe storageId has been bound.The specified storage device (such as the cloud disk ID) has been bound. Batch operations are not supported.
400ens.interface.errorFailed to call API.-
400NoPermissionPermission denied.-
400InvalidParameter.%sThe specified field %s invalid. Please check it again.-

For a list of error codes, visit the Service error codes.