CopyCdsFile

更新时间:
复制 MD 格式

Create a copy of a file or folder in the cloud 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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecd:CopyCdsFile

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

CdsId

string

Yes

The ID of the cloud disk.

cn-hangzhou+cds-352282****

FileId

string

Yes

The file ID. You can call the CreateCdsFile operation to query the file ID.

640985a0ca2f71f489d2497682ca0bf468de****

EndUserId

string

No

The user ID that you want to use to access the cloud disk.

user01

ParentFolderId

string

Yes

The ID of the parent folder of the folder to which you want to copy the file. If you want to copy the file to the root directory, set this parameter to root.

root

AutoRename

boolean

No

Specifies whether to automatically rename the file if a file that has the same name exists in the folder to which you want to copy the file. Default value: false.

Valid values:

  • true

  • false

Valid values:

  • true :
  • false :

true

FileReceiverId

string

No

目标复制文件所在的个人空间 ID(即 UserId,您可以在 DescribeCloudDriveUsers 接口返回的报文中获取。)或者目标复制文件所在的团队空间 ID(即 GroupId,您可以在 DescribeCloudDriveGroups 接口返回的报文中获取。)

Note

FileReceiverId 和 FileReceiverType 都为空时,默认复制到文件所在的个人空间。

user02

FileReceiverType

string

No

文件所属的空间类型。

Valid values:

  • user :

    个人空间

  • group :

    团队空间

user

GroupId

string

No

The team Space ID.

cg-hs3i1w39o68ma****

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

93AD30C1-16B8-5C54-AD23-A51FF53F****

Code

string

The operation result. The value success indicates that the operation is successful. If the operation failed, an error message is returned.

success

Message

string

The error message that is returned. This parameter is not returned if the value of Code is success.

success

Success

string

Indicates whether the request is successful.

Valid values:

  • true

  • false

Valid values:

  • true :
  • false :

true

CopyCdsFileModel

object

The details about the file copying.

AsyncTaskId

string

The ID of the asynchronous task. This parameter is not returned if you copy a file. This parameter is returned if you copy a folder in the backend in an asynchronous manner. You can call the GetAsyncTask operation to obtain the ID and details of an asynchronous task.

4221bf6e6ab43a255edc4463bffa6f5f5d31****

FileId

string

The ID of the copied file or folder.

6400727cb878821bcb414615a609b4072463****

Examples

Success response

JSON format

{
  "RequestId": "93AD30C1-16B8-5C54-AD23-A51FF53F****",
  "Code": "success",
  "Message": "success",
  "Success": "true",
  "CopyCdsFileModel": {
    "AsyncTaskId": "4221bf6e6ab43a255edc4463bffa6f5f5d31****",
    "FileId": "6400727cb878821bcb414615a609b4072463****"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.