ListResourceInstances

Updated at:

Retrieves a list of machine instances in a specified dedicated resource group.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

eas:ListResourceInstances

get

*Resource

acs:eas:{#regionId}:{#accountId}:resource/{#ResourceId}

None None

Request syntax

GET /api/v2/resources/{ClusterId}/{ResourceId}/instances HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

The region ID of the resource group.

cn-shanghai

ResourceId

string

Yes

The ID of the resource group. For more information about how to query the resource group ID, see ListResources.

iot

Request parameters

Parameter

Type

Required

Description

Example

ChargeType

string

No

Filters machines by billing method. Valid values:

  • PrePaid: Subscription.

  • PostPaid: Pay-as-you-go.

Valid values:

  • PostPaid :

    Pay-as-you-go.

  • PrePaid :

    Subscription.

PrePaid

PageNumber

integer

No

The page number of the dedicated resource group machine list. Pages start from 1. Default value: 1.

1

PageSize

integer

No

The paging settings for the number of machines to display on each page during a paged query. Default value: 100.

20

InstanceName

string

No

Filters instances by name.

e-xxxx***

InstanceId

string

No

Filters instances by ID. For more information about how to obtain the instance ID, see ListResourceInstances.

i-bp1jd6x3uots****a

InstanceIP

string

No

The IP address of the machine.

10.224.xx.xx

Filter

string

No

The keyword used for search. You can search by machine ID or IP address.

10.224.xx.xx

InstanceStatus

string

No

The status of the machine.

Valid values:

  • Ready-SchedulingDisabled :

    Available but unschedulable.

  • Ready :

    Running.

  • NotReady :

    Not ready.

  • Stopped :

    Stopped.

  • NotReady-SchedulingDisabled :

    Unavailable and unschedulable.

  • Attaching :

    Starting.

  • Deleting :

    Deleting.

  • CreateFailed :

    Creation failed.

Ready

Label

object

No

The performance level (PL) of the system cloud disk.

PL1

string

No

Specify the label in the {"key":"value"} format. The value can be null or an empty string, which indicates that the results are filtered only by key and the value can be any value.

{"key1":"value1","key2":null}

Sort

string

No

Filters by label.

Valid values:

  • CreateTime :

    Creation time.

  • MemoryUsed :

    Memory usage.

  • GpuUsed :

    GPU usage.

  • ExpireTime :

    Expiration time.

  • CpuUsed :

    CPU utilization.

{"key1":"value1","key2":null}

Order

string

No

The field used for sorting.

Valid values:

  • asc :

    Ascending.

  • desc :

    Descending.

CreateTime

Zone

string

No

The sort order.

desc

Response elements

Element

Type

Description

Example

object

The response.

RequestId

string

The request ID.

40325405-579C-4D82****

Instances

array

The list of instances.

ResourceInstance

The instance information.

PageNumber

integer

The page number of the returned resource group machine list.

1

PageSize

integer

The number of resource group machines returned on each page.

20

TotalCount

integer

The total number of instances.

2

Examples

Success response

JSON format

{
  "RequestId": "40325405-579C-4D82****",
  "Instances": [
    {
      "InstanceId": "eas-i-1800z74n30kao****",
      "InstanceName": "eas01122713204*****",
      "InstanceIp": "11.227.XX.XX",
      "InstanceStatus": "Ready",
      "InstancePhase": "succeeded",
      "InstanceCpuCount": 4,
      "InstanceGpuCount": 0,
      "InstanceMemory": "8192M",
      "InstanceSystemDiskSize": 200,
      "InstanceGpuMemory": "0G",
      "InstanceUsedCpu": 2.4,
      "InstanceUsedGpu": 0,
      "InstanceUsedMemory": "1000M",
      "InstanceType": "ecs.s6-c1m2.xlarge",
      "CreateTime": "2020-07-05T22:51:32Z",
      "ChargeType": "PrePaid",
      "ExpiredTime": "2020-08-05T22:51:32Z",
      "AutoRenewal": false,
      "Arch": "arm64",
      "Region": "cn-hangzhou",
      "Zone": "cn-hangzhou-b",
      "ResourceId": "eas-r-xxxxx",
      "InstanceTenantIp": "192.168.xx.xx",
      "InstanceUsedGpuMemory": "470M",
      "Labels": [
        {
          "LabelKey": "key",
          "LabelValue": "value"
        }
      ],
      "LastCordonOperator": "24340xxxxxxxx",
      "LastCordonReason": "operating",
      "InstanceSystemDiskPerformanceLevel": "PL1"
    }
  ],
  "PageNumber": 1,
  "PageSize": 20,
  "TotalCount": 2
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.