All Products
Search
Document Center

Compute Nest:CreateArtifact

Last Updated:Oct 23, 2025

Creates an artifact.

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

computenestsupplier:CreateArtifact

create

*Artifact

acs:computenestsupplier:{#regionId}:{#accountId}:artifact/{#ArtifactId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ArtifactId

string

No

The artifact ID.

This parameter is required to create a new version of an existing artifact.

You can call the ListArtifacts operation to obtain the artifact ID.

artifact-eea08d1e2d3a43ae****

ArtifactType

string

Yes

The artifact type.

Valid values:

  • EcsImage: an ECS image artifact.

  • AcrImage: a container image artifact.

  • File: an Object Storage Service (OSS) file artifact.

  • Script: a script artifact.

  • HelmChart: a Helm chart artifact.

EcsImage

ArtifactBuildType

string

No

The type of the artifact to be built. Valid values:

  • EcsImage: builds an ECS image.

  • Dockerfile: builds a container image based on a Dockerfile.

  • Buildpacks: builds a container image based on Buildpacks.

  • ContainerImage: builds a container image by renaming an existing container image.

Dockerflie

Name

string

Yes

The artifact name.

Redhat8_5镜像

VersionName

string

Yes

The name of the artifact version.

v1

Description

string

No

The description of the artifact.

Redhat8_0镜像

ArtifactProperty

object

No

The content of the artifact.

Url

string

No

The URL of the file artifact.

Upload a file and obtain its URL in the Object Storage Service console.

https://service-info-private.oss-cn-hangzhou.aliyuncs.com/130920852876****/template/2e1ce8fc-****-481c-9e8e-789ba9db487d.json

RegionId

string

No

The region of the image.

Note

This parameter can be set only when the artifact is an image artifact.

cn-hangzhou

ImageId

string

No

The image ID.

After you specify a region ID, call the DescribeImages operation to view the available image IDs in the specified region.

Note

This parameter can be set only when the artifact is an image artifact.

m-uf645fnsef9dsxmw****

CommodityCode

string

No

The commodity code of the product in Alibaba Cloud Marketplace.

Obtain the commodity code in the Alibaba Cloud Marketplace console.

Note

This parameter can be set only when the artifact is an image artifact.

cmjj00****

CommodityVersion

string

No

The version of the product in Alibaba Cloud Marketplace.

View the product version on the Alibaba Cloud Marketplace page.

Note

This parameter can be set only when the artifact is an image artifact.

V1.0

RepoName

string

No

The name of the image repository.

Note

This parameter can be set only when the artifact is a container image artifact or a Helm chart artifact.

wordpress

RepoId

string

No

The ID of the image repository.

Call the ListAcrImageRepositories operation to obtain the image repository ID.

Note

This parameter can be set only when the artifact is a container image artifact or a Helm chart artifact.

crr-d8o1nponyc2t****

Tag

string

No

The version of the image in the image repository.

Call the ListAcrImageTags operation to obtain the version of the image in the image repository.

Note

This parameter can be set only when the artifact is a container image artifact or a Helm chart artifact.

v1

RepoType

string

No

The type of the repository. Valid values: Public and Private.

Public

SupportRegionIds

array

No

The regions where the image can be distributed.

string

No

The region where the image can be distributed.

Note

This parameter can be set only when the artifact is an ECS image artifact.

cn-hangzhou

ResourceGroupId

string

No

The ID of the resource group.

rg-acfm2jfvb7b****

Tag

array<object>

No

The custom tags.

object

No

The custom tag.

Key

string

No

The tag key.

key1

Value

string

No

The tag value.

value1

ArtifactBuildProperty

object

No

The content used to build the artifact. This parameter is used for managed artifact builds.

CommandType

string

No

The command type. Valid values:

  • RunBatScript: The command is a BAT script that runs on a Windows instance.

  • RunPowerShellScript: The command is a PowerShell script that runs on a Windows instance.

  • RunShellScript: The command is a shell script that runs on a Linux instance.

Note

This parameter can be set only when the artifact is an ECS image artifact.

RunShellScript

CommandContent

string

No

The content of the command.

Note

This parameter can be set only when the artifact is an ECS image artifact.

echo "start run command"

SourceImageId

string

No

The source image ID. The following types are supported:

  • Image ID: The ID of the ECS image.

  • OOS public parameter name: The image ID is automatically obtained based on the name of the Operation Orchestration Service (OOS) public parameter.

Note

This parameter can be set only when the artifact is an ECS image artifact.

镜像ID:m-t4nhenrdc38pe4***** ubuntu_22_04_x64_20G_alibase_20240926.vhd oos公共参数名称:aliyun/services/computenest/images/aliyun_3_2104_python_3_11

RegionId

string

No

The ID of the region where the source image is located.

Note

This parameter can be set only when the artifact is an ECS image artifact.

cn-hangzhou

CodeRepo

object

No

The code repository address.

Note

This parameter can be set only when ArtifactBuildType is set to Dockerfile or Buildpacks.

Platform

string

No

The platform where the code repository is located. Valid values:

  • github

  • gitee

  • gitlab

  • codeup

github

RepoName

string

No

The repository name.

aliyun-computenest/quickstart-Lobexxx

Owner

string

No

The owner of the code repository.

Note

This parameter is required only when the code repository is a private repository.

aliyun-computenest

Branch

string

No

The name of the code repository branch.

main

Endpoint

string

No

The endpoint. This parameter is required for a private GitLab deployment.

http://121.40.25.0

OrgId

string

No

The organization ID.

455231

RepoId

integer

No

The repository ID.

103

DockerfilePath

string

No

The relative address of the Dockerfile file in the code repository.

Default value: Dockerfile.

Note

This parameter can be set only when ArtifactBuildType is set to Dockerfile.

./file/Dockerfile

BuildArgs

array<object>

No

The build arguments.

Note

This parameter can be set only when ArtifactBuildType is set to Dockerfile.

object

No

Used for docker build --build-arg.

ArgumentName

string

No

The name of the build argument.

ENV

ArgumentValue

string

No

The value of the build argument.

nginx:latest

SourceContainerImage

string

No

The pull address of the source container image.

Used for docker pull ${SourceContainerImage}.

Note

This parameter can be set only when ArtifactBuildType is set to ContainerImage.

pytorch/pytorch:2.5.1-cuda12.4-cudnn9-devel

SystemDiskSize

integer

No

The size of the system disk. Unit: GiB.

40

EnableGpu

boolean

No

Specifies whether to use a GPU-accelerated instance. By default, a CPU-powered instance is used.

false

ClientToken

string

No

Ensures the idempotence of the request.

10CM943JP0EN9D51H

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

E73F09DC-6C13-5CB1-A10F-7A4E125ABD2C

ArtifactId

string

The artifact ID.

artifact-eea08d1e2d3a43ae****

ArtifactType

string

The artifact type.

EcsImage

Name

string

The artifact name.

Redhat8_5镜像

VersionName

string

The name of the artifact version.

v1

ArtifactVersion

string

The artifact version.

2

Description

string

The description of the artifact.

Redhat8_0镜像

GmtModified

string

The time when the artifact was modified.

2022-11-11T12:00:00Z

Status

string

The status of the artifact.

Created

MaxVersion

integer

The latest version of the artifact.

1

ArtifactProperty

string

The content of the artifact.

{\"CommodityCode\":\"cmjj0005****\",\"CommodityVersion\":\"V2022****\"}

SupportRegionIds

string

The IDs of the regions to which the artifact is distributed.

[ "cn-beijing", "cn-hangzhou", "cn-shanghai" ]

StatusDetail

string

The description of the artifact status.

"/usr/local/share/aliyun-assist/work/script/t-hz04zm90y6og0sg.sh: line 1: pip: command not found"

ArtifactBuildProperty

string

The content used to build the artifact. This parameter is used for managed artifact builds.

"{\"RegionId\":\"xxx\", \"SourceImageId\":\"xxx\", \"\":\"xxx\", \"CommandType\":\"xxx\", \"CommandContent\":\"xxx\"}"

ArtifactBuildType

string

The type of the built artifact.

Dockerfile

Examples

Success response

JSON format

{
  "RequestId": "E73F09DC-6C13-5CB1-A10F-7A4E125ABD2C",
  "ArtifactId": "artifact-eea08d1e2d3a43ae****",
  "ArtifactType": "EcsImage",
  "Name": "Redhat8_5镜像",
  "VersionName": "v1",
  "ArtifactVersion": "2",
  "Description": "Redhat8_0镜像",
  "GmtModified": "2022-11-11T12:00:00Z",
  "Status": "Created",
  "MaxVersion": 1,
  "ArtifactProperty": "{\\\"CommodityCode\\\":\\\"cmjj0005****\\\",\\\"CommodityVersion\\\":\\\"V2022****\\\"}",
  "SupportRegionIds": "[\n\t\t\t\"cn-beijing\",\n\t\t\t\"cn-hangzhou\",\n\t\t\t\"cn-shanghai\"\n\t\t]",
  "StatusDetail": "\"/usr/local/share/aliyun-assist/work/script/t-hz04zm90y6og0sg.sh: line 1: pip: command not found\"",
  "ArtifactBuildProperty": "\"{\\\"RegionId\\\":\\\"xxx\\\", \\\"SourceImageId\\\":\\\"xxx\\\", \\\"\\\":\\\"xxx\\\", \\\"CommandType\\\":\\\"xxx\\\", \\\"CommandContent\\\":\\\"xxx\\\"}\"",
  "ArtifactBuildType": "Dockerfile"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.