Update a Plug-in¶
Function¶
This API is used to update a plug-in instance.
URI¶
PATCH /v2/{project_id}/pools/{pool_name}/plugins/{template_name}
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. For details, see Obtaining a Project ID and Name. |
pool_name | Yes | String | Resource pool name. |
template_name | Yes | String | Plug-in template name. |
Request Parameters¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
Content-Type | Yes | String | application/merge-patch+json. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
spec | Yes | PluginSpec object | Request for updating a plug-in instance. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
template | Yes | Template object | Template information of the plug-in instances. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
name | Yes | String | Name of the plug-in template to be installed, for example, log-agent. |
version | No | String | Version of the plug-in to be installed or upgraded. |
inputs | No | Map<String,Object> | Plug-in template installation parameters (varying depending on the plug-in). During the plug-in upgrade, you need to specify all the installation parameters. If the parameters are not specified, the default values in the plug-in template are used. The current plug-in installation parameters can be obtained through the API for querying plug-in instances. |
Response Parameters¶
Status code: 200
Parameter | Type | Description |
---|---|---|
spec | PluginSpec object | Request for updating a plug-in instance. |
Parameter | Type | Description |
---|---|---|
template | Template object | Template information of the plug-in instances. |
Parameter | Type | Description |
---|---|---|
name | String | Name of the plug-in template to be installed, for example, log-agent. |
version | String | Version of the plug-in to be installed or upgraded. |
inputs | Map<String,Object> | Plug-in template installation parameters (varying depending on the plug-in). During the plug-in upgrade, you need to specify all the installation parameters. If the parameters are not specified, the default values in the plug-in template are used. The current plug-in installation parameters can be obtained through the API for querying plug-in instances. |
Status code: 400
Parameter | Type | Description |
---|---|---|
error_code | String | Error code. |
error_msg | String | Error message. |
Example Requests¶
This API is used to update a plug-in instance.
PATCH https://{endpoint}/v2/{project_id}/pools/{pool_name}/plugins/{template_name}
{
"spec" : {
"template" : {
"version" : "1.6.63",
"inputs" : {
"custom" : {
"enable_dnsconfig_admission" : true,
"nameserver" : "123.123.123.123",
"ndots" : "3",
"search" : "123,234"
},
"flavor" : {
"name" : "custom",
"replicas" : 2,
"resources" : [ {
"limitsCpu" : "234m",
"limitsMem" : "234Mi",
"name" : "node-local-dns-admission-controller",
"replicas" : 1,
"requestsCpu" : "123m",
"requestsMem" : "123Mi"
}, {
"limitsCpu" : "234m",
"limitsMem" : "234Mi",
"name" : "node-local-dns-cache",
"requestsCpu" : "123m",
"requestsMem" : "123Mi"
} ]
}
}
}
}
}
Example Responses¶
Status code: 200
Request succeeded.
{
"spec" : {
"template" : {
"version" : "1.6.63",
"inputs" : {
"custom" : {
"enable_dnsconfig_admission" : true,
"nameserver" : "123.123.123.123",
"ndots" : "3",
"search" : "123,234"
},
"flavor" : {
"name" : "custom",
"replicas" : 2,
"resources" : [ {
"limitsCpu" : "234m",
"limitsMem" : "234Mi",
"name" : "node-local-dns-admission-controller",
"replicas" : 1,
"requestsCpu" : "123m",
"requestsMem" : "123Mi"
}, {
"limitsCpu" : "234m",
"limitsMem" : "234Mi",
"name" : "node-local-dns-cache",
"requestsCpu" : "123m",
"requestsMem" : "123Mi"
} ]
}
}
}
}
}
Status code: 400
Bad request
{
"error_code" : "ModelArts.50004000",
"error_msg" : "Bad request."
}
Status Codes¶
Status Code | Description |
---|---|
200 | Request succeeded. |
400 | Bad request |
Error Codes¶
See Error Codes.