CreateImage
Creates an image.
Operation description
You must purchase DataWorks Basic Edition or a higher edition to use this feature.
Make sure that the service-linked role AliyunServiceRoleForDataWorks is created before you call this operation.
Try it now
Test
RAM authorization
|
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:
Valid values:
|
Public |
| ProviderType |
string |
Yes |
The reference type of the image. Valid values:
Valid values:
|
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:
Valid values:
|
Scheduler |
| TaskTypes |
array |
No |
The list of task types supported by the image. |
|
|
string |
No |
The supported task type. Valid values:
Valid values:
|
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 |
| 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:
|
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.