ALIYUN::PAI::DatasetVersion

更新时间:2025-02-28 03:17:15

ALIYUN::PAI::DatasetVersion类型用于创建数据集版本。

语法

{
  "Type": "ALIYUN::PAI::DatasetVersion",
  "Properties": {
    "DataSourceType": String,
    "DatasetId": String,
    "Property": String,
    "Uri": String,
    "Description": String,
    "DataSize": Integer,
    "DataCount": Integer,
    "Labels": List,
    "Options": String,
    "SourceType": String,
    "SourceId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

DataSourceType

String

数据源类型。

多项之间使用半角逗号分隔。支持以下取值:

  • NAS:数据存储为阿里云文件存储(NAS)。

  • OSS:数据存储为阿里云对象存储(OSS)。

  • CPFS:数据存储为阿里云文件存储(CPFS)。

说明

当前的策略是版本的DataSourceType需要与数据集DataSourceType保持一致,创建版本时,与数据集进行校验。

DatasetId

String

数据集 ID。

Property

String

数据集的属性。

支持以下取值:

  • FILE:文件。

  • DIRECTORY:文件夹。

Uri

String

Uri 配置。

  • 数据源类型为 OSS:oss://bucket.endpoint/object

  • 数据源类型为 NAS: 通用型 NAS 格式为:nas://<nasfisid>.region/subpath/to/dir/; CPFS1.0:nas://<cpfs-fsid>.region/subpath/to/dir/; CPFS2.0:nas://<cpfs-fsid>.region/<protocolserviceid>/。 CPFS1.0 和 CPFS2.0 根据 fsid 的格式来区分:CPFS1.0 格式为 cpfs-<8 位 ASCII 字符>;CPFS2.0 格式为 cpfs-<16 位 ASCII 字符>。

Description

String

对数据集版本进行自定义描述。

以区分不同的数据集版本。

DataSize

Integer

数据集文件占据空间的大小。

单位 Byte 。

DataCount

Integer

数据集文件数量。

单位个。

Labels

List

数据集版本标签列表。

更多信息,请参见Labels属性

Options

String

扩展字段。

JsonString 类型。 当 DLC 使用数据集时,可通过配置 mountPath 字段指定数据集默认挂载路径。

SourceType

String

数据来源类型。

默认为 USER。支持以下取值:

  • PAI-PUBLIC-DATASET:PAI 公共数据集。

  • ITAG:iTAG 模块标注结果生成的数据集。

  • USER:用户注册的数据集。

枚举值:

  • PAI_PUBLIC_DATASET:PAI_PUBLIC_DATASET。

  • ITAG:ITAG。

  • USER:USER。

SourceId

String

数据来源 ID。

  • 当 SourceType 为 USER 时,SourceId 支持自定义。

  • 当 SourceType 为 ITAG 时,即 iTAG 模块标注结果生成的数据集时,SourceId 为 ITAG 的任务 ID。

  • 当 SourceType 为 PAI_PUBLIC_DATASET 时,即使用 PAI 公共数据集创建的数据集时,SourceId 默认为空。

Labels语法

"Labels": [
  {
    "Value": String,
    "Key": String
  }
]

Labels属性

属性名称

类型

必须

允许更新

描述

约束

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

长度为1~128个字符,不能以aliyunacs:开头,不能包含http://https:// 。

Value

String

标签值。

长度为0~128个字符,不能以aliyunacs:开头,不能包含http://https:// 。

返回值

Fn::GetAtt

VersionName:数据集版本名称。

示例

YAML
JSON
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DataSourceType:
    Type: String
    Description:
      en: |-
        The data source type. The following values are supported:
        - OSS: Alibaba Cloud Object Storage (OSS).
        - NAS: Alibaba cloud file storage (NAS).
        - CPFS
    AllowedValues:
      - OSS
      - NAS
      - CPFS
    Required: true
  Uri:
    Type: String
    Description:
      en: |-
        The Uri configuration sample is as follows:
        - The data source type is OSS:'oss://bucket.endpoint/object'
        - The data source type is NAS:
        The general NAS format is: 'nas://<nasfisid>.region/subpath/to/dir/';
        CPFS1.0:'nas://<cpfs-fsid>.region/subpath/to/dir /';
        CPFS2.0:'nas://<cpfs-fsid>.region/<protocolserviceid>/'.
        CPFS1.0 and CPFS2.0 are distinguished by the format of fsid: CPFS1.0 is cpfs-<8-bit ascii characters>;CPFS2.0 is cpfs-<16 ascii characters>.
    AllowedPattern: ^(oss://|nas://).*
    Required: true
  Property:
    Type: String
    Description:
      en: |-
        The properties of the dataset. The following values are supported:
        - FILE: FILE.
        - DIRECTORY: folder.
    AllowedValues:
      - FILE
      - DIRECTORY
    Required: true
  DatasetId:
    Type: String
    Description:
      en: The ID of the dataset.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::PAI::DatasetVersion
    Properties:
      DataSourceType:
        Ref: DataSourceType
      Uri:
        Ref: Uri
      Property:
        Ref: Property
      DatasetId:
        Ref: DatasetId
Outputs:
  VersionName:
    Description: Dataset version name.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - VersionName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DataSourceType": {
      "Type": "String",
      "Description": {
        "en": "The data source type. The following values are supported:\n- OSS: Alibaba Cloud Object Storage (OSS).\n- NAS: Alibaba cloud file storage (NAS).\n- CPFS"
      },
      "AllowedValues": [
        "OSS",
        "NAS",
        "CPFS"
      ],
      "Required": true
    },
    "Uri": {
      "Type": "String",
      "Description": {
        "en": "The Uri configuration sample is as follows:\n- The data source type is OSS:'oss://bucket.endpoint/object'\n- The data source type is NAS:\nThe general NAS format is: 'nas://<nasfisid>.region/subpath/to/dir/';\nCPFS1.0:'nas://<cpfs-fsid>.region/subpath/to/dir /';\nCPFS2.0:'nas://<cpfs-fsid>.region/<protocolserviceid>/'.\nCPFS1.0 and CPFS2.0 are distinguished by the format of fsid: CPFS1.0 is cpfs-<8-bit ascii characters>;CPFS2.0 is cpfs-<16 ascii characters>."
      },
      "AllowedPattern": "^(oss://|nas://).*",
      "Required": true
    },
    "Property": {
      "Type": "String",
      "Description": {
        "en": "The properties of the dataset. The following values are supported:\n- FILE: FILE.\n- DIRECTORY: folder."
      },
      "AllowedValues": [
        "FILE",
        "DIRECTORY"
      ],
      "Required": true
    },
    "DatasetId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the dataset."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::PAI::DatasetVersion",
      "Properties": {
        "DataSourceType": {
          "Ref": "DataSourceType"
        },
        "Uri": {
          "Ref": "Uri"
        },
        "Property": {
          "Ref": "Property"
        },
        "DatasetId": {
          "Ref": "DatasetId"
        }
      }
    }
  },
  "Outputs": {
    "VersionName": {
      "Description": "Dataset version name.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "VersionName"
        ]
      }
    }
  }
}
  • 本页导读 (1)
  • 语法
  • 属性
  • Labels语法
  • Labels属性
  • 返回值
  • 示例