Create a drive.
Operation description
Before creating a drive, ensure that the specified user or group has not been assigned a drive.
Try it now
Test
RAM authorization
Request syntax
POST /v2/drive/create HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| domain_id |
string |
Yes |
||
| body |
object |
No |
The request body. |
|
| drive_name |
string |
Yes |
The name of the drive. The name can be up to 128 characters long. |
我的个人空间 |
| owner |
string |
Yes |
The ID of the owner. |
3b3d7245c159488da17d081ad6c64687 |
| owner_type |
string |
Yes |
The owner type. Valid values: user Valid values:
|
user |
| description |
string |
No |
The description. The description can be up to 1024 characters long. |
vip空间 |
| drive_type |
string |
No |
The drive type. Currently, only Valid values:
|
normal |
| status |
string |
No |
The status. Valid values: enabled: The drive is available. The default value is Valid values:
|
enabled |
| total_size |
integer |
No |
The total size of the drive in bytes. By default, the size is unlimited. |
1024 |
| default |
boolean |
No |
Specifies whether the drive is the default drive. The default value is |
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| domain_id |
string |
The domain ID. |
bj1 |
| drive_id |
string |
The drive ID. |
1 |
| drive_name |
string |
The drive name. |
我的个人空间 |
| description |
string |
The description. |
vip空间 |
| owner |
string |
The owner ID. |
3b3d7245c159488da17d081ad6c64687 |
| owner_type |
string |
The owner type. |
user |
| drive_type |
string |
The drive type. |
normal |
| used_size |
integer |
The used space in bytes. |
1024 |
| total_size |
integer |
The total size of the drive in bytes. |
1024 |
| creator |
string |
The ID of the creator. |
c9b7a5aa04d14ae3867fdc886fa01da4 |
| created_at |
string |
The creation time. |
2024-08-14T03:14:28.109Z |
| status |
string |
The status. |
enabled |
Examples
Success response
JSON format
{
"domain_id": "bj1",
"drive_id": "1",
"drive_name": "我的个人空间\n",
"description": "vip空间\n",
"owner": "3b3d7245c159488da17d081ad6c64687\n",
"owner_type": "user",
"drive_type": "normal",
"used_size": 1024,
"total_size": 1024,
"creator": "c9b7a5aa04d14ae3867fdc886fa01da4",
"created_at": "2024-08-14T03:14:28.109Z",
"status": "enabled"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.