Get Cloud VPS deployment options
GET /api/v2/vps/payg/deployments
Shows whether the account can create a Cloud VPS. It also returns the hourly prices, the default and allowed sizes and the regions. Call it before POST /api/v2/vps/payg/deployments. When actions.canDeploy.allowed is false, access.blockerReasons lists every blocker as a code. Go by those codes. reason is a short general text about one of them. Prices are in the account’s currency. Fixed-term VPS plans are listed by GET /api/v2/products/vps instead. actions.canDeploy does not show an overdue Cloud VPS invoice. The create call then returns 403 payg_payment_overdue.
Authentication: An API key with the scope read:services. About keys and scopes
Example
curl "https://cloud.hostup.se/api/v2/vps/payg/deployments" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 Deployment options for the account.
{ "available": true, "reason": null, "access": { "available": true, "reason": null, "countryCode": "SE", "countryPaymentAvailable": true, "standardCountry": true, "trustedHistoryRequired": true, "trustedHistoryEligible": true, "paidSpendSek": 3450, "trustedHistoryThresholdSek": 2000, "requiresCard": false, "hasCard": false, "verified": true, "cloudAccessEnabled": true, "blockerReasons": [] }, "actions": { "canDeploy": { "allowed": true, "reason": null } }, "pricing": { "currencyCode": "SEK", "cpuPerCoreHour": 0.015, "memoryPerGbHour": 0.004, "storagePerGbHour": 0.00025, "bandwidthPerGb": 0.01, "ipPerHour": 0.03 }, "defaults": { "regionId": "stockholm", "resources": { "cpuCores": 2, "memoryGb": 2, "storageGb": 50 } }, "limits": { "cpuCores": { "min": 1, "max": 32 }, "memoryGb": { "min": 1, "max": 256 }, "storageGb": { "min": 50, "max": 2000 } }, "regions": [ { "id": "stockholm", "name": "Stockholm, Sweden", "available": true } ]}Response fields
availablebooleanactions.canDeploy.allowed.reasonstring or nullnull when it can.accessobject | nullavailablebooleanreasonstring or nullnull when it can.countryCodestring or nullcountryPaymentAvailablebooleanstandardCountrybooleantrustedHistoryRequiredbooleantrue for every account today.trustedHistoryEligiblebooleanpaidSpendSek has reached trustedHistoryThresholdSek.paidSpendSeknumbertrustedHistoryThresholdSeknumberrequiresCardbooleanhasCardbooleanfalse when no card is needed.verifiedbooleancloudAccessEnabledbooleanblockerReasonsarray of stringcountry_not_supported: no country on the billing account. insufficient_trusted_history: paid total below the threshold. no_card_on_file: a card is needed. not_verified: identity not verified. no_cloud_access: Cloud VPS access is not turned on.actionsobjectcanDeployobjectPOST /api/v2/vps/payg/deployments is allowed now.allowedbooleantrue when the account can create a Cloud VPS.reasonstring or nullnull when it can.pricingobjectcurrencyCodestringcpuPerCoreHournumbercurrencyCode.memoryPerGbHournumbercurrencyCode.storagePerGbHournumbercurrencyCode.bandwidthPerGbnumbercurrencyCode.ipPerHournumbercurrencyCode. The first public IPv4 of each Cloud VPS is included.defaultsobjectregionIdstringid.resourcesobjectcpuCoresintegermemoryGbintegerstorageGbintegerlimitsobjectcpuCoresobjectminintegermaxintegermemoryGbobjectminintegermaxintegerstorageGbobjectminintegermaxintegerregionsarray of objectidstring or nullregion when you create a Cloud VPS.namestring or nullavailablebooleanErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |