Obtaining the Service Deployment Instance List
Function
This API is used to obtain the service deployment instances of the current tenant and filter them by status, which can be Running and Deleted. Pagination and keyword filtering are supported. It is used when you need to manage and monitor service instance status. Before calling this API, ensure that you have the query permission and provide optional filter criteria and pagination parameters. The returned list contains the basic information about all deployment instances, including the deployment name, latest update time, and status. If the current tenant does not have any service instance that meets the conditions or the provided parameters are invalid, an empty list or the corresponding error message is returned, prompting you to check the validity and permission of the input data.
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
modelarts:service:listDeploymentInstances
Read
service *
-
-
-
URI
GET /v2/{project_id}/services/{id}/deployments/{name}/instances
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. For details, see Obtaining a Project ID and Name. Constraints N/A Range Project ID. Default Value N/A |
| id | Yes | String | Definition Unique service ID. |
| name | Yes | String | Definition Service deployment name. The value can be all. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| status | No | Array of strings | Definition Service instance status. Multiple statuses can be filtered at a time. Separate multiple statuses with commas (,). No space is allowed. By default, filtering is disabled. The value can be RUNNING, ERROR, INIT, or DELETED. Constraints N/A |
| limit | No | Integer | Definition Maximum number of records displayed on each page. Constraints N/A Range [1,500] Default Value 10. |
| offset | No | String | Definition Start page of the pagination list. Constraints N/A Range N/A Default Value 0. |
| pod_name | No | String | Definition Pod name. Range 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 used to obtain a user token. The value of X-Subject-Token in the response header is the user token. For details about how to obtain the token, see Obtaining a User Token Through Password Authentication. Constraints N/A Range N/A Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| current | Integer | Definition Current page number, starting from 0. Range N/A |
| data | Array of ServiceInstanceResponse objects | Definition Service instance list. |
| pages | Integer | Definition Total number of pages, which is calculated based on the limit field and the total number of data records. For example, if the total number of records is 10 and the value of limit (maximum number of records on a page) is 3, there are four pages. Range N/A |
| size | Integer | Definition Number of records on the current page. Range N/A |
| total | Integer | Definition Total number of records. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| instance_name | String | Definition Service instance name. Range N/A |
| status | String | Definition Service instance status. Range |
| weight | Integer | Definition Service instance weight. Range [0, 100] or left empty. |
| pod_count | Long | Definition Number of service instance pods. Range N/A |
| running_pod_count | Long | Definition Number of running pods of a service instance. Range N/A |
| update_at | Long | Definition Last update time of the service instance. Range N/A |
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. |
Status code: 404
Example Requests
Obtain a specified deployment list.
GET https://{endpoint}/v2/{project_id}/services/{service_id}/deployments/{name}/instances Example Responses
Status code: 200
Deployment instances are listed.
{
"current" : 1,
"data" : [ {
"instance_name" : "infer-a07f5c03-18c5-4dfb-849a-c3506020a1f8-1ghsj",
"status" : "DELETED",
"pod_count" : 1,
"running_pod_count" : 1,
"update_at" : 1747766464765,
"weight" : 50
}, {
"instance_name" : "infer-a07f5c03-18c5-4dfb-849a-c3506020a1f8-ecfip",
"status" : "DELETED",
"update_at" : 1747785331567,
"pod_count" : 1,
"running_pod_count" : 1,
"weight" : 50
} ],
"pages" : 1,
"size" : 2,
"total" : 2
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Deployment instances are listed. |
| 400 | Invalid request parameter. |
| 401 | Authentication failed. |
| 403 | Insufficient permissions. |
| 404 | Resource not found. |
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