CreateDataset

Updated at:

Creates a dataset.

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:CreateDataset

create

*All Resource

*

None None

Request syntax

POST /api/v1/datasets HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

Accessibility

string

No

The workspace visibility. Valid values:

  • PRIVATE: Visible only to you and administrators in the workspace. This is the default value.

  • PUBLIC: Visible to all users in the workspace.

  • ROLE_PUBLIC: Visible to specified workspace roles. For the role list, refer to AccessibleRoleIdList. The dataset owner and administrators always have visibility under this condition.

Valid values:

  • PUBLIC :

    PUBLIC

  • PRIVATE :

    PRIVATE

PRIVATE

AccessibleRoleIdList

array

No

Takes effect when Accessibility is set to ROLE_PUBLIC. The list of workspace role names that have visibility to the dataset. Role IDs starting with PAI are basic role IDs, and those starting with role- are custom role IDs.

string

No

The workspace role ID.

PAI.AlgoOperator

DataCount

integer

No

The number of files in the dataset.

500

DataSize

integer

No

The storage space occupied by the dataset files. Unit: bytes.

10000

DataSourceType

string

Yes

The data source type. Valid values:

  • OSS: Object Storage Service (OSS).

  • NAS: File Storage NAS (General-purpose).

  • EXTREMENAS: File Storage NAS (Extreme).

  • CPFS: Cloud Paralleled File System (CPFS) (General-purpose).

  • BMCPFS: Cloud Paralleled File System (CPFS) (AI-optimized).

  • MAXCOMPUTE: MaxCompute.

  • URL: Public HTTP or HTTPS URL.

Valid values:

  • NAS :

    NAS

  • MAXCOMPUTE :

    MAXCOMPUTE

  • CPFS :

    CPFS

  • BMCPFS :

    BMCPFS

  • EXTREMENAS :

    EXTREMENAS

  • OSS :

    OSS

  • URL :

    URL

NAS

DataType

string

No

The data type of the dataset. Default value: COMMON. Valid values:

  • COMMON: Common.

  • PIC: Image.

  • TEXT: Text.

  • VIDEO: Video.

  • AUDIO: Audio.

Valid values:

  • VIDEO :

    VIDEO

  • COMMON :

    COMMON

  • TEXT :

    TEXT

  • PIC :

    PIC

  • AUDIO :

    AUDIO

COMMON

DatasetTaskRamRole

string

No

DatasetTaskRamRole

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

Description

string

No

The custom description of the dataset to distinguish it from other datasets.

This is a description of the dataset.

DryRun

boolean

No

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

true

Edition

string

No

The dataset edition. Default value: BASIC. Valid values:

  • BASIC: Basic edition. Does not support file metadata management for the dataset.

  • ADVANCED: Advanced edition. Only supported for OSS datasets. Supports file metadata management for up to 1 million files per version.

  • LOGICAL: Logical edition. Only supported for OSS datasets. Supports file metadata management for up to 3 million files per version.

Valid values:

  • LOGICAL :

    LOGICAL

  • BASIC :

    BASIC

  • ADVANCED :

    ADVANCED

ADVANCED

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




















AI-optimized CPFS

{
"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. Specific to the AI-optimized edition.
"isVpcMount": boolean, // Specifies whether the mount target is a VPC mount target. Specific to the AI-optimized 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.

Label

No

The label added to the dataset.

MountAccessReadWriteRoleIdList

array

No

The list of workspace role names that have read and write permissions when the dataset is mounted. Role IDs starting with PAI are basic role IDs, and those starting with role- are custom role IDs. If the list contains an asterisk (*), all roles have read and write permissions.

  • Specified roles: ["PAI.AlgoOperator", "role-hiuwpd01ncrokkgp21"]

  • All roles: ["*"]

  • Dataset creator only: []

string

No

The workspace role ID.

PAI.AlgoOperator

Name

string

Yes

The name of the dataset. The naming rules are as follows:

  • The name must start with a lowercase letter, an uppercase letter, a digit, or a Chinese character.

  • The name can contain underscores (_) and hyphens (-).

  • The name must be 1 to 127 characters in length.

myName

Options

string

No

The extended field in JSON string format. When Deep Learning Containers (DLC) uses the dataset, you can configure the mountPath field to specify the default mount path of 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

Provider

string

No

The provider of the dataset. You cannot set this parameter to pai.

Github

ProviderType

string

No

The data source type of the dataset. Valid values:

  • Ecs: Elastic Compute Service (ECS). This is the default value.

  • Lingjun: Lingjun.

Ecs

SourceDatasetId

string

No

The ID of the source dataset for the labeled dataset.

d-bvfasdfxxxxj8o411

SourceDatasetVersion

string

No

The version of the source dataset for the labeled dataset.

v2

SourceId

string

No

The ID of the data source.

  • When SourceType is set to USER, SourceId can be customized.

  • When SourceType is set to ITAG, which indicates a dataset generated from iTAG labeling results, SourceId is the iTAG task ID.

  • When SourceType is set to PAI_PUBLIC_DATASET, which indicates a dataset created from a PAI public dataset, SourceId is empty by default.

jdnhf***fnrimv

SourceType

string

No

The data source type. Default value: USER.

Valid values:

  • PAI_PUBLIC_DATASET :

    PAI_PUBLIC_DATASET

  • ITAG :

    ITAG

  • USER :

    USER

USER

Uri

string

Yes

The URI configuration examples are as follows:

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

nas://09f****f2.cn-hangzhou/

UserId

string

No

The Alibaba Cloud account ID of the dataset owner. The workspace owner and administrators have the permissions to create datasets for specified workspace members.

2485765****023475

UserMetricsEndpoints

array

No

UserMetricsEndpoints

UserMetricsEndpoint

No

UserMetricsEndpoints

VersionDescription

string

No

The description of the initial version of the dataset.

This is a description of the first dataset version.

VersionLabels

array

No

The list of labels for the initial version.

Label

No

The label added to the initial version of the dataset.

WorkspaceId

string

No

The ID of the workspace to which the dataset belongs. For more information about how to obtain the workspace ID, see ListWorkspaces. If you do not configure this parameter, the default workspace is used. If the default workspace does not exist, an error is reported.

478**

Response elements

Element

Type

Description

Example

object

The response body.

DatasetId

string

The dataset ID.

d-rbvg5*****jhc9ks92

RequestId

string

The request ID.

B2C51F93-1C07-5477-9705-5FDB****F19F

Examples

Success response

JSON format

{
  "DatasetId": "d-rbvg5*****jhc9ks92",
  "RequestId": "B2C51F93-1C07-5477-9705-5FDB****F19F"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.