All Products
Search
Document Center

Platform For AI:ListServiceInstances

Last Updated:Nov 22, 2024

Queries instances of a service.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
eas:ListServiceInstancesget
*Service
acs:eas:{#regionId}:{#accountId}:service/{#ServiceName}
    none
none

Request syntax

GET /api/v2/services/{ClusterId}/{ServiceName}/instances HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The ID of the region where the service is deployed.

cn-shanghai
ServiceNamestringYes

The service name. For more information about how to query the service name, see ListServices .

foo
PageNumberintegerNo

The page number. Default value: 1.

1
PageSizeintegerNo

The number of entries per page. Default value: 100.

20
FilterstringNo

The keyword used to query instances. Instances can be queried based on instance name, instance IP address, IP address of the server where the instance resides, and instance type.

10.118.xx.xx
ResourceTypestringNo

The type of the resource group to which the instance belongs.

Valid values:

  • PublicResource

  • DedicatedResource

PublicResource
InstanceTypestringNo

The instance type.

ecs.c7.large
InstanceStatusstringNo

The instance state.

Running
InstanceIPstringNo

The IP address of the instance.

10.224.xx.xx
InstanceNamestringNo

The instance name.

foo-bdc5xxxx-8l7rk
HostIPstringNo

The IP address of the server where the instance resides.

10.224.xx.xx
IsSpotbooleanNo

Specifies whether the instance is a preemptible instance.

false
RolestringNo

The service role.

Valid values:

  • DataSet

    :

    dataset service

    .

  • SDProxy

    :

    Stable-Diffusion proxy service

    .

  • Standard

    :

    standard service

    .

  • Queue

    :

    queue service

    .

Queue
SortstringNo

The field that you use to sort the query results.

  • Set the value to StartTime.

    The value specifies that the query results are sorted based on the time when the instances were created

    .

StartTime
OrderstringNo

The sorting order.

Valid values:

  • asc

    :

    The instances are sorted in ascending order.

  • desc

    :

    The instances are sorted in descending order.

desc

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

40325405-579C-4D82****
Instancesarray

The instances.

Instance

The instance.

PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page.

20
TotalCountinteger

The total number of entries returned.

1

Examples

Sample success responses

JSONformat

{
  "RequestId": "40325405-579C-4D82****",
  "Instances": [
    {
      "HostIP": "11.0.XX.XX",
      "HostName": "smart-scene-cls-854dbdc99d-****",
      "InnerIP": "172.17.0.17",
      "InstanceName": "foo-5fc8946767-v****",
      "InstancePort": 8080,
      "LastState": [
        []
      ],
      "Namespace": "foo",
      "Reason": "RUNNING",
      "RestartCount": 1,
      "Status": "Running",
      "TotalProcesses": 1,
      "ReadyProcesses": 1,
      "StartAt": "2021-05-27T09:46:05Z",
      "Role": "Standard",
      "ResourceType": "PublicResource",
      "TenantInstanceIP": "192.168.xx.xx",
      "TenantHostIP": "192.168.xx.xx",
      "IsSpot": false,
      "CurrentAmount": 0.444,
      "OriginalAmount": 2.2,
      "Isolated": false,
      "Zone": "cn-shanghai-a",
      "ExternalIP": "192.168.1.100",
      "ExternalInstancePort": 8080,
      "StartTime": "2021-05-27T09:46:05Z"
    }
  ],
  "PageNumber": 1,
  "PageSize": 20,
  "TotalCount": 1
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-05-06The request parameters of the API has changedView Change Details