All Products
Search
Document Center

Drive and Photo Service:CreateDrive

Last Updated:May 26, 2026

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

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
group

Valid values:

  • user :

    user

  • group :

    group

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 normal is supported.

Valid values:

  • normal :

    normal

normal

status

string

No

The status. Valid values:

enabled: The drive is available.
disabled: The drive is unavailable.

The default value is enabled.

Valid values:

  • disabled :

    disabled

  • enabled :

    enabled

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 false.

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.