Skip to content

Plans

Plans are used to define resource classes on which to build a server; there are several types:

  • Shared CPU
  • High Memory
  • GPU
  • NPU

Each type represents a different product, but they can all be activated via the ECS API or the web panel ermes.

Getting all Plans

To get all the plans available to your user simply use the following request:

HTTP request

GET /ecs/v2/plans

HTTP Response

"status": "ok",
    "plans": [
        {
            "id": 1, //plan id
            "name": "ECS1", //plan name
            "cpu": "1",
            "ram": "1024",
            "disk": "20",
            "gpu": "0",
            "gpu_label": null,
            "hourly_price": 0.017, //price for hour
            "montly_price": 12.0,
            "windows": false, //is a windows plan
            "host_type": "ECS", //required host type
            "available": true, //plan active
            "available_regions": [ //all region where a plan is active
                {
                    "id": 1,
                    "location": "it-fr2",
                    "description": "Frosinone"
                }
            ]
        },
        {
            "id": 2,
            "name": "ECS2",
            "cpu": "2",
            "ram": "2048",
            "disk": "40",
            "gpu": "0",
            "gpu_label": null,
            "hourly_price": 0.028,
            "montly_price": 20.0,
            "windows": false,
            "host_type": "ECS",
            "available": true,
            "available_regions": [
                {
                    "id": 1,
                    "location": "it-fr2",
                    "description": "Frosinone"
                }
            ]
        },
    ]
}

!!! warning “Caution.” The presence of a region in the list of available regions does not necessarily indicate that the plan is actually activatable in that location, but only that the region is compatible with the specific plan.

Plans that are really activatable.

To find out the plans that are really activatable and avoid possible errors of lack of resources you can use the following request:

HTTP Request

GET /ecs/v2/plans/availables

HTTP Response

{
    "status": "ok",
    "plans": [
      {
        "id": 1,
        "name": "ECS1",
        "cpu": "1",
        "ram": "1024",
        "disk": "20",
        "gpu": "0",
        "gpu_label": null,
        "hourly_price": 0.017,
        "montly_price": 12.0,
        "windows": false,
        "host_type": "ECS",
        "available": true,
        "os_availables": [
          {
            "id": 1,
            "name": "centos-7",
            "creation_date": "2019-04-16T13:37:41+00:00",
            "active_flag": true,
            "status": "CD",
            "uuid": "ffe2a034-7a44-4f51-9ae8-17fb354793f6",
            "description": "CentOS Linux 7",
            "notes": "Linux CentOS disk image",
            "public": true,
            "cloud_image": false,
            "so_base": "centos",
            "api_version": "v4",
            "version": "7"
          },
          {
            "id": 2,
            "name": "debian-9",
            "creation_date": "2019-04-18T12:34:08+00:00",
            "active_flag": true,
            "status": "CD",
            "uuid": "6708cdc4-0c8d-4ccf-83c7-ae39bccaeb42",
            "description": "Debian Linux 9",
            "notes": "Linux Debian disk image",
            "public": true,
            "cloud_image": false,
            "so_base": "debian",
            "api_version": "v4",
            "version": "9"
          }
        ],
        "region_availables": [ /
          {
            "region": "it-fr2",
            "hosts": [ 
              {
                "host": "ecs911.swlab.seeweb.it",
                "servers": []
              },
              {
                "host": "ecs912.swlab.seeweb.it",
                "servers": [ 
                  "ec000025"
                ]
              }
            ]
          }
        ]
      }
      ...
    ]
}

Info

For most activations the 'host' field may be unnecessary, but if you want to use. Isolation turns out to be extremely important.

Let's look at the example above if I wanted to isolate the new server from ec000025 I know I could do it because besides him there is there is another host available for my plan, in case there was only one host it would not be possible for me to use isolation, it would in fact result in an error due to lack of resources

Remember by using isolation you are explicitly saying that you are not looking for free resources on physical hosts of other virtual servers in your possession, so verify that it is actually usable before making use of it via API