CreateArtifact

Updated at:

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 when you create a new version for 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: ECS image artifact.

  • AcrImage: container image artifact.

  • File: OSS file artifact.

  • Script: script artifact.

  • HelmChart: Helm chart artifact.

EcsImage

ArtifactBuildType

string

No

The build artifact type. Valid values:

  • EcsImage: builds an ECS image.

  • Dockerflie: 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 image

VersionName

string

Yes

The artifact version name.

v1

Description

string

No

The artifact description.

Redhat8_0 image

ArtifactProperty

object

No

The artifact properties.

Url

string

No

The URL of the file artifact.

You can upload the file and obtain the file URL in the OSS 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 is valid only when the artifact is an image artifact.

cn-hangzhou

ImageId

string

No

The image ID.

After you specify RegionId, you can call the DescribeImages operation to query the available image IDs in the specified region.

Note

This parameter is valid only when the artifact is an image artifact.

m-uf645fnsef9dsxmw****

CommodityCode

string

No

The commodity code in Alibaba Cloud Marketplace.

You can obtain the commodity code in the Alibaba Cloud Marketplace console.

Note

This parameter is valid only when the artifact is an image artifact.

cmjj00****

CommodityVersion

string

No

The commodity version in Alibaba Cloud Marketplace.

You can view the commodity version on the Alibaba Cloud Marketplace page.

Note

This parameter is valid only when the artifact is an image artifact.

V1.0

RepoName

string

No

The name of the image repository.

Note

This parameter is valid only when the artifact is a container image artifact or a Helm chart artifact.

wordpress

RepoId

string

No

The image repository ID.

You can call the ListAcrImageRepositories operation to obtain the image repository ID.

Note

This parameter is valid only when the artifact is a container image artifact or a Helm chart artifact.

crr-d8o1nponyc2t****

Tag

string

No

Image version of the image repository.

You can call the ListAcrImageTags operation to obtain image version of the image repository.

Note

This parameter is valid only when the artifact is a container image artifact or a Helm chart artifact.

v1

RepoType

string

No

The repository type. Valid values: Public and Private.

Public

SupportRegionIds

array

No

The regions where image distribution is supported.

string

No

The regions where image distribution is supported.

Note

This parameter is valid only when the artifact is an ECS image artifact.

cn-hangzhou

ResourceGroupId

string

No

The resource group ID.

rg-acfm2jfvb7b****

Tag

array<object>

No

The custom tags.

object

No

The custom tags.

Key

string

No

The tag key.

key1

Value

string

No

The tag value.

value1

ArtifactBuildProperty

object

No

The artifact build properties, which are used to build managed artifacts.

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 is valid only when the artifact is an ECS image artifact.

RunShellScript

CommandContent

string

No

The command content.

Note

This parameter is valid only when the artifact is an ECS image artifact.

echo "start run command"

SourceImageId

string

No

The source image ID. Two types are supported:

  • Image ID: Specify the image ID of an ECS image.

  • OOS common parameter name: Specify the name of an Operation Orchestration Service (OOS) common parameter to automatically obtain the corresponding image ID.

Note

This parameter is valid only when the artifact is an ECS image artifact.

Image ID: m-t4nhenrdc38pe4***** ubuntu_22_04_x64_20G_alibase_20240926.vhd OOS public parameter name: aliyun/services/computenest/images/aliyun_3_2104_python_3_11

RegionId

string

No

The region ID of the source image.

Note

This parameter is valid only when the artifact is an ECS image artifact.

cn-hangzhou

CodeRepo

object

No

The code repository address.

Note

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

Platform

string

No

The platform where the code repository is hosted. 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 private.

aliyun-computenest

Branch

string

No

The branch name of the code repository.

main

Endpoint

string

No

The endpoint. This parameter is required for private deployments of GitLab.

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 in the code repository.

Default value: Dockerfile.

Note

This parameter is valid only when the ArtifactBuildType Settings is Dockerfile.

./file/Dockerfile

BuildArgs

array<object>

No

The build arguments.

Note

This parameter is valid only when ArtifactBuildType is set to Dockerfile.

object

No

This parameter is used for the docker build --build-arg command.

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.

This parameter is used for docker pull ${SourceContainerImage}.

Note

This parameter is valid only when ArtifactBuildType is set to ContainerImage.

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

SystemDiskSize

integer

No

The system cloud disk size. Unit: GiB.

40

EnableGpu

boolean

No

Specifies whether a GPU is required. By default, a CPU instance is used.

false

ClientToken

string

No

The client token that is used to ensure idempotence.

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 image

VersionName

string

The artifact name.

v1

ArtifactVersion

string

The artifact version.

2

Description

string

The artifact description.

Redhat8_0 image

GmtModified

string

The update time.

2022-11-11T12:00:00Z

Status

string

The artifact status.

Created

MaxVersion

integer

The latest version of the artifact.

1

ArtifactProperty

string

The artifact properties.

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

SupportRegionIds

string

The region IDs where the artifact is distributed.

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

StatusDetail

string

The status description of the artifact.

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

ArtifactBuildProperty

string

The artifact build properties, which are used to build managed artifacts.

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

ArtifactBuildType

string

The build artifact type.

Dockerfile

Examples

Success response

JSON format

{
  "RequestId": "E73F09DC-6C13-5CB1-A10F-7A4E125ABD2C",
  "ArtifactId": "artifact-eea08d1e2d3a43ae****",
  "ArtifactType": "EcsImage",
  "Name": "Redhat8_5 image",
  "VersionName": "v1",
  "ArtifactVersion": "2",
  "Description": "Redhat8_0 image",
  "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.