Obtaining Inference Service Tags
Function
This API is used to obtain inference service tags in the current project. Tags in all workspaces are obtained by default. If you do not have the permission, no tag is returned.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer. Obtain its CLI example hcloud ModelArts ListServiceTags.
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
modelarts:service:get
Read
service *
g:ResourceTag/<tag-key>
-
-
URI
GET /v1/{project_id}/services/tms/tags
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed. Range: N/A Default Value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition: User token. It can be obtained by calling the IAM API. The token is the value of X-Subject-Token in the response header. Constraints: N/A Range: N/A Default Value: N/A |
|
Content-Type |
Yes |
String |
Definition: Enter application/json;charset=utf8. Constraints: N/A Range: N/A Default Value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
tags |
Array of CombineTmsTags objects |
Definition: Data structure of merged tags with the same key. |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Definition: Tag key. Range: The value allows up to 128 characters, including letters, digits, spaces, and the following special characters: _ . : = + - @. The value cannot start or end with a space or start with sys. |
|
values |
Array of strings |
Definition: Merged tag values with the same key. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Range: N/A |
|
error_msg |
String |
Definition: Error message. Range: N/A |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Range: N/A |
|
error_msg |
String |
Definition: Error message. Range: N/A |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Range: N/A |
|
error_msg |
String |
Definition: Error message. Range: N/A |
Example Requests
https://{endpoint}/v1/{project_id}/services/tms/tags
Example Responses
Status code: 200
All service tags of the project are returned.
{
"tags" : [ {
"key" : "model_version",
"values" : [ "0.1", "0.2" ]
}, {
"key" : "conda_version",
"values" : [ "10.2", "11.0" ]
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
All service tags of the project are returned. |
|
400 |
Invalid parameter |
|
401 |
Authentication failed. |
|
403 |
Insufficient permissions |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank 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