九游平台/ 云容器引擎 cce/ / / / 删除addoninstance
更新时间:2024-06-27 gmt 08:00

删除addoninstance-九游平台

功能介绍

删除插件实例的功能。

调用方法

请参见。

uri

delete /api/v3/addons/{id}

表1 路径参数

参数

是否必选

参数类型

描述

id

string

插件实例id

表2 query参数

参数

是否必选

参数类型

描述

cluster_id

string

集群 id(废弃中),获取方式请参见

请求参数

表3 请求header参数

参数

是否必选

参数类型

描述

content-type

string

消息体的类型(格式)

x-auth-token

string

调用接口的认证方式分为token和ak/sk两种,如果您使用的token方式,此参数为必填,请填写token的值,获取方式请参见。

响应参数

状态码: 200

表4 响应body参数

参数

参数类型

描述

-

string

请求示例

响应示例

状态码: 200

ok

success

sdk代码示例

sdk代码示例如下。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
packagecom.huaweicloud.sdk.test;
importcom.huaweicloud.sdk.core.auth.icredential;
importcom.huaweicloud.sdk.core.auth.basiccredentials;
importcom.huaweicloud.sdk.core.exception.connectionexception;
importcom.huaweicloud.sdk.core.exception.requesttimeoutexception;
importcom.huaweicloud.sdk.core.exception.serviceresponseexception;
importcom.huaweicloud.sdk.cce.v3.region.cceregion;
importcom.huaweicloud.sdk.cce.v3.*;
importcom.huaweicloud.sdk.cce.v3.model.*;
publicclass deleteaddoninstancesolution{
publicstaticvoidmain(string[]args){
// the ak and sk used for authentication are hard-coded or stored in plaintext, which has great security risks. it is recommended that the ak and sk be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// in this example, ak and sk are stored in environment variables for authentication. before running this example, set environment variables cloud_sdk_ak and cloud_sdk_sk in the local environment
stringak=system.getenv("cloud_sdk_ak");
stringsk=system.getenv("cloud_sdk_sk");
icredentialauth=newbasiccredentials()
.withak(ak)
.withsk(sk);
cceclientclient=cceclient.newbuilder()
.withcredential(auth)
.withregion(cceregion.valueof(""))
.build();
deleteaddoninstancerequestrequest=newdeleteaddoninstancerequest();
request.withid("{id}");
try{
deleteaddoninstanceresponseresponse=client.deleteaddoninstance(request);
system.out.println(response.tostring());
}catch(connectionexceptione){
e.printstacktrace();
}catch(requesttimeoutexceptione){
e.printstacktrace();
}catch(serviceresponseexceptione){
e.printstacktrace();
system.out.println(e.gethttpstatuscode());
system.out.println(e.getrequestid());
system.out.println(e.geterrorcode());
system.out.println(e.geterrormsg());
}
}
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# coding: utf-8
import os
from huaweicloudsdkcore.auth.credentials import basiccredentials
from huaweicloudsdkcce.v3.region.cce_region import cceregion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcce.v3 import *
if __name__ == "__main__":
    # the ak and sk used for authentication are hard-coded or stored in plaintext, which has great security risks. it is recommended that the ak and sk be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # in this example, ak and sk are stored in environment variables for authentication. before running this example, set environment variables cloud_sdk_ak and cloud_sdk_sk in the local environment
    ak = os.environ["cloud_sdk_ak"]
    sk = os.environ["cloud_sdk_sk"]
    credentials = basiccredentials(ak, sk)
    client = cceclient.new_builder() \
        .with_credentials(credentials) \
        .with_region(cceregion.value_of("")) \
        .build()
    try:
        request = deleteaddoninstancerequest()
        request.id = "{id}"
        response = client.delete_addon_instance(request)
        print(response)
    except exceptions.clientrequestexception as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
packagemain
import(
"fmt"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
cce"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3/model"
region"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3/region"
)
funcmain(){
// the ak and sk used for authentication are hard-coded or stored in plaintext, which has great security risks. it is recommended that the ak and sk be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// in this example, ak and sk are stored in environment variables for authentication. before running this example, set environment variables cloud_sdk_ak and cloud_sdk_sk in the local environment
ak:=os.getenv("cloud_sdk_ak")
sk:=os.getenv("cloud_sdk_sk")
auth:=basic.newcredentialsbuilder().
withak(ak).
withsk(sk).
build()
client:=cce.newcceclient(
cce.cceclientbuilder().
withregion(region.valueof("")).
withcredential(auth).
build())
request:=&model.deleteaddoninstancerequest{}
request.id="{id}"
response,err:=client.deleteaddoninstance(request)
iferr==nil{
fmt.printf("% v\n",response)
}else{
fmt.println(err)
}
}

更多编程语言的sdk代码示例,请参见的代码示例页签,可生成自动对应的sdk代码示例。

状态码

状态码

描述

200

ok

错误码

请参见。

相关文档

网站地图