CreateImage - 创建镜像

更新时间:
复制 MD 格式

创建镜像。

接口说明

  1. 需要购买 DataWorks 基础版及以上版本才能使用。

  2. 请确保在使用该接口前,已创建服务关联角色 AliyunServiceRoleForDataWorks。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

Name

string

镜像名称,可包含小写字母、数字、下划线(_),最多 128 个字符

task_image_001

Description

string

镜像描述信息,最多 128 个字符

create by xxxx

Accessibility

string

镜像可见性:

  • Public:全员可见;

  • Private:仅创建者可见。

枚举值:

  • Private :

    Private

  • Public :

    Public

Public

ProviderType

string

镜像引用类型:

  • ACR:ACR 镜像仓库;

  • DataWorks:DataWorks 官方镜像。

ACR

Namespace

string

镜像命名空间,引用 DataWorks 官方镜像填 DataWorks Default

namespace_name

RepositoryName

string

镜像仓库名,引用 DataWorks 官方镜像填 DataWorks Default

repo_name

ProviderImageId

string

镜像提供方镜像 ID,引用 DataWorks 官方镜像必填

System_shell_20251201

AcrInstanceId

string

ACR 实例 ID,引用 ACR 镜像必填

acr_instance_id

ImageUri

string

镜像 URI,引用 ACR 镜像必填

registry-vpc.cn-beijing.cr.aliyuncs.com/namespace/image:0.1.0

AcrAssociatedVpcId

string

ACR 实例关联专有网络 ID,引用 ACR 镜像必填

vpc-xxx

EnableSyncMaxCompute

boolean

是否同步镜像至 MaxCompute,引用 ACR 镜像时填写,默认为 false

false

Supported

object

镜像作用子用途

Module

string

镜像作用子模块:

  • Scheduler:数据开发。

枚举值:

  • Scheduler :

    Scheduler

Scheduler

TaskTypes

array

镜像支持的任务类型列表

string

支持的任务类型:

  • Shell

  • Python

  • ServerIDE

  • Notebook

  • PyODPS 2

  • PyODPS 3

枚举值:

  • PyODPS 2 :

    PyODPS 2

  • Shell :

    Shell

  • Notebook :

    Notebook

  • PyODPS 3 :

    PyODPS 3

  • ServerIDE :

    ServerIDE

  • Python :

    Python

Shell

BuildConfig

object

镜像构建配置

BuildType

string

构建类型

PackageInstallation

PackageInstallationScripts

array<object>

预安装执行脚本列表

object

预安装执行脚本

Type

string

脚本类型

Python3

Content

string

脚本内容,若为安装包名称则以英文逗号分隔

requests

ClientToken

string

客户端幂等 id

dasfsd-94fqwe-da8d

返回参数

名称

类型

描述

示例值

object

Schema of Response

Success

boolean

是否请求成功

true

ImageId

string

创建的镜像 ID

Custom_image_xxxx_xxxx

RequestId

string

请求的 ID,用于定位日志,排查问题

6A6CBE87-9F91-1323-B680-E7A7065XXXXX

示例

正常返回示例

JSON格式

{
  "Success": true,
  "ImageId": "Custom_image_xxxx_xxxx",
  "RequestId": "6A6CBE87-9F91-1323-B680-E7A7065XXXXX"
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情