Updated on 2026-06-25 GMT+08:00

Creating a Grayscale Release Task

Function

This API is used to create a grayscale release task.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    asm:mesh:createRelease

    Write

    mesh *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    -

    -

URI

POST /v2/meshes/{mesh_id}/namespaces/{namespace}/releases

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

mesh_id

Yes

String

Mesh ID

namespace

Yes

String

Namespace

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format)

Range:

  • application/json;charset=utf-8: The content is in JSON format and encoded using UTF-8.

  • application/json: The content is in JSON format.

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

kind

No

String

API type. Fixed value: Release

apiVersion

No

String

API version. Fixed value: asm/v2

metadata

Yes

ReleaseMetadata object

Basic information about the grayscale release task of a mesh. Metadata is a collection of attributes.

spec

Yes

ReleaseSpec object

Attributes of the grayscale release task of a mesh

Table 4 ReleaseMetadata

Parameter

Mandatory

Type

Description

meshID

No

String

ID of the mesh that a grayscale release task belongs to

name

Yes

String

Grayscale release task name

Enter 4 to 64 characters. The name must start with a lowercase letter and not end with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

uid

No

String

ID of the grayscale release task, which is unique. The value is automatically generated after the task is created. A custom value will not take effect.

namespace

Yes

String

Namespace of the grayscale release task

Table 5 ReleaseSpec

Parameter

Mandatory

Type

Description

serviceName

Yes

String

Name of the service corresponding to the grayscale release task of a mesh

clusterID

Yes

String

ID of the cluster corresponding to the grayscale release task of a mesh

deploymentName

Yes

String

Name of the workload corresponding to the grayscale release task of a mesh

version

Yes

String

Mesh version corresponding to a grayscale release task

type

Yes

String

Type of the grayscale release task of a mesh

grayDeployments

Yes

Array of GrayWorkload objects

Grayscale workload template for the grayscale release task of a mesh

Table 6 GrayWorkload

Parameter

Mandatory

Type

Description

clusterID

Yes

String

ID of the cluster where the grayscale workload resides

template

Yes

Object

Grayscale workload. For details, see Deployment | Kubernetes.

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

kind

String

API type. Fixed value: Release

apiVersion

String

API version. Fixed value: asm/v2

metadata

ReleaseMetadata object

Basic information about the grayscale release task of a mesh. Metadata is a collection of attributes.

spec

ReleaseSpec object

Attributes of the grayscale release task of a mesh

status

ReleaseStatus object

Status of the grayscale release task of a mesh

Table 8 ReleaseMetadata

Parameter

Type

Description

meshID

String

ID of the mesh that a grayscale release task belongs to

name

String

Grayscale release task name

Enter 4 to 64 characters. The name must start with a lowercase letter and not end with a hyphen (-). Only lowercase letters, digits, and hyphens (-) are allowed.

uid

String

ID of the grayscale release task, which is unique. The value is automatically generated after the task is created. A custom value will not take effect.

namespace

String

Namespace of the grayscale release task

Table 9 ReleaseSpec

Parameter

Type

Description

serviceName

String

Name of the service corresponding to the grayscale release task of a mesh

clusterID

String

ID of the cluster corresponding to the grayscale release task of a mesh

deploymentName

String

Name of the workload corresponding to the grayscale release task of a mesh

version

String

Mesh version corresponding to a grayscale release task

type

String

Type of the grayscale release task of a mesh

grayDeployments

Array of GrayWorkload objects

Grayscale workload template for the grayscale release task of a mesh

Table 10 GrayWorkload

Parameter

Type

Description

clusterID

String

ID of the cluster where the grayscale workload resides

template

Object

Grayscale workload. For details, see Deployment | Kubernetes.

Table 11 ReleaseStatus

Parameter

Type

Description

phase

String

Phase of the grayscale release task of a mesh

startTime

String

Start time of the grayscale release task of a mesh

updateTime

String

Update time of the grayscale release task of a mesh

deployment

Object

Original workload in the grayscale release task of a mesh. For details, see Deployment | Kubernetes.

grayDeployments

Array of objects

Grayscale workload created in the grayscale release task of a mesh. For details, see Deployment | Kubernetes.

Status code: 400

Table 12 Response body parameters

Parameter

Type

Description

errorCode

String

Error code

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

The grayscale release task is created.

400

Failed to create the grayscale release task due to incorrect parameters.

Error Codes

See Error Codes.