Managed Cloud Hosting API Guide

Austin B.
Published: 3 December 2024Last updated: 3 December 2024
Share:

Contents

  • addCloudServer Endpoint
  • Payload Parameters
  • Cloud Server Specifications
  • Cloud Server Locations
  • Setting your Brand Name and Cloud Server Logo
  • Provisioning Cloud Servers under your Own Brand

 

addCloudServer Endpoint

The primary endpoint you'll need to provision Cloud Servers is the addCloudServer endpoint shown below.

https://api.20i.com/reseller/resellerId/addCloudServer

The endpoint enables you to request the priviosioning of a Cloud Server from a specified provider.

Payload Parameters

The request payload should include the following parameters:

configuration: An object containing the configuration details for the Cloud Server, including:

  • provider: The Cloud Server provider. (e.g., 20icloud, aws or gcp)
  • mvpsName: The name of the Cloud Server. A default hostname will be used if this parameter is left blank.
  • optimisation: The type of optimisation for the Cloud Server. (e.g., default, wordpress, woocommerce, magento, joomla, laravel, nodejs and netcore.)
  • spec: The specification name of the Cloud Server.
  • zone: The cloud server zone, referring to the data center location (e.g., us-west-1). Please see further down this guide for a full list of zones/locations for each cloud provider.
  • bandwidth: The allocated bandwidth for the cloud server, this is only used for AWS and GCP servers.
  • disk: The storage capacity of the cloud server, this is only used for AWS and GCP servers.

Additional Options

  • options: Additional options for the Cloud Server order.
  • periodMonths: The duration of the Cloud Server contract, in months. (e.g., 1)
  • type: The type or category of the Cloud Server (e.g., cloud-aws, cloud-gcp and cloud-20i ). You can use cloud-20i for your branded Cloud Server as this is never displayed.
  • forUser: (Optional) Specifies the stack user tuple (e.g., 'stack-user:113') to whom the Cloud Server will be assigned.

When you call this API endpoint, the appropriate fee for the cloud server is deducted from your 20i account balance. If the account balance does not have sufficient funds, the operation will fail.

The API response returns a string representing the server ID if a contract is successfully created. If no contract is created, the response will be null.

<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);

$request = $services_api->postWithFields("/reseller/{resellerId}/addCloudServer", [
    "configuration" => [
        "spec" => "string",
        "zone" => "string",
        "bandwidth" => "string",
        "disk" => "string",
        "provider" => "string",
        "mvpsName" => "string",
    ],
    "periodMonths" => "string",
    "type" => "string",
    "forUser" => "string",
]);

Cloud Server Specifications

20iCloud/Reseller Branded Specifications:

SpecCPURAMDiskBandwidth
micro11251000
small12502000
medium24804000
large481605000
x-large81632010000
2x-large123264020000
4x-large163264030000
8x-large2464128040000
16x-large3296144040000
32x-large48128192040000

AWS Specifications:

SpecCPURAMDiskBandwidth
micro21202
small22202
medium24202
large28202
x-large416202
2x-large832202
4x-large1664202
8x-large32128202

Disk space 

GCP Specifications:

SpecCPURAMDiskBandwidth
micro13.75202
small28202
medium416202
large832202
x-large1664202
2x-large32128202
4x-large48192202
8x-large64256202

Cloud Server Locations

20iCloud Locations:

  1. London, England (dc_location-uk)
  2. Dallas TX, USA (dc_location-usa)

AWS Locations:

  1. North Virginia, USA (us-east-1)
  2. Ohio, USA (us-east-2)
  3. North California, USA (us-west-1)
  4. Oregon, USA (us-west-2)
  5. Mumbai, India (ap-south-1)
  6. Hyderabad, India (ap-south-2)
  7. Tokyo, Japan (ap-northeast-1)
  8. Seoul, South Korea (ap-northeast-2)
  9. Osaka, Japan (ap-northeast-3)
  10. Singapore, Asia (ap-southeast-1)
  11. Sydney, Australia (ap-southeast-2)
  12. Canada (Central) (ca-central-1)
  13. Frankfurt, Germany (eu-central-1)
  14. Dublin, Ireland (eu-west-1)
  15. London, UK (eu-west-2)
  16. Paris, France (eu-west-3)
  17. Stockholm, Sweden (eu-north-1)
  18. São Paulo, Brazil (sa-east-1)
  19. Hong Kong, Asia (ap-east-1)
  20. Cape Town, SA (af-south-1)
  21. Jakarta, Indonesia (ap-southeast-3)
  22. Melbourne, Australia (ap-southeast-4)
  23. Milan, Italy (eu-south-1)
  24. Zaragoza, Spain (eu-south-2)
  25. Zurich, Switzerland (eu-central-2)
  26. Bahrain (me-south-1)
  27. UAE (me-central-1)

GCP Locations:

  1. Changhua, Taiwan (asia-east1)
  2. Hong Kong, Asia (asia-east2)
  3. Tokyo, Japan (asia-northeast1)
  4. Osaka, Japan (asia-northeast2)
  5. Seoul, South Korea (asia-northeast3)
  6. Mumbai, India (asia-south1)
  7. Delhi, India (asia-south2)
  8. Singapore, Asia (asia-southeast1)
  9. Jakarta, Indonesia (asia-southeast2)
  10. Sydney, Australia (australia-southeast1)
  11. Melbourne, Australia (australia-southeast2)
  12. Warsaw, Poland (europe-central2)
  13. Hamina, Finland (europe-north1)
  14. Madrid, Spain (europe-southwest1)
  15. St. Ghislain, Belgium (europe-west1)
  16. Turin, Italy (europe-west12)
  17. London, England (europe-west2)
  18. Frankfurt, Germany (europe-west3)
  19. Eemshaven, Netherlands (europe-west4)
  20. Zurich, Switzerland (europe-west6)
  21. Milan, Italy (europe-west8)
  22. Paris, France (europe-west9)
  23. Tel Aviv, Israel (me-west1)
  24. Montréal, Québec (northamerica-northeast1)
  25. Toronto, Ontario (northamerica-northeast2)
  26. São Paulo, Brazil (southamerica-east1)
  27. Santiago, Chile (southamerica-west1)
  28. Iowa, USA (us-central1)
  29. South Carolina, USA (us-east1)
  30. Virginia, USA (us-east4)
  31. Ohio, USA (us-east5)
  32. Texas, USA (us-south1)
  33. Oregon, USA (us-west1)
  34. California, USA (us-west2)
  35. Utah, USA (us-west3)
  36. Nevada, USA (us-west4)

Setting your Brand Name and Cloud Server Logo

If you want to sell Cloud Servers (20iCloud) under your own brand you need to set your brand name and logo from Your Brand in My20i. These will be returned in the response headers when querying the Cloud Server ID, and returned within the StackCP management interface.

Provisioning Cloud Servers under your Own Brand

To use your brand name and logo to replace the 20iCloud text and logo, you can can set the resellerCloudBranded parameter in the configuration to true:

<?php
$general_api_key = "API_KEY";
$services_api = new \TwentyI\API\Services($general_api_key);

$request = $services_api->postWithFields("/reseller/{resellerId}/addCloudServer", [
    "configuration" => [
        "spec" => "string",
        "zone" => "string",
        "bandwidth" => "string",
        "disk" => "string",
        "provider" => "string",
        "mvpsName" => "string",
        "resellerCloudBranded" => true
    ],
    "periodMonths" => "string",
    "type" => "string",
    "forUser" => "string",
]);