UpdateResourceInstance - Update resource instance

Updated at:

Updates a resource instance.

Applies to

Centralized and regional deployment

Service endpoints and authorization

  • Get service endpoint: Replace {domain} in the API request syntax.

  • Get personal access token.

  • Get the organization ID: Required only for Centralized deployment. Go to the Organization Management page and find the organization ID on the Basic Information page.

Product

Resource

Required permissions

App Delivery

enterprise settings

Read and write

Request syntax

Centralized deployment

PUT https://{domain}/oapi/v1/appstack/organizations/{organizationId}/pools/instances/{name}

Regional deployment

PUT https://{domain}/oapi/v1/appstack/pools/instances/{name}

Request headers

Parameter

Type

Required

Description

Example

x-yunxiao-token

string

Yes

The personal access token for Alibaba Cloud DevOps.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example

name

string

path

Yes

The unique name of the resource instance. The name can contain only lowercase letters, digits, and hyphens (-), and must start and end with a lowercase letter or a digit.

my-k8s

kubeconfig

string

query

Yes

The kubeconfig content.

apiVersion: v1...

organizationId

string

path

  • Yes: Centralized deployment

  • No: Regional deployment

The organization ID.

ec766e63aee3437d9a51f334d6exe671

Request examples

Centralized deployment

curl -X 'PUT' \
  'https://{domain}/oapi/v1/appstack/organizations/ec766e63aee3437d9a51f334d6exe671/pools/instances/my-k8s?kubeconfig=apiVersion: v1...' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Regional deployment

curl -X 'PUT' \
  'https://{domain}/oapi/v1/appstack/pools/instances/my-k8s?kubeconfig=apiVersion: v1...' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example

-

object

data

object

The resource instance.

category

string

The category of the resource, such as compute, storage, or network. The only valid value is COMPUTE.

COMPUTE

cloudMetadata

string

The cloud product metadata.

cloudProvider

string

The cloud provider.

contextMap

object

The resource details.

description

string

The resource description.

Test cluster

displayName

string

The display name of the resource.

Example Kubernetes cluster

host

boolean

false

instanceId

string

The ID of the resource instance.

1745402511111

k8s

boolean

Indicates whether the resource is a Kubernetes resource.

true

name

string

The unique name of the resource instance. The name can contain only lowercase letters, digits, and hyphens (-), and must start and end with a lowercase letter or a digit.

my-k8s

poolName

string

The unique name of the resource pool.

default

region

string

The region where the resource is located.

cn-hangzhou

resourceItemList

array[string]

The list of resource items.

[]

errorAdvice

string

errorCode

string

The returned error code. Possible values include: [ResourceInstanceNotFound, ResourceInstanceKubeConfigInvalid, ClusterCaNotAllowedInKubeConfig, UserExecNotAllowedInKubeConfig, UserClientCertificateNotAllowedInKubeConfig, UserClientKeyNotAllowedInKubeConfig, UserTokenFileNotAllowedInKubeConfig, UserAuthProviderNotAllowedInKubeConfig, SystemInternalError].

ResourceInstanceNotFound

errorMap

object

errorMessage

string

showType

integer

success

boolean

traceId

string

Response example

{
    "data": {
        "category": "COMPUTE",
        "cloudMetadata": "",
        "cloudProvider": "",
        "contextMap": {
        },
        "description": "Test cluster",
        "displayName": "Example Kubernetes cluster",
        "host": false,
        "instanceId": "1745402511111",
        "k8s": true,
        "name": "my-k8s",
        "poolName": "default",
        "region": "cn-hangzhou",
        "resourceItemList": [],
        "type": "SELF_KUBERNETES"
    },
    "errorAdvice": "",
    "errorCode": "ResourceInstanceNotFound",
    "errorMap": {
    },
    "errorMessage": "",
    "showType": 0,
    "success": false,
    "traceId": ""
}

Error codes

Go to the Error Code Center for a list of related error codes.