CreateImage

Updated at:

Creates an image.

Operation description

  1. You must purchase DataWorks Basic Edition or a higher edition to use this feature.

  2. Make sure that the service-linked role AliyunServiceRoleForDataWorks is created before you call this operation.

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

dataworks:CreateImage

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Name

string

Yes

The name of the image. The name can contain lowercase letters, digits, and underscores (_), and can be up to 128 characters in length.

task_image_001

Description

string

No

The description of the image. The description can be up to 128 characters in length.

create by xxxx

Accessibility

string

No

The visibility of the image. Valid values:

  • Public: The image is visible to all users.

  • Private: The image is visible only to the creator.

Valid values:

  • Private :

    Private

  • Public :

    Public

Public

ProviderType

string

Yes

The reference type of the image. Valid values:

  • ACR: ACR image repository.

  • DataWorks: DataWorks official image.

Valid values:

  • ACR :

    Container Registry (ACR)

  • DataWorks :

    DataWorks

ACR

Namespace

string

Yes

The namespace of the image. If you reference a DataWorks official image, set this parameter to DataWorks Default.

namespace_name

RepositoryName

string

Yes

The name of the image repository. If you reference a DataWorks official image, set this parameter to DataWorks Default.

repo_name

ProviderImageId

string

No

The image ID provided by the image provider. This parameter is required if you reference a DataWorks official image.

System_shell_20251201

AcrInstanceId

string

No

The ACR instance ID. This parameter is required if you reference an ACR image.

acr_instance_id

ImageUri

string

No

The URI of the image. This parameter is required if you reference an ACR image.

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

AcrAssociatedVpcId

string

No

The ID of the virtual private cloud (VPC) associated with the ACR instance. This parameter is required if you reference an ACR image.

vpc-xxx

EnableSyncMaxCompute

boolean

No

Specifies whether to synchronize the image to MaxCompute. Specify this parameter when you reference an ACR image. Default value: false.

false

Supported

object

Yes

The sub-purpose of the image.

Module

string

No

The sub-module of the image. Valid values:

  • Scheduler: DataStudio.

Valid values:

  • Scheduler :

    Scheduler

  • DataIntegration :

    Data Integration.

  • DataService :

    DataService Studio.

Scheduler

TaskTypes

array

No

The list of task types supported by the image.

string

No

The supported task type. Valid values:

  • Shell

  • Python

  • ServerIDE

  • Notebook

  • PyODPS 2

  • PyODPS 3

Valid values:

  • PyODPS 2 :

    PyODPS 2

  • Shell :

    Shell

  • Notebook :

    Notebook

  • PyODPS 3 :

    PyODPS 3

  • ServerIDE :

    ServerIDE

  • Python :

    Python

Shell

BuildConfig

object

No

The build configuration of the image. This parameter is required when ProviderType is set to DataWorks. If this parameter is missing, the operation returns error code 100701.

BuildType

string

No

The build type.

Valid values:

  • PackageInstallation :

    Package installation.

PackageInstallation

PackageInstallationScripts

array<object>

No

The list of pre-installation scripts. This parameter is required and must be a non-empty array when BuildType is set to PackageInstallation.

object

No

The pre-installation script.

Type

string

No

The script type. Specify the value with the exact capitalization as the enumerated value. When you construct a request based on the response of an image query operation, use the corresponding enumerated value. For example, write PYTHON3 as Python3.

Valid values:

  • Yum :

    YUM

  • Script :

    Script.

  • Python2 :

    Python 2

  • Python3 :

    Python 3

Python3

Content

string

No

The content of the script. When you specify package names, separate multiple package names with commas (,). To find the supported package names for a specific type, log on to the DataWorks console in the target region, go to the Image Management page, and view the package drop-down list when you create a custom image. For more information, see Custom image. If an unsupported package name is specified, error code 100701 (Not supported package name) is returned.

requests

ClientToken

string

Yes

The client token for idempotence.

dasfsd-94fqwe-da8d

Response elements

Element

Type

Description

Example

object

Schema of Response

Success

boolean

Indicates whether the request is successful.

true

ImageId

string

The ID of the created image.

Custom_image_xxxx_xxxx

RequestId

string

The ID of the request. You can use the ID to locate logs and troubleshoot issues.

6A6CBE87-9F91-1323-B680-E7A7065XXXXX

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.