CreateDatasetVersion

Updated at:

Creates a dataset version.

Operation description

Creates a dataset version.

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

paidataset:CreateDatasetVersion

create

*All Resource

*

None None

Request syntax

POST /api/v1/datasets/{DatasetId}/versions HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

DatasetId

string

Yes

The dataset ID. For more information about how to obtain the dataset ID, see ListDatasets.

d-rbvg5*****jhc9ks92

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

DataCount

integer

No

The number of files in the dataset.

300

DataSize

integer

No

The size of the space occupied by the dataset files. Unit: bytes.

19000

DataSourceType

string

Yes

The data source type. Separate multiple values with commas. Valid values:

  • NAS: Alibaba Cloud File Storage NAS.

  • OSS: Alibaba Cloud Object Storage Service (OSS).

  • CPFS

Note: The DataSourceType of the version must be the same as the DataSourceType of the dataset. The system validates this when you create the version.

Valid values:

  • NAS :

    NAS

  • OSS :

    OSS

OSS

DatasetTaskRamRole

string

No

UserMetricsEndpoints

acs:ram::1234567890123456:role/role-name

Description

string

No

The custom description of the dataset version. You can use this description to distinguish between different dataset versions.

This is a description of the dataset version.

DryRun

boolean

No

Specifies whether to perform only a dry run without actually creating the dataset version.

ImportInfo

string

No

The storage import configuration of the dataset. OSS, NAS, and CPFS are supported.

OSS

{
"region": "${region}",// The region ID.
"bucket": "${bucket}",// The bucket name.
"path": "${path}" // The file path.
}














NAS

{
"region": "${region}",// The region ID.
"fileSystemId": "${file_system_id}", // The file system ID.
"path": "${path}", // The file system path.
"mountTarget": "${mount_target}" // The mount target of the file system.
}

















CPFS

{
"region": "${region}",// The region ID.
"fileSystemId": "${file_system_id}", // The file system ID.
"protocolServiceId":"${protocol_service_id}", // The protocol service of the file system.
"exportId": "${export_id}", // The export directory of the file system.
"path": "${path}", // The file system path.
}




















CPFS for AI computing

{
"region": "${region}",// The region ID.
"fileSystemId": "${file_system_id}", // The file system ID.
"path": "${path}", // The file system path.
"mountTarget": "${mount_target}" // The mount target of the file system. This parameter is specific to the AI computing edition.
"isVpcMount": boolean, // Specifies whether the mount target is a VPC mount target. This parameter is specific to the AI computing edition.
}




















{ "region": "cn-wulanchabu", "fileSystemId": "bmcpfs-xxxxxxxxxxx", "path": "/mnt", "mountTarget": "cpfs-xxxxxxxxxxxx-vpc-gacs9f.cn-wulanchabu.cpfs.aliyuncs.com", "isVpcMount": true }

Labels

array

No

The list of labels for the dataset version.

Label

No

The label.

Options

string

No

The extended field. The value is a JSON string. When DLC uses the dataset, you can configure the mountPath field to specify the default mount path for the dataset.

{ "mountPath": "/mnt/data/" }

Property

string

Yes

The property of the dataset. Valid values:

  • FILE: file

  • DIRECTORY: directory

Valid values:

  • DIRECTORY :

    DIRECTORY

  • FILE :

    FILE

DIRECTORY

SourceId

string

No

The source ID.

  • If SourceType is set to USER, you can specify a custom SourceId.

  • If SourceType is set to ITAG, the dataset is generated from the labeling results of the iTAG module, and SourceId is the task ID in iTAG.

  • If SourceType is set to PAI_PUBLIC_DATASET, the dataset is created from a PAI public dataset, and SourceId is empty by default.

d-a0xbe5n03bhqof46ce

SourceType

string

No

The source type. Default value: USER. Valid values:

  • PAI-PUBLIC-DATASET: PAI public dataset.

  • ITAG: dataset generated from the labeling results of the iTAG module.

  • USER: user-registered dataset.

Valid values:

  • PAI_PUBLIC_DATASET :

    PAI_PUBLIC_DATASET

  • ITAG :

    ITAG

  • USER :

    USER

USER

Uri

string

Yes

The URI. Configuration examples:

  • If the data source type is OSS: oss://bucket.endpoint/object

  • If the data source type is NAS: For general-purpose NAS, the format is nas://<nasfisid>.region/subpath/to/dir/. For CPFS 1.0, the format is nas://<cpfs-fsid>.region/subpath/to/dir/. For CPFS 2.0, the format is nas://<cpfs-fsid>.region/<protocolserviceid>/. CPFS 1.0 and CPFS 2.0 are distinguished by the format of the fsid: the format for CPFS 1.0 is cpfs-<8 ASCII characters>, and the format for CPFS 2.0 is cpfs-<16 ASCII characters>.

oss://mybucket.oss-cn-beijing.aliyuncs.com/mypath/

UserMetricsEndpoints

array

No

The list of user metric collection endpoints.

UserMetricsEndpoint

No

The user metric collection endpoint, which includes the port and path.

Response elements

Element

Type

Description

Example

object

The response body.

RequestId

string

Id of the request

41A847C8-3D12-5F24-8CE9-7F9EB2DA9ECD

VersionName

string

The name of the dataset version.

v1

Examples

Success response

JSON format

{
  "RequestId": "41A847C8-3D12-5F24-8CE9-7F9EB2DA9ECD",
  "VersionName": "v1"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.