Checks whether a data volume name already exists.
When you call the operation, take note of the following items:
- The operation returns whether the specified volume name already exists.
- Recovery mode: When the associated Object Storage Service (OSS) bucket is used as a volume, the system attempts to recover the volume based on the metadata of the volume, such as the size of the volume.
- The isRequireRecovery response parameter has one of the following values:
- true: The data volume name exists. You can enable recovery mode for the data volume.
- false: The data volume name does not exist. You can directly use the OSS bucket to create a new data volume.
Debugging
Request parameters
Parameter |
Type |
Required |
Example |
Description |
Action | String | Yes | CheckBlockVolumeName | The operation that you want to perform. Set the value to CheckBlockVolumeName. |
BucketEndpoint | String | Yes | oss-cn-hangzhou-internal.aliyuncs.com | The endpoint of the OSS bucket. |
BucketName | String | Yes | random*** | The name of the bucket. |
VolumeName | String | Yes | alex*** | The name of the data volume. The name must be 1 to 32 characters in length and can contain lowercase letters and digits. It must start with a lowercase letter. |
Response parameters
Parameter |
Type |
Example |
Description |
IsRequireRecovery | Boolean | false | Indicates whether recovery mode can be enabled for the data volume. Valid values:
|
Message | String | successful | The description of the request result. |
RequestId | String | 735B642E-6564-4A87-99A0-3609F67C787E | The request ID. |
Code | String | 200 | The returned HTTP status code. A value of 200 indicates that the request was successful. |
Success | Boolean | true | Indicates whether the request was successful. |
IsAlreadyExist | Boolean | false | Indicates whether the data volume name already exists. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=CheckBlockVolumeName
&BucketEndpoint=oss-cn-hangzhou-internal.aliyuncs.com
&BucketName=random***
&VolumeName=alex***
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CheckBlockVolumeNameResponse>
<IsRequireRecovery>false</IsRequireRecovery>
<Message>successful</Message>
<RequestId>735B642E-6564-4A87-99A0-3609F67C787E</RequestId>
<Code>200</Code>
<Success>true</Success>
<IsAlreadyExist>false</IsAlreadyExist>
</CheckBlockVolumeNameResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"IsRequireRecovery" : false,
"Message" : "successful",
"RequestId" : "735B642E-6564-4A87-99A0-3609F67C787E",
"Code" : "200",
"Success" : true,
"IsAlreadyExist" : false
}
Error codes
HttpCode |
Error code |
Error message |
Description |
400 | EmptyBucketName | You must enter a valid name for the bucket. | No OSS bucket is specified. |
400 | EmptyVolumeName | You must enter a valid name for the volume. | No data volume name is specified. |
400 | EmptyBucketEndpoint | You must specify a valid endpoint for the bucket. | No bucket endpoint is specified. |
400 | InvalidBucketEndpoint | The specified endpoint for the bucket is invalid. The Endpoint must start with oss- and end with .aliyuncs.com. | The endpoint of the OSS bucket is invalid. The endpoint must start with "oss-" and end with ". aliyuncs.com". |
400 | InvalidVolumeName | The specified volume name is invalid. The name must be a maximum of 32 characters in length and contain lower-case letters and digits.The name must start with a lower-case letter. | The data volume name is invalid. The name cannot exceed 32 characters in length and can contain lowercase letters and digits. It must start with a lowercase letter. |
For a list of error codes, see Service error codes.