DescribeAvailableResources

1. API Description

This API (DescribeAvailableResources) is used to describe the status of available resources.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

instanceChargeType

Yes

Instance pricing model .

PREPAID: subscription

POSTPAID: pay-as-you-go

instanceTypeId

No

String

Instance model ID.

zoneId

No

String

Zone ID.

sellStatus

No

Status of sale.

SELL : available for sale, stock > 10. SELL_SHORTAGE : available for sale, stock < 10. SOLD_OUT : sold out.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request.

RequestId is required for locating a problem.

availableResources

Information on available resources, including zoneId, status, quantity, etc.

4. Code Example

Query available resources

POST / HTTP/1.1
Host: console.zenlayer.com/api/v2/bmc
Content-Type: application/json
X-ZC-Action: DescribeAvailableResources
<Common Request Params>

Request:
{
  "instanceTypeId": "MDE",
  "instanceChargeType": "PREPAID",
  "zoneId": "MOW-B"
}

Response:
{
  "requestId": "T001A67B7-C345-4B0E-A9B0-FB0C859C9075",
  "response": {
    "requestId": "T001A67B7-C345-4B0E-A9B0-FB0C859C9075",
    "availableResources": [
      {
        "zoneId": "MOW-B",
        "status": "SELL",
        "internetChargeTypes": [
          "ByBandwidth",
          "ByTrafficPackage"
        ],
        "instanceTypeId": "MDE",
        "maximumBandwidthOut": 10000,
        "defaultBandwidthOut": 50,
        "defaultTrafficPackageSize": 5.0
      }
    ]
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs,to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

HTTP Status Code
Error Code
Description

403

INVALID_CHARGE_TYPE_NOT_SUPPORT

The current account does not support the specified pricing model.

404

INVALID_ZONE_NOT_FOUND

Zone not found.

Last updated