QueryAvailableInstances - Query active instances

Updated at:

Call the QueryAvailableInstances operation to query a list of active instances.

Debug

You can run this operation directly in OpenAPI Explorer to avoid the need to calculate signatures. After the operation is successful, OpenAPI Explorer automatically generates SDK code examples.

Authorization information

The following table describes the authorization information for this API operation. You can add the information to the Action element of a Resource Access Management (RAM) policy statement to grant a RAM user or RAM role the permission to call this API operation. The following list describes the items in the table:

  • Operation: The specific permission.

  • Access level: The access level of each operation. Valid values: Write, Read, and List.

  • Resource type: The resource type that supports authorization. The following list describes the resource types:

    • Required resource types are highlighted.

    • For operations that do not support resource-level authorization, All resources is displayed.

  • Condition key: The condition keys defined by the cloud service.

  • Associated operation: Other permissions that are required to perform the operation. You must also have permissions for any associated operations.

Operation

Access level

Resource type

Condition key

Associated operation

bss:DescribeInstances

get

*All resources

*

  • None

None

For more information, see Authorization information for Alibaba Cloud Billing APIs.

Request parameters

Name

Type

Required

Example value

Description

Action

String

Yes

QueryAvailableInstances

The operation to perform. Set the value to QueryAvailableInstances.

Region

String

No

cn-hangzhou

The region to query. Valid values:

  • Regions in China

    • cn-hangzhou: China (Hangzhou)

    • cn-shanghai: China (Shanghai)

    • cn-qingdao: China (Qingdao)

    • cn-beijing: China (Beijing)

    • cn-zhangjiakou: China (Zhangjiakou)

    • cn-shenzhen: China (Shenzhen)

    • cn-huhehaote: China (Hohhot)

    • cn-chengdu: China (Chengdu)

    • cn-hongkong: China (Hong Kong)

  • Regions outside China

    • ap-northeast-1: Japan (Tokyo)

    • ap-southeast-1: Singapore

    • ap-southeast-2: Australia (Sydney) (Discontinued)

    • ap-southeast-3: Malaysia (Kuala Lumpur)

    • ap-southeast-5: Indonesia (Jakarta)

    • us-east-1: US (Virginia)

    • us-west-1: US (Silicon Valley)

    • eu-central-1: Germany (Frankfurt)

PageNum

Integer

No

1

Displays the current page number of a paged query.

PageSize

Integer

No

20

The maximum number of entries to return on each page for a paged query.

ProductCode

String

No

dbaudit

The product code.

The product code. The product code for DataBase Audit is dbaudit.

Note

This parameter is required if you specify the Region parameter.

ProductType

String

No

empty

The product type. You do not need to specify this parameter.

SubscriptionType

String

No

Subscription

Billing method

The billing method. For DataBase Audit, set this parameter to Subscription, which indicates the subscription billing method.

InstanceIDs

String

No

dbaudit-cn-****

The instance ID. You can specify up to 100 instance IDs. Separate multiple IDs with commas (,).

EndTimeStart

String

No

2020-05-23T12:00:00Z

The start of the time range to query instance expiration dates. Specify the time in the ISO 8601 standard in the UTC format. For example, 2020-05-23T12:00:00Z.

EndTimeEnd

String

No

2020-05-23T12:00:00Z

The end of the time range to query instance expiration dates. Specify the time in the ISO 8601 standard in the UTC format. For example, 2020-05-23T12:00:00Z.

CreateTimeStart

String

No

2020-05-23T12:00:00Z

The start of the time range to query instance creation dates. Specify the time in the ISO 8601 standard in the UTC format.

CreateTimeEnd

String

No

2020-05-23T12:00:00Z

The expiration time of the instance in UTC, which complies with the ISO 8601 standard.

RenewStatus

String

No

ManualRenewal

The renewal status. Valid values:

  • AutoRenewal: Auto-renewal is enabled.

  • ManualRenewal: The instance is renewed manually.

  • NotRenewal: The resource will not be renewed.

Returned Data

Name

Type

Example

Description

Code

String

Success

The status code of the request.

Data

Struct

The response that is returned.

InstanceList

Array

A list of instance information.

CreateTime

String

2023-02-06T08:19:47Z

The time when the instance was created.

EndTime

String

2025-09-15T16:00:00Z

The time when the instance expires.

InstanceID

String

dbaudit-cn-****

The ID of the DataBase Audit instance.

OwnerId

Long

181****

The Alibaba Cloud account ID of the instance owner.

ProductCode

String

dbaudit

The product code.

ProductType

String

dbaudit

The product type.

Region

String

cn-hangzhou

The region of the instance.

ReleaseTime

String

2020-11-07T16:00:00Z

The time when the instance was released.

RenewStatus

String

ManualRenewal

The renewal status. Valid values:

  • AutoRenewal: Auto-renewal is enabled.

  • ManualRenewal: The resource is renewed manually.

  • NotRenewal: The resource will not be renewed.

RenewalDuration

Integer

1

The auto-renewal period.

RenewalDurationUnit

String

M

The unit of the auto-renewal period. Valid values:

  • M: Month.

  • Y: Year.

Seller

String

26888

The seller of the instance. The seller can be Alibaba Cloud or a partner.

SellerId

Long

123123123

The ID of the seller.

Status

String

Creating

The status of the instance.

StopTime

String

2020-11-07T16:00:00Z

The time when the instance was stopped.

SubStatus

String

Normal

The sub-status of the instance.

SubscriptionType

String

Subscription

The billing method of the instance. The value is fixed as Subscription, which indicates the subscription billing method.

PageNum

Integer

1

Displays the current page number of a paged query.

PageSize

Integer

10

The maximum number of entries returned per page.

TotalCount

Integer

11

The total number of instances.

Message

String

Successful!

The message that corresponds to the Code.

RequestId

String

C7C15585-8349-4C62-BEE4-5A391841B9BE

The ID of the request. This ID is a unique identifier generated by Alibaba Cloud for the request. You can use this ID to troubleshoot issues.

Success

Boolean

true

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

Examples

Request example

http(s)://[Endpoint]/?Action=QueryAvailableInstances
&<Common request parameters>

Successful response examples

XML format

<QueryAvailableInstancesResponse>
      <Data>
            <TotalCount>51</TotalCount>
            <PageSize>20</PageSize>
            <PageNum>1</PageNum>
            <InstanceList>
                  <Status>Creating</Status>
                  <SubStatus>Normal</SubStatus>
                  <SubscriptionType>Subscription</SubscriptionType>
                  <RenewStatus>ManualRenewal</RenewStatus>
                  <InstanceID>dbaudit-cn-****</InstanceID>
                  <ProductCode>dbaudit</ProductCode>
                  <CreateTime>2020-09-08T16:00:00Z</CreateTime>
                  <OwnerId>181****</OwnerId>
                  <EndTime>2020-11-07T16:00:00Z</EndTime>
                  <Seller>26888</Seller>
            </InstanceList>
            <InstanceList>
                  <Status>Creating</Status>
                  <SubStatus>Normal</SubStatus>
                  <SubscriptionType>Subscription</SubscriptionType>
                  <RenewStatus>ManualRenewal</RenewStatus>
                  <InstanceID>dbaudit-cn-****</InstanceID>
                  <ProductCode>dbaudit</ProductCode>
                  <CreateTime>2020-09-08T16:00:00Z</CreateTime>
                  <OwnerId>181****</OwnerId>
                  <EndTime>2020-11-07T16:00:00Z</EndTime>
                  <Seller>26888</Seller>
            </InstanceList>
      </Data>
      <Message>Successful!</Message>
      <RequestId>C7C15585-8349-4C62-BEE4-5A391841B9BE</RequestId>
      <Success>true</Success>
      <Code>Success</Code>
</QueryAvailableInstancesResponse>

JSON format

{
    "Data": {
        "TotalCount": 51,
        "PageSize": 20,
        "PageNum": 1,
        "InstanceList": [
            {
                "Status": "Creating",
                "SubStatus": "Normal",
                "SubscriptionType": "Subscription",
                "RenewStatus": "ManualRenewal",
                "InstanceID": "dbaudit-cn-****",
                "ProductCode": "dbaudit",
                "CreateTime": "2020-09-08T16:00:00Z",
                "OwnerId": "181****",
                "EndTime": "2020-11-07T16:00:00Z",
                "Seller": 26888
            },
            {
                "Status": "Creating",
                "SubStatus": "Normal",
                "SubscriptionType": "Subscription",
                "RenewStatus": "ManualRenewal",
                "InstanceID": "dbaudit-cn-****",
                "ProductCode": "dbaudit",
                "CreateTime": "2020-09-08T16:00:00Z",
                "OwnerId": "181****",
                "EndTime": "2020-11-07T16:00:00Z",
                "Seller": 26888
            }
        ]
    },
    "Message": "Successful!",
    "RequestId": "C7C15585-8349-4C62-BEE4-5A391841B9BE",
    "Success": true,
    "Code": "Success"
}

Error codes

For a list of error codes, visit the API Error Center.