InquiryPriceCreateIpv4Block

1. API Description

This API is used to query the price of creating IPv4 CIDR blocks.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter NameRequiredTypeDescription

zoneId

Yes

String

Zone ID to which the CIDR blocks belong.

chargeType

Yes

String

CIDR block pricing model.

  • PREPAID: subscription

  • POSTPAID: pay-as-you-go

chargePrepaid

No

Details of the monthly subscription, including the purchase period, auto-renewal. It is required if the chargeType is PREPAID.

netmask

Yes

Integer

Netmasks you want to purchase.

Value range: [1,32].

You can find the available netmasks in the response by calling DescribeAvailableIpv4Resource.

amount

No

Integer

Quantity of IPv4 CIDR blocks you want to purchase.

Default value: 1.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

price

Price of IPv4 CIDR blocks.

4. Code Example

Query the price of a postpaid IPv4 CIDR block with the netmask of 28 **** in CHI-A. The quantity you want to purchase is 1.

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

Request:
{
  "zoneId": "CHI-A",
  "chargeType": "POSTPAID",
  "netmask": 28
}

Response:
{
  "requestId": "TCB52F216-374D-4895-AF29-A3E29E5403E2",
  "response": {
    "requestId": "TCB52F216-374D-4895-AF29-A3E29E5403E2",
    "price": {
      "discount": 100.0,
      "discountPrice": null,
      "originalPrice": null,
      "unitPrice": 0.06,
      "discountUnitPrice": 0.06,
      "chargeUnit": "HOUR",
      "stepPrices": null
    }
  }
}

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 CodeError CodeDescription

404

INVALID_ZONE_NOT_FOUND

Zone not found.

403

OPERATION_DENIED_UNAVAILABLE_NETMASK

Unavailable netmask.

Last updated