Kube Type

Navigation:  Billing Integration (Supported Systems) > Billing API >

Kube Type

Previous pageReturn to chapter overviewNext page

API calls related to Kube Types:

 

create a Kube Type:

 

request:

 

POST https://kuberdock.master/api/pricing/kubes/

 

json data:

 

{

“name”: “some_kube_type_name,

“cpu”: 0.2, // specify core percentage allocated to one Kube. E.g. 0.1 means 10% of a CPU core; 1.5 means 100% of one core and 50% of another.

“memory”: 128, // in MB

“disk_space”: 5,

 

“included_traffic”: 100, // under development, in GB

“is_default”: “true” // Is not mandatory. Setting this flag to false is forbidden. You can change default Kube type by setting another Kube type as default.

}

 

response:

 

{

 “data”:

{

 “cpu”: 0.2,

 “cpu_units”: “Cores”,

 “disk_space”: 5,

“disk_space_units”: “GB" // value for disk space limits

“cpu_units”: “Cores”, //value for CPU limits

 “id”: 9,

 “memory”: 128,

 “memory_units”: “MB”, //value for memory limits

 “name”: “personal”,

 “total_traffic”: 100 // under development

 “is_default”: null,

       },

 “status”: “OK”

}

 

update a Kube Type:

 

Note that changing Kube Type will not affect existing containers until they are restarted. You can change several fields for Kube Type in one request.

 

request:

 

PUT 

https://kuberdock.master/api/pricing/kubes/<kube_type_id>

 

json-data:

 

{

“cpu”: 0.3,

“name”: “new_name”

}

 

response:

 

{

  “status”: “OK”

}

 

get a Kube Type:

 

request:

 

GET 

https://kuberdock.master/api/pricing/kubes/<kube_type_id>

 

response:

 

{

  “data”: 

{

          “cpu”: 0.2,

          “cpu_units”: “Cores”,

          “disk_space”: 0,

          “id”: 0,

          “memory”: 64,

          “name”: “kube_name”,

          “included_traffic”: 0, // under development

 },

  “status”: “OK”

}

 

get all Kube Types:

 

request:

 

GET https://kuberdock.master/api/pricing/kubes

 

response:

 

{

 "data": [

 {

       "cpu": 0.2,

       "cpu_units": "Cores",

       "disk_space": 0,

       "id": 0,

       "memory": 64,

       "name": "kube_name",

       "included_traffic": 0, // under development

 },

           ….

 ],

 "status": "OK"

}

 

retrieve list of Kube Type IDs available in a package by package ID:

 

request:

 

GET https://kuberdock.master/api/pricing/packages/<package_id>/kubes-by-id

 

response:

 

{

 "data": [

 0,

 1,

 2

 ],

 "status": "OK"

}

 

retrieve Kube Type name of a package by package ID:

 

request:

 

GET https://kuberdock.master/api/pricing/packages/<package_id>/kubes-by-name

 

response:

 

{

 "data": [

 "Standard kube",

 "High CPU",

 "High memory"

       ],

 "status": "OK"

}

 

retrieve details of Kube Types of a package:

 

request:

 

GET https://kuberdock.master/api/pricing/packages/<package_id>/kubes

 

response:

 

{

 "data":[

 {

"cpu": 0.2,

"cpu_units": "Cores",

"disk_space": 0,

"disk_space_units": "GB",

"id": 0,

"memory": 64,

"name": "kube_name",

"kube_price": 0.7,

"memory_units": "MB",

"name": "Test Kube 2"

"included_traffic": 0, // under development

 },

          {...}, ...

          ],

 "status": "OK"

}

 

add a Kube Type to a package:

 

request:

 

POST: https://kuberdock.master/api/pricing/packages/<package_id>/kubes/

 

json data:

 

{

“id”: 1, // ID of the kube to be added

"kube_price": 0.03

}

 

response:

 

{

 "status": "OK"

}

 

exclude Kube Type from a package:

 

request:

 

DELETE https://kuberdock.master/api/pricing/packages/<package_id>/kubes/<kube_type_id>

 

response:

 

{

 "status": "OK"

}

 

delete a Kube Type:

 

request:

 

DELETE https://kuberdock.master/api/pricing/kubes/<kube_type_id>

 

response:

 

{

 "status": "OK"

}