All Products
Search
Document Center

Cloud Backup:AddDataSource

Last Updated:Oct 26, 2026

Creates a data source.

Operation description

  • For the on-premises NAS backup feature, the supported data source type is on-premises NAS (COMMON_NAS).

  • For the CPFS backup feature, the supported data source types are Cloud Parallel File Storage (CPFS), CPFS for AI (BMCPFS), and other large-scale file systems (COMMON_FILE_SYSTEM).

  • For the archiving feature, the supported data source types are on-premises NAS (COMMON_NAS), HDFS (HDFS), and S3 (S3).

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

hbr:AddDataSource

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

DataSourceType

string

Yes

The data source type.

COMMON_NAS

DataSourceName

string

Yes

The name of the data source.

MyLocalNas

Credential

string

No

The access credential for the data source. Specify this parameter as needed for on-premises NAS data sources that use the SMB protocol, OSS protocol-compatible data sources, and S3 protocol-compatible data sources. Examples:

  • On-premises NAS data source (SMB protocol): { "mountUsername": "*****", "mountPassword": "*****" }

  • OSS protocol-compatible data source or S3 protocol-compatible data source: { "accessKeyId": "*****", "accessKeySecret": "*****" }

{ "mountUsername": "*****", "mountPassword": "*****" }

ConnectionInfo

string

No

The connection information of the data source, which describes how to access the data source. Examples:

  • On-premises NAS data source: { "dataServerAddresses": [ { "host": "123.123.123.123", "port": "8080" } ], "sharePath": "/share", "mountOptions": "vers=3", "fileSystemType": "nfs" }

  • CPFS for AI data source: {"vpcMountTarget":"cpfs-010wn***wy-vpc-ta***8.cn-shanghai.cpfs.aliyuncs.com","sharePath":"/"}

  • Other large-scale file system data source: {"path":"/mnt"}

{ "dataServerAddresses": [ { "host": "123.123.123.123", "port": "8080" } ], "sharePath": "/share", "mountOptions": "vers=3", "fileSystemType": "nfs" }

IndexLevel

string

No

The index level. This parameter is used only for data source analysis in the archiving feature. Do not use this parameter in other scenarios. Valid values:

  • OFF: no index is created

  • META: metadata index

  • ALL: full-text index ([Deprecated])

META

ClusterId

string

No

The ID of the client group used to access the data source.

cl-0004i0nlngorvgjpl7ck

Schedule

string

No

The execution cycle. This parameter is used only for data source analysis in the archiving feature. Do not use this parameter in other scenarios. Format: I{startTime}{interval}. This indicates that a task is executed at an interval of {interval} starting from {startTime}. startTime: the start time, which is a UNIX timestamp in seconds. interval: an ISO 8601 time interval. For example, PT1H indicates an interval of one hour, and P1D indicates an interval of one day.

I|1729493847|P1D

SpeedLimit

string

No

The throttling limit. This parameter is used only for data source analysis in the archiving feature. Do not use this parameter in other scenarios.

6:21:10240

Options

string

No

The data source analysis options. This parameter is used only for data source analysis in the archiving feature. Do not use this parameter in other scenarios.

{}

Include

string

No

The filter that specifies the files to include. This parameter is used only for data source analysis in the archiving feature. Do not use this parameter in other scenarios.

["/home/alice", "/home/bob"]

Exclude

string

No

The filter that specifies the files to exclude. This parameter is used only for data source analysis in the archiving feature. Do not use this parameter in other scenarios.

["/home/alice/log"]

Path

array

No

The list of paths for data source analysis. This parameter is used only for data source analysis in the archiving feature. Do not use this parameter in other scenarios.

string

No

The path for data source analysis. This parameter is used only for data source analysis in the archiving feature. Do not use this parameter in other scenarios.

/home

Response elements

Element

Type

Description

Example

object

Code

string

The error code.

200

Message

string

The message returned when the data source is added.

successful

RequestId

string

The request ID.

53167AD3-****-****-92C7-CF69A000BA45

Success

boolean

Indicates whether the request is successful.

true

DataSourceId

string

The ID of the data source.

ds-000*******xzj

Examples

Success response

JSON format

{
  "Code": "200",
  "Message": "successful",
  "RequestId": "53167AD3-****-****-92C7-CF69A000BA45",
  "Success": true,
  "DataSourceId": "ds-000*******xzj"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.