Binding Skills
Function
This API is used to bind skills to instances in batches.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
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
workspace:agentSkill:addAuthorization
Write
-
-
-
obs:object:getObject
URI
POST /v3/ai-agents/skill-bindings
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Language | No | String | Language, which is used for internationalization. |
| X-Client-Token | No | String | Idempotency key, in UUID format. Creation APIs carry this request header, and the server implements idempotence control based on this header. The response header returns the same value. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| instance_ids | Yes | Array of strings | Instance IDs. |
| skill_ids | Yes | Array of strings | Skill IDs. |
| versions | No | Array of strings | Skill versions. Each version corresponds to a skill_ids value. If this parameter is not passed or the corresponding position is empty, the current version of the skill is used. |
| tags | No | Array of strings | Tags. The format is key:value. You can query the tbl_desktop_tags table by tag to obtain the associated instance IDs, which are then deduplicated with instance_ids. |
Response Parameters
Status code: 201
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| Parameter | Type | Description |
|---|---|---|
| job_id | String | ID of the TaskFlow task for batch binding. |
| total | Integer | Total number of items. |
| success_count | Integer | Number of successful items. |
| failed_count | Integer | Number of failed items. |
| failed_details | Array of BindingFailedDetail objects | Failed item list. |
| Parameter | Type | Description |
|---|---|---|
| instance_id | String | Instance ID. |
| skill_id | String | Skill ID. |
| error_code | String | Error code, in the format of WKS.XXXXXXXX. |
| error_msg | String | Error information. |
Status code: 207
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| Parameter | Type | Description |
|---|---|---|
| job_id | String | ID of the TaskFlow task for batch binding. |
| total | Integer | Total number of items. |
| success_count | Integer | Number of successful items. |
| failed_count | Integer | Number of failed items. |
| failed_details | Array of BindingFailedDetail objects | Failed item list. |
| Parameter | Type | Description |
|---|---|---|
| instance_id | String | Instance ID. |
| skill_id | String | Skill ID. |
| error_code | String | Error code, in the format of WKS.XXXXXXXX. |
| error_msg | String | Error information. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Example Requests
/v3/ai-agents/skill-bindings
{
"instance_ids" : [ "instance-001", "instance-002" ],
"skill_ids" : [ "skill-uuid-001", "skill-uuid-002" ],
"versions" : [ "1.0.0", "2.1.3" ],
"tags" : [ "env:production", "dept:finance" ]
} Example Responses
Status code: 201
{
"job_id" : "job-uuid-001",
"total" : 6,
"success_count" : 4,
"failed_count" : 2,
"failed_details" : [ {
"instance_id" : "instance-001",
"skill_id" : "skill-uuid-001",
"error_code" : "WKS.00311142",
"error_msg" : "Skill is not available in this region"
}, {
"instance_id" : "instance-002",
"skill_id" : "skill-uuid-002",
"error_code" : "WKS.00311143",
"error_msg" : "Instance does not exist"
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 201 | Created |
| 207 | Multi-Status |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 500 | Internal Server Error |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot