CreateCdsFile

更新时间:
复制 MD 格式

Create a folder or initiate a file upload task in the cloud disk.

Operation description

Call this API to create a folder directly in the enterprise cloud disk. To upload a file, call this API to obtain an upload URL. Then use that URL with the CompleteCdsFile API to complete the upload.

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 parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

Region ID. Call DescribeRegions to list regions supported by WUYING Workspace.

cn-hangzhou

EndUserId

string

No

User ID.

test1

CdsId

string

Yes

Enterprise cloud disk ID.

cn-hangzhou+cds-82414*****

FileName

string

Yes

File name.

testFile.txt

FileType

string

Yes

File type.

Valid values:

  • file :

    File

  • folder :

    Folder

file

ParentFileId

string

No

Parent file ID. Get this from the FileId parameter returned by the ListCdsFiles API.

637c9163b453b1a384874264ba79f3f9eab9****

FileLength

integer

Yes

File size. Unit: Byte.

1048576

FileHash

string

No

SHA-1 hash value of the file.

7C4A8D09CA3762AF61E59520943DC26494F8****

ConflictPolicy

string

No

How to handle files with the same name.

Valid values:

  • refuse :

    Reject the request if a file with the same name exists. Return details of the existing file. [Default]

  • auto_rename :

    Rename the new file automatically. By default, append the current timestamp to the original name. Example: xxx20240102_150405

  • ignore :

    Allow duplicate names.

  • over_write :

    Overwrite the existing file.

ignore

GroupId

string

No

Team space ID.

cg-i1ruuudp92qpj****

Response elements

Element

Type

Description

Example

object

Response object.

RequestId

string

Request ID.

2BAFE05D-FFB9-5938-96D0-08017DB9****

FileModel

object

File upload response object.

UploadUrl

string

File upload URL. Valid for 15 minutes by default.

https://data.aliyunpds.com/xxx/xxx?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx&partNumber=1&uploadId=0CC175B9C0F1B6A831C399E26977****

FileId

string

File ID.

646ec2f662b1e08f7a2b4d648982f906****

UploadId

string

File upload task ID.

20BE155AC20943BE9D405B0997A9****

Examples

Success response

JSON format

{
  "RequestId": "2BAFE05D-FFB9-5938-96D0-08017DB9****",
  "FileModel": {
    "UploadUrl": "https://data.aliyunpds.com/xxx/xxx?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx&partNumber=1&uploadId=0CC175B9C0F1B6A831C399E26977****",
    "FileId": "646ec2f662b1e08f7a2b4d648982f906****",
    "UploadId": "20BE155AC20943BE9D405B0997A9****"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.