NAV Navbar
shell
  • Introduction
  • Authentication
  • User
  • Token
  • Locations
  • VM
  • Storage
  • Private networks
  • Floating IP
  • Parameters
  • Billing
  • Payment
  • Pricing
  • Charging
  • Introduction

    Welcome to the idcloudhost.com API! You can use our API to create and manage compute and storage resources like Virtual Machines, Docker containers and Object Storage buckets.

    Authentication

    To authorize, use this code:

    # With shell, you can just pass the correct header with each request
    curl "api_endpoint_here"
      -H "apikey: meowmeowmeow"
    

    Make sure to replace meowmeowmeow with your API key.

    API of idcloudhost.com uses tokens to allow access to the API. You can register a new API token at our user interface.

    API token must be included in all API requests to the server in a header that looks like the following:

    apikey: meowmeowmeow

    User

    Get User Info

    curl "https://api.idcloudhost.com/v1/user-resource/user" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    {
        "cookie_id": "61b0378574974ae88dbfec0feb9917bc",
        "id": 8,
        "last_activity": "2018-02-22 14:18:47",
        "name": "user@example.com",
        "profile": null,
        "profile_data": {
            "avatar": "https://s.gravatar.com/avatar/bbb?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fsv.png",
            "created_at": "2018-10-25 11:02:59",
            "email": "user@example.com",
            "first_name": "Cloudia",
            "id": 22,
            "last_name": "Iaas",
            "personal_id_number": "123456",
            "phone_number": "+111111111",
            "updated_at": "2021-05-18 11:07:00",
            "user_id": 8
        },
        "state": {}
    }
    

    Authenticated user can request data-model for themselves

    HTTP Request

    GET https://api.idcloudhost.com/v1/user-resource/user

    Modify Profile Info

    curl "https://api.idcloudhost.com/v1/user-resource/user/profile" \
        -H "apikey: meowmeowmeow" \
        -X PATCH \
        -d "first_name=Cloudia" \
        -d "last_name=Iaas" \
        -d "phone_number=+98765" \
        -d "personal_id_number=123456"
    

    The above command returns JSON structured like this:

    {
        "avatar": "https://s.gravatar.com/avatar/bbb?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fsv.png",
        "created_at": "2018-10-25 11:02:59",
        "email": "user@example.com",
        "first_name": "Cloudia",
        "id": 22,
        "last_name": "Iaas",
        "personal_id_number": "123456",
        "phone_number": "+98765",
        "updated_at": "2021-05-18 11:07:00",
        "user_id": 8
    }
    

    Authenticated user can modify their own profile data

    HTTP Request

    PATCH https://api.idcloudhost.com/v1/user-resource/user/profile

    Form Parameters

    Parameter Type Description
    first_name String optional First name
    last_name String optional Last name
    phone_number String optional Phone number in any format
    personal_id_number String optional Personal identity number, usually issued by the state

    Token

    Delete Token

    curl "https://api.idcloudhost.com/v1/user-resource/token" \
        -H "apikey: meowmeowmeow" \
        -X DELETE \
        -d "token_id=0"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "Error": "Failed to delete kong token."
        }
    }
    

    Delete API token

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/user-resource/token

    Form Parameters

    Parameter Default Type
    token_id A Whole number

    Update Token

    curl "https://api.idcloudhost.com/v1/user-resource/token" \
        -H "apikey: meowmeowmeow" \
        -X PATCH \
        -d "description=Description changed" \
        -d "restricted=false" \
        -d "token_id=3"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "Error": "Failed to update token."
        }
    }
    

    Update API token options.

    HTTP Request

    PATCH https://api.idcloudhost.com/v1/user-resource/token

    Form Parameters

    Parameter Default Type
    billing_account_id 0 A Whole number
    description Basic text / string value
    restricted Providing any value will set this to true
    token_id A Whole number

    Create Token

    curl "https://api.idcloudhost.com/v1/user-resource/token" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "description=Token Description" \
        -d "restricted=true" \
        -d "billing_account_id=6"
    

    The above command returns JSON structured like this:

    [
        {
            "billing_account_id": 0,
            "consumer_id": "9b68f9e5-34a5-41bb-8938-944c17e38723",
            "created_at": "2018-02-21 14:00:07",
            "description": "hea token",
            "id": 2,
            "kong_id": "a7540e94-bc84-4f18-a391-002c9b31eb34",
            "restricted": false,
            "token": "vYNKd8VWHg583sTkAZ8vKbyVtyXWILXn",
            "updated_at": null,
            "user_id": 8
        },
        {
            "billing_account_id": 6,
            "consumer_id": "9b68f9e5-34a5-41bb-8938-944c17e38723",
            "created_at": "2018-02-22 14:24:02",
            "description": "Token Description",
            "id": 7,
            "kong_id": "1dd6f9f7-f679-4ad0-a44d-9343c37a7dfb",
            "restricted": true,
            "token": "PS2vfOCKuU52be83QZhMMndqOusfFkHr",
            "updated_at": null,
            "user_id": 8
        }
    ]
    

    Create new token and register it at API Gateway

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/token

    Form Parameters

    Parameter Default Type
    billing_account_id 0 A Whole number
    description Basic text / string value
    restricted Accepts a true or false value

    List Tokens

    curl "https://api.idcloudhost.com/v1/user-resource/token/list" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "billing_account_id": 0,
            "consumer_id": "9b68f9e5-34a5-41bb-8938-944c17e38723",
            "created_at": "2018-02-21 14:00:07",
            "description": "hea token",
            "id": 2,
            "kong_id": "a7540e94-bc84-4f18-a391-002c9b31eb34",
            "restricted": false,
            "token": "vYNKd8VWHg583sTkAZ8vKbyVtyXWILXn",
            "updated_at": null,
            "user_id": 8
        },
        {
            "billing_account_id": 6,
            "consumer_id": "9b68f9e5-34a5-41bb-8938-944c17e38723",
            "created_at": "2018-02-22 14:24:02",
            "description": "Token Description",
            "id": 7,
            "kong_id": "1dd6f9f7-f679-4ad0-a44d-9343c37a7dfb",
            "restricted": true,
            "token": "PS2vfOCKuU52be83QZhMMndqOusfFkHr",
            "updated_at": null,
            "user_id": 8
        }
    ]
    

    List user API tokens

    HTTP Request

    GET https://api.idcloudhost.com/v1/user-resource/token/list

    Locations

    List Locations

    curl "https://api.idcloudhost.com/v1/config/locations" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "display_name": "Cycletown",
            "is_default": true,
            "is_preferred": false,
            "description": "The original location",
            "order_nr": 1,
            "slug": "cyc01",
            "country_code": "est"
        },
        {
            "display_name": "Busburg",
            "is_default": false,
            "is_preferred": true,
            "description": "Secondary location",
            "order_nr": 2,
            "slug": "bus02",
            "country_code": "est"
        }
    ]
    

    Locations are different data centres or resource pools where virtual machines can be hosted. By default API calls manage resources in the "is_default": true location. To access a specific location, its slug must be used in the API URL right after version number: v1/{slug}/. In the following example Cycletown location is used if no location is specified.

    Slug URL Location
    https://api.idcloudhost.com/v1/user-resource/vm Cycletown (default)
    cyc01 https://api.idcloudhost.com/v1/cyc01/user-resource/vm Cycletown
    bus02 https://api.idcloudhost.com/v1/bus02/user-resource/vm Busburg

    To get a full list of all location-specific resources, all locations must be queried. There is no API endpoint that would return virtual machines from all locations.

    Location specific API endpoints

    Resource URL
    Virtual Machines https://api.idcloudhost.com/v1/{slug}/user-resource/vm
    https://api.idcloudhost.com/v1/{slug}/user-resource/billing_resources
    https://api.idcloudhost.com/v1/{slug}/user-resource/resource_billing
    Floating IPs https://api.idcloudhost.com/v1/{slug}/network/ip_addresses

    HTTP Request

    GET https://api.idcloudhost.com/v1/config/locations

    VM

    Delete VM

    curl "https://api.idcloudhost.com/v1/user-resource/vm" \
        -H "apikey: meowmeowmeow" \
        -X DELETE \
        -d "uuid=aaaaaaaa-0000-bbbb-1111-cccccccccccc"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "Error": "No such virtual machine exists. aaaaaaaa-0000-bbbb-1111-cccccccccccc"
        }
    }
    

    #location-specific

    Delete virtual machine

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/user-resource/vm

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier

    Get VM Info

    curl "https://api.idcloudhost.com/v1/user-resource/vm?uuid=f80b1d62-ffe4-43ef-9210-60f05445456a" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    {
        "backup": true,
        "billing_account": 6,
        "created_at": "2018-02-22 11:10:17",
        "description": "",
        "hostname": "hostname",
        "hypervisor_id": null,
        "id": 7,
        "mac": "52:54:00:6c:6a:ac",
        "memory": 2048,
        "name": "Ubuntu-16-04",
        "os_name": "ubuntu",
        "os_version": "16.04",
        "private_ipv4": "",
        "status": "running",
        "storage": [
            {
                "created_at": "2018-02-22 11:10:37.793878",
                "id": 5,
                "name": "sda",
                "pool": "default2",
                "primary": true,
                "replica": [],
                "shared": false,
                "size": 20,
                "type": "block",
                "updated_at": null,
                "user_id": 8,
                "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a"
            }
        ],
        "tags": null,
        "updated_at": "2018-02-22 13:48:21",
        "user_id": 8,
        "username": "example",
        "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a",
        "vcpu": 2
    }
    

    #location-specific

    Get virtual machine data

    HTTP Request

    GET https://api.idcloudhost.com/v1/user-resource/vm

    Query Parameters

    Parameter Default Type
    uuid Basic text / string value

    Change Password

    curl "https://api.idcloudhost.com/v1/user-resource/vm/user" \
        -H "apikey: meowmeowmeow" \
        -X PATCH \
        -d "uuid=5aea1842-895f-4bd3-8bd6-e37b2282fb46" \
        -d "username=example" \
        -d "password=Password1234"
    

    The above command returns JSON structured like this:

    {
        "success": true
    }
    

    #location-specific

    Set a new password for an existing user on the virtual machine. The VM must be running, otherwise the password cannot be changed and an error will be returned.

    HTTP Request

    PATCH https://api.idcloudhost.com/v1/user-resource/vm/user

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier
    username Basic text / string value
    password Basic text / string value

    Modify VM

    curl "https://api.idcloudhost.com/v1/user-resource/vm" \
        -H "apikey: meowmeowmeow" \
        -X PATCH \
        -d "uuid=5aea1842-895f-4bd3-8bd6-e37b2282fb46" \
        -d "name=web-server" \
        -d "vcpu=4" \
        -d "ram=2048"
    

    The above command returns JSON structured like this:

    {
        "success": true
    }
    

    #location-specific

    Currently only name, vcpu and ram can be changed. Do note that vcpu and ram can only be changed when the machine is in stopped state.

    HTTP Request

    PATCH https://api.idcloudhost.com/v1/user-resource/vm

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier
    name Basic text / string value
    ram A Whole number
    vcpu A Whole number

    Create VM

    curl "https://api.idcloudhost.com/v1/user-resource/vm" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "name=Ubuntu-16-04" \
        -d "os_name=ubuntu" \
        -d "os_version=16.04" \
        -d "disks=20" \
        -d "vcpu=2" \
        -d "ram=2048" \
        -d "username=example" \
        -d "password=Password123" \
        -d "billing_account_id=6" \
        -d "network_uuid=50341410-9e88-4af2-a21e-b8c898e33e52"
    

    The above command returns JSON structured like this:

    {
        "backup": false,
        "billing_account": 6,
        "created_at": "2018-02-22 14:24:03",
        "description": "",
        "hostname": "hostname",
        "hypervisor_id": null,
        "id": 10,
        "mac": "52:54:00:a2:52:6a",
        "memory": 2048,
        "name": "Ubuntu-16-04",
        "os_name": "ubuntu",
        "os_version": "16.04",
        "private_ipv4": "",
        "status": "running",
        "storage": [
            {
                "created_at": "2018-02-22 14:24:13.766985",
                "id": 8,
                "name": "sda",
                "pool": "default2",
                "primary": true,
                "replica": [],
                "shared": false,
                "size": 20,
                "type": "block",
                "updated_at": null,
                "user_id": 8,
                "uuid": "fc880f74-cf03-4a7a-93da-74c506157023"
            }
        ],
        "tags": null,
        "updated_at": "2018-02-22 14:24:13",
        "user_id": 8,
        "username": "example",
        "uuid": "fc880f74-cf03-4a7a-93da-74c506157023",
        "vcpu": 2
    }
    

    #location-specific

    Create a new virtual machine. billing_account_id is optional if using an API token that is restricted to one billing account. Specify source_uuid and source_replica to create the new virtual machine as a copy of an existing backup or snapshot. If a VM without public IP address is needed, set reserve_public_ip to False. Specify network_uuid to create the VM in the given network. If the value is emtpy the VM is created in the default network.

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/vm

    Form Parameters

    Parameter Default Type
    backup False Accepts a true or false value
    billing_account_id 0 A Whole number
    description Basic text / string value
    disks Basic text / string value
    name Basic text / string value
    os_name Basic text / string value
    os_version Basic text / string value
    password Basic text / string value
    public_key Basic text / string value
    ram A Whole number
    source_replica Basic text / string value
    source_uuid A Universally Unique IDentifier
    username Basic text / string value
    vcpu A Whole number
    reserve_public_ip True Accepts a true or false value
    network_uuid Network uuid

    Toggle Auto Backup

    curl "https://api.idcloudhost.com/v1/user-resource/vm/backup" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "uuid=f80b1d62-ffe4-43ef-9210-60f05445456a"
    

    The above command returns JSON structured like this:

    {
        "backup": false,
        "billing_account": 6,
        "created_at": "2018-02-22 11:10:17",
        "description": "",
        "hostname": "hostname",
        "hypervisor_id": null,
        "id": 7,
        "mac": "52:54:00:6c:6a:ac",
        "memory": 2048,
        "name": "Ubuntu-16-04",
        "os_name": "ubuntu",
        "os_version": "16.04",
        "private_ipv4": "",
        "status": "running",
        "storage": [
            {
                "created_at": "2018-02-22 11:10:37.793878",
                "id": 5,
                "name": "sda",
                "pool": "default2",
                "primary": true,
                "replica": [],
                "shared": false,
                "size": 20,
                "type": "block",
                "updated_at": null,
                "user_id": 8,
                "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a"
            }
        ],
        "tags": null,
        "updated_at": "2018-02-22 14:24:14",
        "user_id": 8,
        "username": "example",
        "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a",
        "vcpu": 2
    }
    

    #location-specific

    Toggle automatic backups for virtual machine

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/vm/backup

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier

    Clone VM

    curl "https://api.idcloudhost.com/v1/user-resource/vm/clone" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "uuid=f80b1d62-ffe4-43ef-9210-60f05445456a" \
        -d "name=Name of the Clone"
    

    The above command returns JSON structured like this:

    {
        "backup": false,
        "billing_account": 6,
        "created_at": "2018-02-22 14:24:30",
        "description": "",
        "hostname": "hostname",
        "hypervisor_id": null,
        "id": 11,
        "mac": "52:54:00:59:44:d1",
        "memory": 2048,
        "name": "Name of the Clone",
        "os_name": "ubuntu",
        "os_version": "16.04",
        "private_ipv4": "",
        "status": "running",
        "storage": [
            {
                "created_at": "2018-02-22 14:24:30.312877",
                "id": 9,
                "name": "sda",
                "pool": "default2",
                "primary": true,
                "replica": [],
                "shared": false,
                "size": 20,
                "type": "block",
                "updated_at": null,
                "user_id": 8,
                "uuid": "d582f16a-013b-4a23-8463-c66bbbc96c43"
            }
        ],
        "tags": null,
        "updated_at": null,
        "user_id": 8,
        "username": "example",
        "uuid": "d582f16a-013b-4a23-8463-c66bbbc96c43",
        "vcpu": 2
    }
    

    #location-specific

    Clone existing virtual machine

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/vm/clone

    Form Parameters

    Parameter Default Type
    name Basic text / string value
    uuid A Universally Unique IDentifier

    Release Public IP

    curl "https://api.idcloudhost.com/v1/user-resource/vm/ip/public" \
        -H "apikey: meowmeowmeow" \
        -X DELETE \
        -d "uuid=5aea1842-895f-4bd3-8bd6-e37b2282fb46"
    

    The above command returns JSON structured like this:

    {
        "backup": false,
        "billing_account": 6,
        "created_at": "2018-02-22 14:24:03",
        "description": "",
        "hostname": "hostname",
        "id": 10,
        "mac": "52:54:00:a2:52:6a",
        "memory": 2048,
        "name": "Ubuntu-16-04",
        "os_name": "ubuntu",
        "os_version": "16.04",
        "private_ipv4": "10.1.14.253",
        "status": "running",
        "storage": [
            {
                "created_at": "2018-02-22 14:24:13.766985",
                "name": "sda",
                "pool": "default2",
                "primary": true,
                "replica": [],
                "shared": false,
                "size": 20,
                "type": "block",
                "updated_at": null,
                "user_id": 8,
                "uuid": "fc880f74-cf03-4a7a-93da-74c506157023"
            }
        ],
        "updated_at": "2018-02-22 14:24:13",
        "user_id": 8,
        "username": "example",
        "uuid": "fc880f74-cf03-4a7a-93da-74c506157023",
        "vcpu": 2
    }
    

    #location-specific

    DEPRECATED, see Floating IP for the updated API.

    Release a virtual machine's public IP address. The address will remain reserved for the user.

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/user-resource/vm/ip/public

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier

    Reserve Public IP

    curl "https://api.idcloudhost.com/v1/user-resource/vm/ip/public" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "uuid=5aea1842-895f-4bd3-8bd6-e37b2282fb46"
    

    The above command returns JSON structured like this:

    {
        "backup": false,
        "billing_account": 6,
        "created_at": "2018-02-22 14:24:03",
        "description": "",
        "hostname": "hostname",
        "id": 10,
        "mac": "52:54:00:a2:52:6a",
        "memory": 2048,
        "name": "Ubuntu-16-04",
        "os_name": "ubuntu",
        "os_version": "16.04",
        "private_ipv4": "10.1.14.253",
        "status": "running",
        "storage": [
            {
                "created_at": "2018-02-22 14:24:13.766985",
                "name": "sda",
                "pool": "default2",
                "primary": true,
                "replica": [],
                "shared": false,
                "size": 20,
                "type": "block",
                "updated_at": null,
                "user_id": 8,
                "uuid": "fc880f74-cf03-4a7a-93da-74c506157023"
            }
        ],
        "updated_at": "2018-02-22 14:24:13",
        "user_id": 8,
        "username": "example",
        "uuid": "fc880f74-cf03-4a7a-93da-74c506157023",
        "vcpu": 2
    }
    

    #location-specific

    DEPRECATED, see Floating IP for the updated API. This endpoint reserves a new IP address but does not return it in the response.

    Reserve and assign a public IP address for a virtual machine.

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/vm/ip/public

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier

    List VMs

    curl "https://api.idcloudhost.com/v1/user-resource/vm/list" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "backup": false,
            "billing_account": 6,
            "created_at": "2018-02-22 14:24:30",
            "description": "",
            "hostname": "hostname",
            "hypervisor_id": null,
            "id": 11,
            "mac": "52:54:00:59:44:d1",
            "memory": 2048,
            "name": "Name of the Clone",
            "os_name": "ubuntu",
            "os_version": "16.04",
            "private_ipv4": "10.1.14.251",
            "status": "running",
            "storage": [
                {
                    "created_at": "2018-02-22 14:24:30.312877",
                    "id": 9,
                    "name": "sda",
                    "pool": "default2",
                    "primary": true,
                    "replica": [],
                    "shared": false,
                    "size": 20,
                    "type": "block",
                    "updated_at": null,
                    "user_id": 8,
                    "uuid": "d582f16a-013b-4a23-8463-c66bbbc96c43"
                }
            ],
            "tags": null,
            "updated_at": null,
            "user_id": 8,
            "username": "example",
            "uuid": "d582f16a-013b-4a23-8463-c66bbbc96c43",
            "vcpu": 2
        },
        {
            "backup": false,
            "billing_account": 6,
            "created_at": "2018-02-22 14:24:03",
            "description": "",
            "hostname": "hostname",
            "hypervisor_id": null,
            "id": 10,
            "mac": "52:54:00:a2:52:6a",
            "memory": 2048,
            "name": "Ubuntu-16-04",
            "os_name": "ubuntu",
            "os_version": "16.04",
            "private_ipv4": "10.1.14.253",
            "status": "running",
            "storage": [
                {
                    "created_at": "2018-02-22 14:24:13.766985",
                    "id": 8,
                    "name": "sda",
                    "pool": "default2",
                    "primary": true,
                    "replica": [],
                    "shared": false,
                    "size": 20,
                    "type": "block",
                    "updated_at": null,
                    "user_id": 8,
                    "uuid": "fc880f74-cf03-4a7a-93da-74c506157023"
                }
            ],
            "tags": null,
            "updated_at": "2018-02-22 14:24:13",
            "user_id": 8,
            "username": "example",
            "uuid": "fc880f74-cf03-4a7a-93da-74c506157023",
            "vcpu": 2
        },
        {
            "backup": false,
            "billing_account": 6,
            "created_at": "2018-02-22 11:29:30",
            "description": "",
            "hostname": "hostname",
            "hypervisor_id": null,
            "id": 8,
            "mac": "52:54:00:20:e4:ac",
            "memory": 2048,
            "name": "Ubuntu-3-16-04",
            "os_name": "ubuntu",
            "os_version": "16.04",
            "private_ipv4": "10.1.14.252",
            "status": "running",
            "storage": [
                {
                    "created_at": "2018-02-22 11:29:41.098793",
                    "id": 6,
                    "name": "sda",
                    "pool": "default2",
                    "primary": true,
                    "replica": [],
                    "shared": false,
                    "size": 20,
                    "type": "block",
                    "updated_at": null,
                    "user_id": 8,
                    "uuid": "dab38e6e-b5bf-41c5-9baa-be1f2ec47931"
                }
            ],
            "tags": null,
            "updated_at": "2018-02-22 11:29:41",
            "user_id": 8,
            "username": "example",
            "uuid": "dab38e6e-b5bf-41c5-9baa-be1f2ec47931",
            "vcpu": 2
        },
        {
            "backup": false,
            "billing_account": 6,
            "created_at": "2018-02-22 11:10:17",
            "description": "",
            "hostname": "hostname",
            "hypervisor_id": null,
            "id": 7,
            "mac": "52:54:00:6c:6a:ac",
            "memory": 2048,
            "name": "Ubuntu-16-04",
            "os_name": "ubuntu",
            "os_version": "16.04",
            "private_ipv4": "10.1.14.250",
            "status": "running",
            "storage": [
                {
                    "created_at": "2018-02-22 11:10:37.793878",
                    "id": 5,
                    "name": "sda",
                    "pool": "default2",
                    "primary": true,
                    "replica": [],
                    "shared": false,
                    "size": 20,
                    "type": "block",
                    "updated_at": null,
                    "user_id": 8,
                    "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a"
                }
            ],
            "tags": null,
            "updated_at": "2018-02-22 14:24:14",
            "user_id": 8,
            "username": "example",
            "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a",
            "vcpu": 2
        },
        {
            "backup": false,
            "billing_account": 6,
            "created_at": "2018-02-22 09:50:26",
            "description": "",
            "hostname": "hostname",
            "hypervisor_id": null,
            "id": 6,
            "mac": "52:54:00:d4:ba:a3",
            "memory": 2048,
            "name": "DEBUGXYZ-2-buntu",
            "os_name": "ubuntu",
            "os_version": "16.04",
            "private_ipv4": "10.1.14.249",
            "status": "running",
            "storage": [
                {
                    "created_at": "2018-02-22 09:50:37.638670",
                    "id": 4,
                    "name": "sda",
                    "pool": "default2",
                    "primary": true,
                    "replica": [],
                    "shared": false,
                    "size": 20,
                    "type": "block",
                    "updated_at": null,
                    "user_id": 8,
                    "uuid": "e624e5cb-e0f9-4b59-8686-0a4c829027c6"
                }
            ],
            "tags": null,
            "updated_at": "2018-02-22 09:50:37",
            "user_id": 8,
            "username": "example",
            "uuid": "e624e5cb-e0f9-4b59-8686-0a4c829027c6",
            "vcpu": 2
        }
    ]
    

    #location-specific

    Get virtual machine list

    HTTP Request

    GET https://api.idcloudhost.com/v1/user-resource/vm/list

    Rebuild from Replica

    curl "https://api.idcloudhost.com/v1/user-resource/vm/rebuild" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "uuid=5aea1842-895f-4bd3-8bd6-e37b2282fb46" \
        -d "replica_uuid=5aea1842-895f-4bd3-8bd6-e37b2282fb462018-12-21-14-05-33"
    

    The above command returns JSON structured like this:

    {
        "backup": false,
        "billing_account": 129072,
        "created_at": "2018-12-18 13:30:59",
        "description": "6\u20ac",
        "hostname": "hostname",
        "hv_ip": "10.10.35.124",
        "hypervisor_id": null,
        "id": 1263,
        "mac": "52:54:00:45:e2:40",
        "memory": 2048,
        "name": "web-server",
        "os_name": "ubuntu",
        "os_version": "16.04",
        "private_ipv4": "10.1.8.254",
        "status": "stopped",
        "storage": [
            {
                "created_at": "2018-12-18 13:32:33.082406",
                "id": 1120,
                "name": "sda",
                "pool": "default2",
                "primary": true,
                "replica": [
                    {
                        "created_at": "2018-12-21 14:05:35.509898",
                        "id": 866,
                        "master_id": 1120,
                        "master_uuid": "5aea1842-895f-4bd3-8bd6-e37b2282fb46",
                        "pool": "",
                        "size": 20,
                        "type": "snapshot",
                        "updated_at": null,
                        "uuid": "5aea1842-895f-4bd3-8bd6-e37b2282fb462018-12-21-14-05-33"
                    }
                ],
                "shared": false,
                "size": 20,
                "type": "block",
                "updated_at": null,
                "user_id": 8,
                "uuid": "5aea1842-895f-4bd3-8bd6-e37b2282fb46"
            }
        ],
        "tags": null,
        "updated_at": "2018-12-21 14:19:14",
        "user_id": 8,
        "username": "user",
        "uuid": "5aea1842-895f-4bd3-8bd6-e37b2282fb46",
        "vcpu": 4
    }
    

    #location-specific

    Discard virtual machine's current storage state and restore it from the specified replica.

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/vm/rebuild

    Form Parameters

    Parameter Default Type
    replica_uuid Basic text / string value
    uuid A Universally Unique IDentifier

    Delete Replica

    curl "https://api.idcloudhost.com/v1/user-resource/vm/replica" \
        -H "apikey: meowmeowmeow" \
        -X DELETE \
        -d "replica_uuid=val"
    

    The above command returns JSON structured like this:

    {
        "success": true
    }
    

    #location-specific

    Delete replica by uuid

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/user-resource/vm/replica

    Form Parameters

    Parameter Default Type
    replica_uuid Basic text / string value

    List Replicas

    curl "https://api.idcloudhost.com/v1/user-resource/vm/replica?uuid=f80b1d62-ffe4-43ef-9210-60f05445456a" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    []
    

    #location-specific

    Get virtual machine storage replica list

    HTTP Request

    GET https://api.idcloudhost.com/v1/user-resource/vm/replica

    Query Parameters

    Parameter Default Type
    r_type snapshot Basic text / string value
    uuid A Universally Unique IDentifier

    Convert Replica

    curl "https://api.idcloudhost.com/v1/user-resource/vm/replica" \
        -H "apikey: meowmeowmeow" \
        -X PATCH \
        -d "replica_uuid=aaaaaaaa-0000-bbbb-1111-cccccccccccc"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "Error": "No such storage replica exists."
        }
    }
    

    #location-specific

    Convert replica from one type to another. Currently all snapshots and backups are same type so conversion is just changing type in database.

    HTTP Request

    PATCH https://api.idcloudhost.com/v1/user-resource/vm/replica

    Form Parameters

    Parameter Default Type
    from_type backup Basic text / string value
    replica_uuid A Universally Unique IDentifier
    to_type snapshot Basic text / string value

    Create Replica

    curl "https://api.idcloudhost.com/v1/user-resource/vm/replica" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "uuid=f80b1d62-ffe4-43ef-9210-60f05445456a"
    

    The above command returns JSON structured like this:

    {
        "created_at": "2018-02-22 11:10:37",
        "id": 5,
        "name": "sda",
        "pool": "default2",
        "primary": true,
        "replica": [
            {
                "created_at": "2018-02-22 14:24:51.886326",
                "id": 5,
                "master_id": 5,
                "master_uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a",
                "pool": "",
                "size": 60,
                "type": "snapshot",
                "updated_at": null,
                "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a2018-02-22-14-24-32"
            }
        ],
        "shared": false,
        "size": 20,
        "type": "block",
        "updated_at": null,
        "user_id": 8,
        "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a"
    }
    

    #location-specific

    Create replica from block storage

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/vm/replica

    Form Parameters

    Parameter Default Type
    r_type snapshot Basic text / string value
    uuid A Universally Unique IDentifier

    Start VM

    curl "https://api.idcloudhost.com/v1/user-resource/vm/start" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "uuid=aaaaaaaa-0000-bbbb-1111-cccccccccccc"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "Error": "No such virtual machine exists. aaaaaaaa-0000-bbbb-1111-cccccccccccc"
        }
    }
    

    #location-specific

    Start virtual machine

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/vm/start

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier

    Stop VM

    curl "https://api.idcloudhost.com/v1/user-resource/vm/stop" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "uuid=5052bf02-044a-4d35-a803-d6b156f84beb"
    

    The above command returns JSON structured like this:

    {
        "backup": false,
        "billing_account": 129072,
        "created_at": "2018-11-08 14:57:47",
        "description": "",
        "hostname": "hostname",
        "hv_ip": "10.10.35.125",
        "hypervisor_id": null,
        "id": 232,
        "mac": "52:54:00:18:db:d6",
        "memory": 4096,
        "name": "Ubuntu-16-04",
        "os_name": "ubuntu",
        "os_version": "16.04",
        "private_ipv4": "10.1.8.248",
        "status": "stopped",
        "storage": [
            {
                "created_at": "2018-11-08 14:58:19.237160",
                "primary": true,
                "type": "block",
                "name": "sda",
                "uuid": "5052bf02-044a-4d35-a803-d6b156f84beb",
                "updated_at": null,
                "shared": false,
                "pool": "default2",
                "size": 20,
                "user_id": 8,
                "id": 214,
                "replica": []
            }
        ],
        "tags": null,
        "updated_at": "2019-04-24 09:30:05",
        "user_id": 8,
        "username": "user",
        "uuid": "5052bf02-044a-4d35-a803-d6b156f84beb",
        "vcpu": 4
    }
    

    #location-specific

    Stop a virtual machine. By default, tries to stop the VM gracefully via ACPI shutdown signal, this gives the OS the opportunity to do a proper shutdown. If, for some reason, the OS does not respond to a normal shutdown signal, an optional force=True parameter can be specified. This will "pull the plug" immediately, it is the physical equivalent of cutting the power supply to a machine. This has the potential danger of leaving behind corrupt data on the VM, so use it with caution.

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/vm/stop

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier
    force False Accepts a true or false value

    Boot VM in rescue mode

    curl "https://api.idcloudhost.com/v1/user-resource/vm/rescue_start" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "uuid=5052bf02-044a-4d35-a803-d6b156f84beb"
    

    #location-specific

    Launches the VM with a “live” OS image attached and used for booting. The rescue mode is enabled only for the current launch. Next time this VM is started it will follow a normal routine.

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/vm/rescue_start

    Form Parameters

    Parameter Default Type
    uuid Unique identifier of virtual machine

    Add Disk

    curl "https://api.idcloudhost.com/v1/user-resource/vm/storage" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "uuid=5052bf02-044a-4d35-a803-d6b156f84beb" \
        -d "size_gb=50"
    

    The above command returns JSON structured like this:

    {
        "created_at": "2019-08-14 13:57:44",
        "name": "vdc",
        "pool": "default",
        "primary": false,
        "replica": [],
        "shared": false,
        "size": 50,
        "type": "block",
        "uuid": "3d91aa31-16ec-44ee-b8b3-22a0bda6559e"
    }
    

    #location-specific

    Create and add a disk device of specified capacity to a virtual machine.

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/vm/storage

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier
    size_gb A Whole number

    Modify Disk

    curl "https://api.idcloudhost.com/v1/user-resource/vm/storage" \
        -H "apikey: meowmeowmeow" \
        -X PATCH \
        -d "uuid=5052bf02-044a-4d35-a803-d6b156f84beb" \
        -d "disk_uuid=3d91aa31-16ec-44ee-b8b3-22a0bda6559e" \
        -d "size_gb=60"
    

    The above command returns JSON structured like this:

    {
        "created_at": "2019-08-14 13:57:44",
        "name": "vdc",
        "pool": "default",
        "primary": false,
        "replica": [],
        "shared": false,
        "size": 60,
        "type": "block",
        "updated_at": "2019-08-14 13:58:44",
        "uuid": "3d91aa31-16ec-44ee-b8b3-22a0bda6559e"
    }
    

    #location-specific

    Modify virtual machine disk with the specified capacity. New disk size cannot be smaller than current size.

    HTTP Request

    PATCH https://api.idcloudhost.com/v1/user-resource/vm/storage

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier (VM)
    disk_uuid A Universally Unique IDentifier (storage)
    size_gb A Whole number

    Delete Disk

    curl "https://api.idcloudhost.com/v1/user-resource/vm/storage" \
        -H "apikey: meowmeowmeow" \
        -X DELETE \
        -d "uuid=5052bf02-044a-4d35-a803-d6b156f84beb" \
        -d "storage_uuid=3d91aa31-16ec-44ee-b8b3-22a0bda6559e"
    

    The above command returns JSON structured like this:

    {
        "success": true
    }
    

    #location-specific

    Disconnects and completely removes a disk device from a virtual machine. Data on that disk will be irrecoverably lost. Primary/boot disks cannot be deleted. Both VM UUID and disk UUID must be provided.

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/user-resource/vm/storage

    Form Parameters

    Parameter Default Type
    uuid A Universally Unique IDentifier
    storage_uuid A Universally Unique IDentifier

    Storage

    S3 API Info

    curl "https://api.idcloudhost.com/v1/storage/api/s3" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    {
      "url": "https://s3.idcloudhost.com:8080/"
    }
    

    Returns S3 API URL.

    HTTP Request

    GET https://api.idcloudhost.com/v1/storage/api/s3

    Create Bucket

    curl --location --request PUT "https://api.idcloudhost.com/v1/storage/bucket" \
        -H "apikey: meowmeowmeow" \
        -d "name=pang1" \
        -d "billing_account_id=12345"
    

    The above command returns JSON structured like this:

    {
      "name": "pang1",
      "size_bytes": 0,
      "billing_account_id": 129093,
      "num_objects": 0,
      "created_at": "2021-01-22T12:57:13.808+0000",
      "modified_at": "2021-01-22T14:57:13.694+0000"
    }
    

    Create an S3 object storage bucket. Bucket names must be globally unique across all users.

    HTTP Request

    PUT https://api.idcloudhost.com/v1/storage/bucket

    Form Parameters

    Parameter Type Description
    name String Bucket name, must conform to S3 bucket naming rules.
    billing_account_id Integer optional Required if using a global API token.

    Modify Bucket

    curl "https://api.idcloudhost.com/v1/storage/bucket" \
        -H "apikey: meowmeowmeow" \
        -X PATCH \
        -d "name=pang1" \
        -d "billing_account_id=129072"
    

    The above command returns JSON structured like this:

    {
      "name": "pang1",
      "size_bytes": 3425,
      "billing_account_id": 129072,
      "num_objects": 1,
      "created_at": "2021-01-22T12:57:13.808+0000",
      "modified_at": "2021-01-22T14:57:13.694+0000"
    }
    

    Modify a bucket's billing account.

    HTTP Request

    PATCH https://api.idcloudhost.com/v1/storage/bucket

    Form Parameters

    Parameter Type Description
    name String Defines which bucket to modify.
    billing_account_id Integer ID of a billing account.

    Delete Bucket

    curl "https://api.idcloudhost.com/v1/storage/bucket" \
        -H "apikey: meowmeowmeow" \
        -d "name=pang1" \
        -X DELETE
    

    The above command returns HTTP status 204 No Content

    Delete an S3 object storage bucket. Only empty buckets can be deleted via this API.

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/storage/bucket

    Query Parameters

    Parameter Type Description
    name String Defines which bucket to delete.

    Get Bucket

    curl "https://api.idcloudhost.com/v1/storage/bucket" \
        -H "apikey: meowmeowmeow" \
        -d "name=pang1" \
        -X GET
    

    The above command returns JSON structured like this:

    {
      "billing_account_id": 129093,
      "name": "pang1",
      "num_objects": 5,
      "size_bytes": 3189211059,
      "created_at": "2021-01-22T12:57:13.808+0000",
      "modified_at": "2021-01-22T14:57:13.694+0000"
    }
    

    Get bucket information.

    HTTP Request

    GET https://api.idcloudhost.com/v1/storage/bucket

    Query Parameters

    Parameter Type Description
    name String Defines which bucket to retrieve.

    List Buckets

    curl "https://api.idcloudhost.com/v1/storage/bucket/list" \
        -H "apikey: meowmeowmeow" \
        -d "billing_account_id=129072" \
        -X GET
    

    The above command returns JSON structured like this:

    [
      {
        "billing_account_id": 7,
        "name": "asi",
        "num_objects": 0,
        "size_bytes": 0,
        "created_at": "2021-01-22T13:10:09.190+0000",
        "modified_at": "2021-01-21T16:14:06.651+0000"
      },
      {
        "billing_account_id": 129093,
        "name": "pang1",
        "num_objects": 5,
        "size_bytes": 3189211059,
        "created_at": "2021-01-22T13:10:09.190+0000",
        "modified_at": "2021-01-21T16:14:06.651+0000"
      },
      {
        "billing_account_id": 7,
        "name": "pang2",
        "num_objects": 1,
        "size_bytes": 1587609600,
        "created_at": "2021-01-22T13:10:09.190+0000",
        "modified_at": "2021-01-21T16:14:06.651+0000"
      },
      {
        "billing_account_id": 7,
        "name": "pang3",
        "num_objects": 0,
        "size_bytes": 0,
        "created_at": "2021-01-22T13:10:09.190+0000",
        "modified_at": "2021-01-21T16:14:06.651+0000"
      },
      {
        "billing_account_id": 7,
        "name": "porgandid",
        "num_objects": 0,
        "size_bytes": 0,
        "created_at": "2021-01-22T13:10:09.190+0000",
        "modified_at": "2021-01-21T16:14:06.651+0000"
      }
    ]
    

    List user's buckets. Optionally filter the list by billing account.

    HTTP Request

    GET https://api.idcloudhost.com/v1/storage/bucket/list

    Query Parameters

    Parameter Type Description
    billing_account_id Integer optional If specified then only buckets with this billing account are returned.

    Get S3 user

    curl "https://api.idcloudhost.com/v1/storage/user" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    {
      "caps": [],
      "displayName": "user+test@example.com",
      "email": "",
      "maxBuckets": 1000,
      "s3Credentials": [
        {
          "accessKey": "ES1R...1N",
          "secretKey": "bwtl...LU",
          "userId": "user+test@example.com"
        },
        {
          "accessKey": "H2MZ...0A",
          "secretKey": "X8Pb...1j",
          "userId": "user+test@example.com"
        },
        {
          "accessKey": "I16N...0T",
          "secretKey": "bdwq...cn",
          "userId": "user+test@example.com"
        },
        {
          "accessKey": "V5G9...6P",
          "secretKey": "WnNy...C5",
          "userId": "user+test@example.com"
        }
      ],
      "subusers": [],
      "suspended": 0,
      "swiftCredentials": [],
      "userId": "user+test@example.com"
    }
    

    Get S3 user info, including their access and secret keys. User and keys will be generated, if they do not exist already.

    HTTP Request

    GET https://api.idcloudhost.com/v1/storage/user

    Delete key

    curl "https://api.idcloudhost.com/v1/storage/user/keys" \
        -H "apikey: meowmeowmeow" \
        -X DELETE \
        -d "access_key=I16N8YDF6A6FX8ILP30T"
    

    The above command returns JSON structured like this:

    
    

    Delete an S3 key.

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/storage/user/keys

    Form Parameters

    Parameter Type Description
    access_key String Defines which key to delete.

    Get keys

    curl "https://api.idcloudhost.com/v1/storage/user/keys" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
      {
        "accessKey": "ES1R...1N",
        "secretKey": "bwtl...LU",
        "userId": "user+test@example.com"
      },
      {
        "accessKey": "H2MZ...0A",
        "secretKey": "X8Pb...1j",
        "userId": "user+test@example.com"
      },
      {
        "accessKey": "V5G9...6P",
        "secretKey": "WnNy...C5",
        "userId": "user+test@example.com"
      }
    ]
    

    Returns all user keys.

    HTTP Request

    GET https://api.idcloudhost.com/v1/storage/user/keys

    Generate key

    curl "https://api.idcloudhost.com/v1/storage/user/keys" \
        -H "apikey: meowmeowmeow" \
        -X POST
    

    The above command returns JSON structured like this:

    [
      {
        "accessKey": "44PW...BC",
        "secretKey": "etxH...O1",
        "userId": "user+test@example.com"
      },
      {
        "accessKey": "ES1R...1N",
        "secretKey": "bwtl...LU",
        "userId": "user+test@example.com"
      },
      {
        "accessKey": "H2MZ...0A",
        "secretKey": "X8Pb...1j",
        "userId": "user+test@example.com"
      },
      {
        "accessKey": "V5G9...6P",
        "secretKey": "WnNy...C5",
        "userId": "user+test@example.com"
      }
    ]
    

    Generate a new S3 key pair. Returns the list of all keys.

    HTTP Request

    POST https://api.idcloudhost.com/v1/storage/user/keys

    Private networks

    Get network data

    curl "https://api.idcloudhost.com/v1/network/network/50341410-9e88-4af2-a21e-b8c898e33e51" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -H "Content-Type: application/json"'
    

    The above command returns JSON structured like this:

    {
        "vlan_id": 104,
        "subnet": "10.1.104.0/24",
        "name": "Default network",
        "created_at": "2021-06-29 08:22:52",
        "updated_at": "2021-06-29 08:22:52",
        "uuid": "2e8cd389-27fe-45ce-a63d-d536068659e5",
        "type": "private",
        "is_default": true,
        "vm_uuids": ["17fb7d63-7489-4468-bd98-8ca67bf5ef6d", "c3126bc4-d6f0-4c46-8bde-f310449a35e8"],
        "resources_count": 2
    }
    

    #location-specific

    Get network data

    HTTP Request

    GET https://api.idcloudhost.com/v1/network/network/{network_uuid}

    Path varianbles

    Parameter Default Type
    network_uuid UUID

    List Networks

    curl "https://api.idcloudhost.com/v1/network/networks" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "vlan_id": 965,
            "subnet": "10.4.200.0/24",
            "name": "Private network B",
            "created_at": "2021-06-10 09:57:59",
            "updated_at": "2021-06-10 09:57:59",
            "uuid": "4e5eadd3-8b11-4c34-812a-2cf97120b628",
            "type": "private",
            "is_default": false,
            "vm_uuids": [
                "755a023f-dccc-4b8b-b23d-c95fe962983e"
            ],
            "resources_count": 1
        },
        {
            "vlan_id": 104,
            "subnet": "10.1.104.0/24",
            "name": "Privat network - default",
            "created_at": "2021-06-29 08:22:52",
            "updated_at": "2021-06-29 08:22:52",
            "uuid": "2e8cd389-27fe-45ce-a63d-d536068659e5",
            "type": "private",
            "is_default": true,
            "vm_uuids": [
                "45f13d58-2464-4d40-a1d0-d1b7cabc8f54",
                "7c02ce9a-3d53-4565-898e-62a8ecf1d42f"
            ],
            "resources_count": 2
        }
    ]
    

    #location-specific

    List user networks with resources.

    HTTP Request

    GET https://api.idcloudhost.com/v1/network/networks

    Create or get default network

    curl "https://api.idcloudhost.com/v1/network/network?name=network3" \
        -H "apikey: meowmeowmeow" \
        -X POST
    

    The above command returns JSON structured like this:

    {
        "vlan_id": 104,
        "subnet": "10.1.104.0/24",
        "name": "network3",
        "created_at": "2021-06-29 08:22:52",
        "updated_at": "2021-06-29 08:22:52",
        "uuid": "2e8cd389-27fe-45ce-a63d-d536068659e5",
        "type": "private",
        "is_default": true,
        "vm_uuids": [],
        "resources_count": 0
    }
    

    #location-specific

    If the network name is not specified the default network is returned if exists. Otherwise the default network is created with name 'Default network'. If name is given the new network is created with this name. If the created network is the first network of the user it is set as default.

    HTTP Request

    GET https://api.idcloudhost.com/v1/network/network?name=MyNetwork

    Request parameters

    Parameter Required Type
    name 0 Basic text / string value

    Delete network

    curl "https://api.idcloudhost.com/v1/network/network/4e5eadd3-8b11-4c34-812a-2cf97120b628" \
        -H "apikey: meowmeowmeow" \
        -H "Content-Type: application/json" \
        -X DELETE' 
    

    The above command returns an empty response

    #location-specific

    Delete network. The network can be deleted if it does not contain any resources and it is not default.

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/network/ip_addresses/{network_uuid}

    Path variables

    Parameter Required Type
    network_uuid 1 UUID

    Change network to default

    curl "https://api.idcloudhost.com/v1/network/network/4e5eadd3-8b11-4c34-812a-2cf97120b628/default" \
        -H "apikey: meowmeowmeow" \
        -H "Content-Type: application/json" \
        -X PUT' 
    

    The above command returns JSON structured like this:

    {
        "vlan_id": 104,
        "subnet": "10.1.104.0/24",
        "name": "network3",
        "created_at": "2021-06-29 08:22:52",
        "updated_at": "2021-06-29 08:22:52",
        "uuid": "4e5eadd3-8b11-4c34-812a-2cf97120b628",
        "type": "private",
        "is_default": true,
        "vm_uuids": ["2e8cd389-27fe-45ce-a63d-d536068659e5"],
        "resources_count": 1
    }
    

    #location-specific

    Change network to default. The network is change to the default network for the future resources. The other private networks will be changed to non default.

    HTTP Request

    PUT https://api.idcloudhost.com/v1/network/ip_addresses/{network_uuid}/default

    Path variables

    Parameter Required Type
    network_uuid 1 UUID

    Change network name

    curl "https://api.idcloudhost.com/v1/network/network/4e5eadd3-8b11-4c34-812a-2cf97120b628t" \
        -H "apikey: meowmeowmeow" \
        -H "Content-Type: application/json" \
        --data '{"name":"My new network name"}' \
        -X PATCH' 
    

    The above command returns JSON structured like this:

    {
        "vlan_id": 104,
        "subnet": "10.1.104.0/24",
        "name": "My new network name",
        "created_at": "2021-06-29 08:22:52",
        "updated_at": "2021-06-29 08:22:52",
        "uuid": "4e5eadd3-8b11-4c34-812a-2cf97120b628",
        "type": "private",
        "is_default": true,
        "vm_uuids": ["2e8cd389-27fe-45ce-a63d-d536068659e5"],
        "resources_count": 1
    }
    

    #location-specific

    Change network name.

    HTTP Request

    PATCH https://api.idcloudhost.com/v1/network/ip_addresses/{network_uuid}

    Path variables

    Parameter Required Type
    network_uuid 1 UUID

    Request json body

    Parameter Required Type
    name 0 Basic text / string value

    Floating IP

    Create Floating IP

    curl "https://api.idcloudhost.com/v1/network/ip_addresses" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -H "Content-Type: application/json" \
        --data '{"name": "my_ip", "billing_account_id": 2}'
    

    The above command returns JSON structured like this:

    {
      "id": 1,
      "address": "1.1.1.1",
      "user_id": 666,
      "billing_account_id": 2,
      "type": "public",
      "network_id": null,
      "name": "my_ip",
      "enabled": true,
      "created_at": "2019-10-31 10:52:19",
      "updated_at": "2019-11-01 10:22:19",
      "assigned_to": null
    }
    

    #location-specific

    Create new floating IP

    HTTP Request

    POST https://api.idcloudhost.com/v1/network/ip_addresses/

    Request json body

    Parameter Required Type
    billing_account_id 1 A Whole number
    name 0 Basic text / string value

    List Floating IPs

    curl "https://api.idcloudhost.com/v1/network/ip_addresses?billing_account_id=1" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "id": 1,
            "address": "1.1.1.1",
            "user_id": 666,
            "billing_account_id": 1,
            "type": "public",
            "network_id": null,
            "name": "My First Ip",
            "enabled": true,
            "created_at": "2019-10-31 10:52:19",
            "updated_at": "2019-11-01 10:22:19",
            "assigned_to": "88e5a11b-9c89-4986-99c7-90d43499317c"
          },
          {
            "id": 2,
            "address": "2.2.2.2",
            "user_id": 666,
            "billing_account_id": 1,
            "type": "public",
            "network_id": null,
            "name": "dns: A test.example.com",
            "enabled": true,
            "created_at": "2019-10-31 10:52:19",
            "updated_at": "2019-11-01 10:22:19",
            "assigned_to": null
        }
    ]
    

    #location-specific

    List floating IPs. Can be filtered by billing_account_id and vm_uuid, if necessary.

    HTTP Request

    GET https://api.idcloudhost.com/v1/network/ip_addresses

    Query Parameters

    Parameter Default Type
    billing_account_id A Whole number
    vm_uuid A Universally Unique IDentifier

    Get Floating IP

    curl "https://api.idcloudhost.com/v1/network/ip_addresses/1.1.1.1" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    {
        "id": 1,
        "address": "1.1.1.1",
        "user_id": 666,
        "billing_account_id": 1,
        "type": "public",
        "network_id": null,
        "name": "My First Ip",
        "enabled": true,
        "created_at": "2019-10-31 10:52:19",
        "updated_at": "2019-11-01 10:22:19",
        "assigned_to": "88e5a11b-9c89-4986-99c7-90d43499317c"
      }
    

    #location-specific

    Get floating IP

    HTTP Request

    GET https://api.idcloudhost.com/v1/network/ip_addresses/{public_ipv4_address}

    Update Floating IP

    curl "https://api.idcloudhost.com/v1/network/ip_addresses/1.1.1.1" \
        -H "apikey: meowmeowmeow" \
        -H "Content-Type: application/json" \
        -X PATCH \
        --data '{"name": "my_ip", billing_account_id": 2}' 
    

    The above command returns JSON structured like this:

    {
      "id": 1,
      "address": "1.1.1.1",
      "user_id": 666,
      "billing_account_id": 2,
      "type": "public",
      "network_id": null,
      "name": "my_ip",
      "enabled": true,
      "created_at": "2019-10-31 10:52:19",
      "updated_at": "2019-11-01 10:22:19",
      "assigned_to": null
    }
    

    #location-specific

    Update floating IP

    HTTP Request

    PATCH https://api.idcloudhost.com/v1/network/ip_addresses/{public_ipv4_address}

    Request json body

    Parameter Required Type
    billing_account_id 0 A Whole number
    name 0 Basic text / string value

    Delete Floating IP

    curl "https://api.idcloudhost.com/v1/ip_addresses/1.1.1.1" \
        -H "apikey: meowmeowmeow" \
        -X DELETE
    

    The above command returns like this:

    <Response body is empty>
    
    Response code: 200;
    

    #location-specific

    Delete floating IP

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/network/ip_addresses/{public_ipv4_address}

    Assign Floating IP

    curl "https://api.idcloudhost.com/v1/network/ip_addresses/1.1.1.1/assign" \
        -H "apikey: meowmeowmeow" \
        -H "Content-Type: application/json" \
        -X POST \
        --data '{"vm_uuid": "88e5a11b-9c89-4986-99c7-90d43499317c"}' 
    

    The above command returns JSON structured like this:

    {
      "id": 1,
      "address": "1.1.1.1",
      "user_id": 666,
      "billing_account_id": 2,
      "type": "public",
      "network_id": null,
      "name": "my_ip",
      "enabled": true,
      "created_at": "2019-10-31 10:52:19",
      "updated_at": "2019-11-01 10:22:19",
      "assigned_to": "88e5a11b-9c89-4986-99c7-90d43499317c"
    }
    

    #location-specific

    Assign floating IP

    HTTP Request

    POST https://api.idcloudhost.com/v1/network/ip_addresses/{public_ipv4_address}/assign

    Un-assign Floating IP

    curl "https://api.idcloudhost.com/v1/network/ip_addresses/1.1.1.1/unassign" \
        -H "apikey: meowmeowmeow" \
        -H "Content-Type: application/json" \
        -X POST 
    

    The above command returns JSON structured like this:

    {
      "id": 1,
      "address": "1.1.1.1",
      "user_id": 666,
      "billing_account_id": 2,
      "type": "public",
      "network_id": null,
      "name": "my_ip",
      "enabled": true,
      "created_at": "2019-10-31 10:52:19",
      "updated_at": "2019-11-01 10:22:19",
      "assigned_to": null
    }
    

    #location-specific

    Un-assign floating IP

    HTTP Request

    POST https://api.idcloudhost.com/v1/network/ip_addresses/{public_ipv4_address}/unassign

    Parameters

    VM parameters

    curl "https://api.idcloudhost.com/v1/api/parameters/vm" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "constraint": "range",
            "description": "Size of main storage in gigabytes.",
            "mandatory": true,
            "max": 240,
            "min": 20,
            "parameter": "disks",
            "type": "integer"
        },
        {
            "constraint": "regexp",
            "description": "Name of the VM",
            "expression": "^[0-9a-zA-Z][-0-9a-zA-Z]{2,}[0-9a-zA-Z]$",
            "mandatory": true,
            "parameter": "name",
            "type": "string"
        },
        {
            "constraint": "enum",
            "description": "OS name of VM base image.",
            "mandatory": true,
            "parameter": "os_name",
            "type": "string",
            "values": [
                "centos",
                "ubuntu",
                "windows",
                "debian"
            ]
        },
        {
            "constraint": "enum",
            "description": "OS version of VM base image.",
            "limited_by": "os_name",
            "limits": [
                {
                    "os_name": "centos",
                    "values": [
                        "7.3.1611",
                        "6.9.1611"
                    ]
                },
                {
                    "os_name": "ubuntu",
                    "values": [
                        "16.04"
                    ]
                },
                {
                    "os_name": "windows",
                    "values": [
                        "2016"
                    ]
                },
                {
                    "os_name": "debian",
                    "values": [
                        "9.1"
                    ]
                }
            ],
            "mandatory": true,
            "parameter": "os_version",
            "type": "string"
        },
        {
            "constraint": "regexp",
            "description": "Password for logging in to the VM.",
            "expression": "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{8,}$",
            "mandatory": true,
            "parameter": "password",
            "type": "string"
        },
        {
            "constraint": "range",
            "description": "Amount of RAM.",
            "limited_by": "os_name",
            "limits": [
                {
                    "min": 1024,
                    "os_name": "windows"
                }
            ],
            "mandatory": true,
            "max": 65536,
            "min": 512,
            "parameter": "ram",
            "type": "integer"
        },
        {
            "constraint": "regexp",
            "description": "Username for logging in to the VM.",
            "expression": "^(?=.{1,30}$)[a-zA-Z_][0-9a-zA-Z_-]*$",
            "limited_by": "os_name",
            "limits": [
                {
                    "mandatory": false,
                    "os_name": "windows"
                }
            ],
            "mandatory": true,
            "parameter": "username",
            "type": "string"
        },
        {
            "constraint": "range",
            "description": "Number of CPUs.",
            "limited_by": "os_name",
            "limits": [
                {
                    "min": 2,
                    "os_name": "windows"
                }
            ],
            "mandatory": true,
            "max": 16,
            "min": 1,
            "parameter": "vcpu",
            "type": "integer"
        }
    ]
    

    Describes VM creation parameters and their expected and allowed values.

    HTTP Request

    GET https://api.idcloudhost.com/v1/api/parameters/vm

    VM images list

    curl "https://api.idcloudhost.com/v1/config/vm_images" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
      {
        "os_name": "almalinux",
        "display_name": "Almalinux",
        "ui_position": 1,
        "is_default": true,
        "is_app_catalog": false,
        "icon": "...",
        "versions": [
          {
            "os_version": "8",
            "display_name": "8",
            "published": true
          }
        ]
      },
      {
        "os_name": "centos",
        "display_name": "Centos",
        "ui_position": 2,
        "is_default": false,
        "is_app_catalog": true,
        "icon": "....",
        "versions": [
          {
            "os_version": "7.3.1611",
            "display_name": "7.3.1611",
            "published": true
          },
          {
            "os_version": "7.6",
            "display_name": "7.6",
            "published": true
          },
          {
            "os_version": "8.2",
            "display_name": "8.2",
            "published": true
          }
        ]
      }
    ]
    

    Returns list of VM images and corresponding versions for the platform Compute section.

    HTTP GET Request

    GET https://api.idcloudhost.com/v1/config/vm_images

    Get Plain OS images

    curl "https://api.idcloudhost.com/v1/config/vm_images/plain_os" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
      {
        "os_name": "almalinux",
        "display_name": "Almalinux",
        "ui_position": 1,
        "is_default": true,
        "is_app_catalog": false,
        "icon": "...",
        "versions": [
          {
            "os_version": "8",
            "display_name": "8",
            "published": true
          }
        ]
      }
    ]
    

    Returns list of plain Virtual Machines images and corresponding versions for the platform Compute section.

    HTTP GET Request

    GET https://api.idcloudhost.com/v1/config/vm_images/plain_os

    Get App Catalog images

    curl "https://api.idcloudhost.com/v1/config/vm_images/app_catalog" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
      {
        "os_name": "centos",
        "display_name": "Centos",
        "ui_position": 2,
        "is_default": false,
        "is_app_catalog": true,
        "icon": "....",
        "versions": [
          {
            "os_version": "7.3.1611",
            "display_name": "7.3.1611",
            "published": true
          },
          {
            "os_version": "7.6",
            "display_name": "7.6",
            "published": true
          },
          {
            "os_version": "8.2",
            "display_name": "8.2",
            "published": true
          }
        ]
      }
    ]
    

    Returns list of App Catalog images and corresponding versions for the platform Compute section.

    HTTP GET Request

    GET https://api.idcloudhost.com/v1/config/vm_images/app_catalog

    Billing

    List Billing Account's Resources

    curl "https://api.idcloudhost.com/v1/user-resource/billing_resources?id=6" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "backup": false,
            "billing_account": 6,
            "created_at": "2018-02-22 09:50:26",
            "description": "",
            "hostname": "hostname",
            "hypervisor_id": null,
            "id": 6,
            "mac": "52:54:00:d4:ba:a3",
            "memory": 2048,
            "name": "DEBUGXYZ-2-buntu",
            "os_name": "ubuntu",
            "os_version": "16.04",
            "private_ipv4": "",
            "public_ipv4": "80.64.107.54",
            "status": "running",
            "storage": [
                {
                    "created_at": "2018-02-22 09:50:37.638670",
                    "id": 4,
                    "name": "sda",
                    "pool": "default2",
                    "primary": true,
                    "public_ipv4": null,
                    "replica": [],
                    "shared": false,
                    "size": 20,
                    "type": "block",
                    "updated_at": null,
                    "user_id": 8,
                    "uuid": "e624e5cb-e0f9-4b59-8686-0a4c829027c6"
                }
            ],
            "tags": null,
            "updated_at": "2018-02-22 09:50:37",
            "user_id": 8,
            "username": "example",
            "uuid": "e624e5cb-e0f9-4b59-8686-0a4c829027c6",
            "vcpu": 2
        },
        {
            "backup": false,
            "billing_account": 6,
            "created_at": "2018-02-22 11:29:30",
            "description": "",
            "hostname": "hostname",
            "hypervisor_id": null,
            "id": 8,
            "mac": "52:54:00:20:e4:ac",
            "memory": 2048,
            "name": "Ubuntu-3-16-04",
            "os_name": "ubuntu",
            "os_version": "16.04",
            "private_ipv4": "",
            "public_ipv4": "80.64.107.52",
            "status": "running",
            "storage": [
                {
                    "created_at": "2018-02-22 11:29:41.098793",
                    "id": 6,
                    "name": "sda",
                    "pool": "default2",
                    "primary": true,
                    "public_ipv4": null,
                    "replica": [],
                    "shared": false,
                    "size": 20,
                    "type": "block",
                    "updated_at": null,
                    "user_id": 8,
                    "uuid": "dab38e6e-b5bf-41c5-9baa-be1f2ec47931"
                }
            ],
            "tags": null,
            "updated_at": "2018-02-22 11:29:41",
            "user_id": 8,
            "username": "example",
            "uuid": "dab38e6e-b5bf-41c5-9baa-be1f2ec47931",
            "vcpu": 2
        },
        {
            "backup": false,
            "billing_account": 6,
            "created_at": "2018-02-22 14:24:03",
            "description": "",
            "hostname": "hostname",
            "hypervisor_id": null,
            "id": 10,
            "mac": "52:54:00:a2:52:6a",
            "memory": 2048,
            "name": "Ubuntu-16-04",
            "os_name": "ubuntu",
            "os_version": "16.04",
            "private_ipv4": "",
            "public_ipv4": "80.64.107.50",
            "status": "running",
            "storage": [
                {
                    "created_at": "2018-02-22 14:24:13.766985",
                    "id": 8,
                    "name": "sda",
                    "pool": "default2",
                    "primary": true,
                    "public_ipv4": null,
                    "replica": [],
                    "shared": false,
                    "size": 20,
                    "type": "block",
                    "updated_at": null,
                    "user_id": 8,
                    "uuid": "fc880f74-cf03-4a7a-93da-74c506157023"
                }
            ],
            "tags": null,
            "updated_at": "2018-02-22 14:24:13",
            "user_id": 8,
            "username": "example",
            "uuid": "fc880f74-cf03-4a7a-93da-74c506157023",
            "vcpu": 2
        },
        {
            "backup": false,
            "billing_account": 6,
            "created_at": "2018-02-22 11:10:17",
            "description": "",
            "hostname": "hostname",
            "hypervisor_id": null,
            "id": 7,
            "mac": "52:54:00:6c:6a:ac",
            "memory": 2048,
            "name": "Ubuntu-16-04",
            "os_name": "ubuntu",
            "os_version": "16.04",
            "private_ipv4": "",
            "public_ipv4": null,
            "status": "running",
            "storage": [
                {
                    "created_at": "2018-02-22 11:10:37.793878",
                    "id": 5,
                    "name": "sda",
                    "pool": "default2",
                    "primary": true,
                    "public_ipv4": null,
                    "replica": [
                        {
                            "created_at": "2018-02-22 14:24:51.886326",
                            "id": 5,
                            "master_id": 5,
                            "master_uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a",
                            "pool": "",
                            "size": 60,
                            "type": "snapshot",
                            "updated_at": null,
                            "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a2018-02-22-14-24-32"
                        }
                    ],
                    "shared": false,
                    "size": 20,
                    "type": "block",
                    "updated_at": null,
                    "user_id": 8,
                    "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a"
                }
            ],
            "tags": null,
            "updated_at": "2018-02-22 14:24:14",
            "user_id": 8,
            "username": "example",
            "uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a",
            "vcpu": 2
        },
        {
            "backup": false,
            "billing_account": 6,
            "created_at": "2018-02-22 14:24:30",
            "description": "",
            "hostname": "hostname",
            "hypervisor_id": null,
            "id": 11,
            "mac": "52:54:00:59:44:d1",
            "memory": 2048,
            "name": "Name of the Clone",
            "os_name": "ubuntu",
            "os_version": "16.04",
            "private_ipv4": "",
            "public_ipv4": "80.64.107.49",
            "status": "running",
            "storage": [
                {
                    "created_at": "2018-02-22 14:24:30.312877",
                    "id": 9,
                    "name": "sda",
                    "pool": "default2",
                    "primary": true,
                    "public_ipv4": null,
                    "replica": [],
                    "shared": false,
                    "size": 20,
                    "type": "block",
                    "updated_at": null,
                    "user_id": 8,
                    "uuid": "d582f16a-013b-4a23-8463-c66bbbc96c43"
                }
            ],
            "tags": null,
            "updated_at": null,
            "user_id": 8,
            "username": "example",
            "uuid": "d582f16a-013b-4a23-8463-c66bbbc96c43",
            "vcpu": 2
        }
    ]
    

    #location-specific

    Get all resources actively associated with billing account

    HTTP Request

    GET https://api.idcloudhost.com/v1/user-resource/billing_resources

    Query Parameters

    Parameter Default Type
    id A Whole number
    resource_type vm Basic text / string value

    Set Resource Billing Conf

    curl "https://api.idcloudhost.com/v1/user-resource/resource_billing" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "billing_account_id=0" \
        -d "uuid=aaaaaaaa-0000-bbbb-1111-cccccccccccc"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "Error": "No such virtual machine exists. aaaaaaaa-0000-bbbb-1111-cccccccccccc"
        }
    }
    

    #location-specific

    Associate resource with billing account

    HTTP Request

    POST https://api.idcloudhost.com/v1/user-resource/resource_billing

    Form Parameters

    Parameter Default Type
    billing_account_id A Whole number
    resource_type vm Basic text / string value
    uuid A Universally Unique IDentifier

    Payment

    Delete billing account

    curl "https://api.idcloudhost.com/v1/payment/billing_account" \
        -H "apikey: meowmeowmeow" \
        -X DELETE \
        -d "billing_account_id=0"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "Error": "Provided billing account is incorrect."
        }
    }
    

    Delete a billing account.

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/payment/billing_account

    Form Parameters

    Parameter Default Type
    billing_account_id A Whole number

    Billing account details

    curl "https://api.idcloudhost.com/v1/payment/billing_account?billing_account_id=6" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    {
        "address_line1": "Puiestee",
        "can_pay": true,
        "city": "K\u00fcla",
        "company_name": "Firma",
        "company_reg_code": "232",
        "company_vat_number": "235235",
        "country": "EE",
        "county": "Moldaavia",
        "created": 1519219377,
        "credit_amount": 2.0,
        "discount_percentage": 0,
        "email": "user@example.com",
        "id": 6,
        "is_deleted": false,
        "paying_by_invoice": false,
        "post_index": "314243123",
        "primary_card": {
            "id": "pm_1FeGWfE0TT1OxJzqBulNx0KD",
            "expire_month": 12,
            "expire_year": 2034,
            "last4": "1111",
            "card_type": "visa",
            "card_holder": "user",
            "type": "creditcard",
            "processor_data": {
                "id": "pm_1FeGWfE0TT1OxJzqBulNx0KD",
                "object": "payment_method",
                "billing_details": {
                    "address": {
                        "city": null,
                        "country": null,
                        "line1": null,
                        "line2": null,
                        "postal_code": null,
                        "state": null
                    },
                    "email": null,
                    "name": "user",
                    "phone": null
                },
                "card": {
                    "brand": "visa",
                    "checks": {
                        "address_line1_check": null,
                        "address_postal_code_check": null,
                        "cvc_check": "pass"
                    },
                    "country": "US",
                    "exp_month": 12,
                    "exp_year": 2034,
                    "fingerprint": "10npANzhhIy41fnM",
                    "funding": "unknown",
                    "generated_from": null,
                    "last4": "1111",
                    "three_d_secure_usage": {
                        "supported": true
                    },
                    "wallet": null
                },
                "created": 1573631069,
                "customer": "cus_G4iqivJ6hBw24n",
                "livemode": false,
                "metadata": {},
                "type": "card"
            }
        },
        "referral_code": "REF3456",
        "running_totals": {
            "credit_amount": 2,
            "credit_available": 2.0,
            "discount_amount": 0,
            "ongoing": -1,
            "ongoing_negative_since": 1580994130,
            "subtotal": 3,
            "total": -1.2,
            "vat_tax": -0.2
        },
        "title": "konto",
        "unpaid_amount": 27.26,
        "user_id": 8,
        "vat_percentage": 20
    }
    

    Get billing account's detailed data.

    HTTP Request

    GET https://api.idcloudhost.com/v1/payment/billing_account

    Query Parameters

    Parameter Default Type
    billing_account_id A Whole number

    Update billing account

    curl "https://api.idcloudhost.com/v1/payment/billing_account" \
        -H "apikey: meowmeowmeow" \
        -X PUT \
        -d "billing_account_id=0"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "consumer::resource_forbidden": {
                "msg": "Consumer not allowed to access resource.",
                "subtype": "resource_forbidden",
                "type": "consumer"
            }
        }
    }
    

    Update billing account's data. All existing data fields that billing account already has, must be passed along also. Otherwise this data will be deleted (PS! e-mail field can't be deleted).

    HTTP Request

    PUT https://api.idcloudhost.com/v1/payment/billing_account

    Form Parameters

    Parameter Default Type
    billing_account_id A Whole number

    List billing accounts

    curl "https://api.idcloudhost.com/v1/payment/billing_account/list" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "address_line1": "Puiestee",
            "can_pay": true,
            "city": "K\u00fcla",
            "company_name": "Firma",
            "company_reg_code": "232",
            "company_vat_number": "235235",
            "country": "EE",
            "county": "Moldaavia",
            "created": 1519219377,
            "credit_amount": 2.0,
            "discount_percentage": 0,
            "email": "user@example.com",
            "id": 6,
            "is_deleted": false,
            "paying_by_invoice": false,
            "post_index": "314243123",
            "primary_card": {
                "id": "pm_1FeGWfE0TT1OxJzqBulNx0KD",
                "expire_month": 12,
                "expire_year": 2034,
                "last4": "1111",
                "card_type": "visa",
                "card_holder": "user",
                "type": "creditcard",
                "processor_data": {
                    "id": "pm_1FeGWfE0TT1OxJzqBulNx0KD",
                    "object": "payment_method",
                    "billing_details": {
                        "address": {
                            "city": null,
                            "country": null,
                            "line1": null,
                            "line2": null,
                            "postal_code": null,
                            "state": null
                        },
                        "email": null,
                        "name": "user",
                        "phone": null
                    },
                    "card": {
                        "brand": "visa",
                        "checks": {
                            "address_line1_check": null,
                            "address_postal_code_check": null,
                            "cvc_check": "pass"
                        },
                        "country": "US",
                        "exp_month": 12,
                        "exp_year": 2034,
                        "fingerprint": "10npANzhhIy41fnM",
                        "funding": "unknown",
                        "generated_from": null,
                        "last4": "1111",
                        "three_d_secure_usage": {
                            "supported": true
                        },
                        "wallet": null
                    },
                    "created": 1573631069,
                    "customer": "cus_G4iqivJ6hBw24n",
                    "livemode": false,
                    "metadata": {},
                    "type": "card"
                }
            },
            "running_totals": {
                "credit_amount": 0,
                "credit_available": 2.0,
                "discount_amount": 0,
                "ongoing": 0,
                "subtotal": 0,
                "total": 0,
                "vat_tax": 0
            },
            "title": "konto",
            "unpaid_amount": 0,
            "user_id": 8,
            "vat_percentage": 20
        },
        {
            "can_pay": false,
            "created": 1521728822,
            "credit_amount": 0,
            "discount_percentage": 0,
            "email": "val",
            "id": 129075,
            "is_deleted": false,
            "running_totals": {
                "credit_amount": 0,
                "credit_available": 0,
                "discount_amount": 0,
                "ongoing": 0,
                "subtotal": 0,
                "total": 0,
                "vat_tax": 0
            },
            "title": "val",
            "unpaid_amount": 0,
            "user_id": 8,
            "vat_percentage": 20
        }
    ]
    

    List billing accounts attached to user. Additionally 'show_shadow' attribute may be added (any value) to get also deleted accounts

    HTTP Request

    GET https://api.idcloudhost.com/v1/payment/billing_account/list

    Set default billing account

    curl "https://api.idcloudhost.com/v1/payment/billing_account/set_default" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "billing_account_id=129072"
    

    The above command returns JSON structured like this:

    {
        "success": true
    }
    

    Set billing account as default account.

    HTTP Request

    POST https://api.idcloudhost.com/v1/payment/billing_account/set_default

    Form Parameters

    Parameter Default Type
    billing_account_id A Whole number

    Get unpaid amount

    curl "https://api.idcloudhost.com/v1/payment/billing_account/unpaid_amount?billing_account_id=6" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    {
        "message": 59.96
    }
    

    Get billing account's unpaid total amount (with VAT included). This is unpaid amount of all invoices who's status is not 'paid'.

    HTTP Request

    GET https://api.idcloudhost.com/v1/payment/billing_account/unpaid_amount

    Query Parameters

    Parameter Default Type
    billing_account_id A Whole number

    Apply for invoice paying

    curl "https://api.idcloudhost.com/v1/payment/apply_for_invoice_payment" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "billing_account_id=6"
    

    The above command returns newly created payment object data in JSON structured like this:

    {
        "is_verified": False,
        "billing_account_id": 6,
        "identifier": "N/A",
        "additional_data": "{'type': 'paying_by_invoice', 'client': {}, 'card_type': 'By invoice', 'card_holder': 'user@example.com', 'expire_month': '12', 'id': 'N/A', 'expire_year': '2099'}",
        "billing_account_processor_identifier_id": 1,
        "is_primary": True,
        "valid_thru": 4102358400,
        "id": 1,
        "created": 1578582147,
        "is_deleted": False
    }
    

    Apply for 'paying by invoice' payment method. Billing account will then have a new payment object that uses 'invoice' payment method. Method will be in unverified state until admin verifies it.

    HTTP Request

    POST https://api.idcloudhost.com/v1/payment/apply_for_invoice_payment

    Query Parameters

    Parameter Default Type
    billing_account_id A Whole number

    Remove credit card

    curl "https://api.idcloudhost.com/v1/payment/card" \
        -H "apikey: meowmeowmeow" \
        -X DELETE \
        -d "payment_object_id=0"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "consumer::resource_forbidden": {
                "msg": "Consumer not allowed to access resource.",
                "subtype": "resource_forbidden",
                "type": "consumer"
            }
        }
    }
    

    Remove credit card.

    HTTP Request

    DELETE https://api.idcloudhost.com/v1/payment/card

    Form Parameters

    Parameter Default Type
    payment_object_id A Whole number

    Credit card details

    curl "https://api.idcloudhost.com/v1/payment/card?payment_object_id=6" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    {
        "additional_data": "{\"id\": \"pay_e566cf1e776c91857c5d55c0\", \"type\": \"creditcard\", \"client\": {\"id\": \"client_57b586239757f585c569\", \"email\": \"user@example.com\", \"description\": null, \"app_id\": null, \"updated_at\": 1507032614, \"created_at\": 1507032614, \"payment\": [\"pay_d2338c36103cd678b657c852\", \"pay_876184a6380bdb25b2a617c2\", \"pay_92572e33a6cf41be8a0ba811\", \"pay_ff5129221ed980d5ced974c3\", \"pay_f0da159c756fcdb8d2f8fa77\", \"pay_80f3731cff7b0157185a314a\", \"pay_948ede1174fa52d79e72b7a9\", \"pay_8c3735b74d9649d2f742e77a\", \"pay_44a5f1d83299ef5488e83b88\", \"pay_77c695e0c85c1a87046cf90d\", \"pay_e0e496b06f7c706ce9f2c21f\", \"pay_bd68fca53a2b7ce493e77f7b\", \"pay_2ecd6ea760e6d0b4b6604d5c\", \"pay_693029dd67472dec44d08320\", \"pay_bcd100532afcac9207c327c3\", \"pay_ea5613ace7154061d95ba76f\", \"pay_d72aa93d0143f1b8d7ffa119\", \"pay_caec3bf657e124e01de21411\", \"pay_ac3756da59891e9986371ae5\", \"pay_6838cf521becb9c290a22264\", \"pay_5344aeabbf04ef507df2d545\", \"pay_1ef76358a95d797cf6741438\", \"pay_7662a834fa17f3dbc7ecced3\", \"pay_e566cf1e776c91857c5d55c0\"], \"subscription\": null}, \"card_type\": \"visa\", \"country\": \"DE\", \"expire_month\": \"12\", \"expire_year\": \"2029\", \"card_holder\": \"Inimene\", \"last4\": \"1111\", \"updated_at\": 1519219380, \"created_at\": 1519219378, \"app_id\": null, \"is_recurring\": true, \"is_usable_for_preauthorization\": true, \"code\": null, \"account\": null, \"holder\": null}",
        "billing_account_id": 6,
        "billing_account_processor_identifier_id": 6,
        "created": 1519219380,
        "id": 6,
        "identifier": "pay_e566cf1e776c91857c5d55c0",
        "is_primary": true,
        "is_verified": true,
        "valid_thru": 1893369600
    }
    

    Get payment method details.

    HTTP Request

    GET https://api.idcloudhost.com/v1/payment/card

    Query Parameters

    Parameter Default Type
    payment_object_id A Whole number

    Add credit card

    curl "https://api.idcloudhost.com/v1/payment/card" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "billing_account_id=0" \
        -d "token=val"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "consumer::resource_forbidden": {
                "msg": "Consumer not allowed to access resource.",
                "subtype": "resource_forbidden",
                "type": "consumer"
            }
        }
    }
    

    Add new credit card. Possible to add primary and secodary (failover) card.

    Steps involved when add a new card: - attach payment object to the billing account (credit card) - check payment object validity

    HTTP Request

    POST https://api.idcloudhost.com/v1/payment/card

    Form Parameters

    Parameter Default Type
    billing_account_id A Whole number
    token Basic text / string value

    List credit cards

    curl "https://api.idcloudhost.com/v1/payment/card/list?billing_account_id=6" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "additional_data": "{\"id\": \"pay_e566cf1e776c91857c5d55c0\", \"type\": \"creditcard\", \"client\": {\"id\": \"client_57b586239757f585c569\", \"email\": \"user@example.com\", \"description\": null, \"app_id\": null, \"updated_at\": 1507032614, \"created_at\": 1507032614, \"payment\": [\"pay_d2338c36103cd678b657c852\", \"pay_876184a6380bdb25b2a617c2\", \"pay_92572e33a6cf41be8a0ba811\", \"pay_ff5129221ed980d5ced974c3\", \"pay_f0da159c756fcdb8d2f8fa77\", \"pay_80f3731cff7b0157185a314a\", \"pay_948ede1174fa52d79e72b7a9\", \"pay_8c3735b74d9649d2f742e77a\", \"pay_44a5f1d83299ef5488e83b88\", \"pay_77c695e0c85c1a87046cf90d\", \"pay_e0e496b06f7c706ce9f2c21f\", \"pay_bd68fca53a2b7ce493e77f7b\", \"pay_2ecd6ea760e6d0b4b6604d5c\", \"pay_693029dd67472dec44d08320\", \"pay_bcd100532afcac9207c327c3\", \"pay_ea5613ace7154061d95ba76f\", \"pay_d72aa93d0143f1b8d7ffa119\", \"pay_caec3bf657e124e01de21411\", \"pay_ac3756da59891e9986371ae5\", \"pay_6838cf521becb9c290a22264\", \"pay_5344aeabbf04ef507df2d545\", \"pay_1ef76358a95d797cf6741438\", \"pay_7662a834fa17f3dbc7ecced3\", \"pay_e566cf1e776c91857c5d55c0\"], \"subscription\": null}, \"card_type\": \"visa\", \"country\": \"DE\", \"expire_month\": \"12\", \"expire_year\": \"2029\", \"card_holder\": \"Inimene\", \"last4\": \"1111\", \"updated_at\": 1519219380, \"created_at\": 1519219378, \"app_id\": null, \"is_recurring\": true, \"is_usable_for_preauthorization\": true, \"code\": null, \"account\": null, \"holder\": null}",
            "billing_account_id": 6,
            "billing_account_processor_identifier_id": 6,
            "created": 1519219380,
            "id": 6,
            "identifier": "pay_e566cf1e776c91857c5d55c0",
            "is_primary": true,
            "is_verified": true,
            "valid_thru": 1893369600
        }
    ]
    

    Get list of credit cards attached to billing account.

    HTTP Request

    GET https://api.idcloudhost.com/v1/payment/card/list

    Query Parameters

    Parameter Default Type
    billing_account_id A Whole number

    Set card as primary

    curl "https://api.idcloudhost.com/v1/payment/card/set_primary" \
        -H "apikey: meowmeowmeow" \
        -X PUT \
        -d "payment_object_id=6"
    

    The above command returns JSON structured like this:

    {
        "success": true
    }
    

    Set credit card specified by id as 'primary'. Throws exception if specified card is not validated. Unmarks previous 'primary' card.

    HTTP Request

    PUT https://api.idcloudhost.com/v1/payment/card/set_primary

    Form Parameters

    Parameter Default Type
    payment_object_id A Whole number

    List credit

    curl "https://api.idcloudhost.com/v1/payment/credit/list?billing_account_id=6" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "amount": -3.44,
            "billing_account_id": 129072,
            "created": 1543627933,
            "description": "Invoice payment",
            "id": 32
        },
        {
            "amount": -0.15,
            "billing_account_id": 129072,
            "created": 1539162090,
            "description": "Invoice payment",
            "id": 21
        },
        {
            "amount": -2.64,
            "billing_account_id": 129072,
            "created": 1539092800,
            "description": "Invoice payment",
            "id": 20
        },
        {
            "amount": -3.77,
            "billing_account_id": 129072,
            "created": 1538357520,
            "description": "Invoice payment",
            "id": 12
        },
        {
            "amount": 10.0,
            "billing_account_id": 129072,
            "created": 1537363992,
            "description": "First billing account",
            "id": 1
        }
    ]
    

    Show data about billing account's credit amount and individual records.

    HTTP Request

    GET https://api.idcloudhost.com/v1/payment/credit/list

    Form Parameters

    Parameter Default Type
    billing_account_id A Whole number

    Buy credit

    curl "https://api.idcloudhost.com/v1/credit/buy" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "billing_account_id=1"
        -d "payment_object_id=5"
        -d "amount=100.00"
    

    The above command returns JSON structured like this:

    {
        "success": true
    }
    

    Buy credit for a billing account, using specified credit card.

    HTTP Request

    POST https://api.idcloudhost.com/v1/payment/credit/buy

    Query Parameters

    Parameter Default Type
    billing_account_id A Whole number
    payment_object_id A Whole number
    amount Decimal number

    Request invoice for credit top up

    curl "https://api.idcloudhost.com/v1/credit/request_invoice" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "billing_account_id=1"
        -d "amount=100.00"
    

    The above command returns JSON structured like this:

    {
        "success": true
    }
    

    Request invoice for credit top up using manual bank transfer. Invoice will be generated with specified amount and sent to billing account's e-mail address.

    HTTP Request

    POST https://api.idcloudhost.com/v1/payment/credit/request_invoice

    Query Parameters

    Parameter Default Type
    billing_account_id A Whole number
    amount Decimal number

    Invoice details

    curl "https://api.idcloudhost.com/v1/payment/invoice?invoice_id=1" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    {
        "account_snapshot": "{\"address_line1\": \"Puiestee\", \"address_line2\": null, \"city\": \"K\\u00fcla\", \"company_name\": \"Firma\", \"company_reg_code\": \"232\", \"company_vat_number\": \"235235\", \"country\": \"EE\", \"county\": \"Moldaavia\", \"created\": 1519219377, \"credit_amount\": 0, \"email\": \"user@example.com\", \"id\": 6, \"is_deleted\": false, \"post_index\": \"314243123\", \"title\": \"konto\", \"user_id\": 8}",
        "billing_account_id": 6,
        "created": 1519309247,
        "discount_percentage": 10,
        "due_date": 1520432447,
        "id": 1,
        "padded_id": "001",
        "period_end": 1519862400,
        "period_start": 1517443200,
        "records_list": [
            {
                "amount": 0.02602,
                "created": 1519309247,
                "descr": "TODO",
                "id": 1,
                "invoice_id": 1,
                "item_price": 0.02602,
                "name": "DEBUGXYZ-buntu, 2 CPUs, 2 GB RAM, null GB disk",
                "qty": 1,
                "qty_unit": "h"
            },
            {
                "amount": 0.87927,
                "created": 1519309247,
                "descr": "TODO",
                "id": 2,
                "invoice_id": 1,
                "item_price": 0.04187,
                "name": "buntu-b-Parool123, 4 CPUs, 1 GB RAM, 30 GB disk",
                "qty": 21,
                "qty_unit": "h"
            },
            {
                "amount": 0.08646,
                "created": 1519309247,
                "descr": "TODO",
                "id": 3,
                "invoice_id": 1,
                "item_price": 0.02882,
                "name": "Ubuntu-3-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
                "qty": 3,
                "qty_unit": "h"
            },
            {
                "amount": 0.1441,
                "created": 1519309247,
                "descr": "TODO",
                "id": 4,
                "invoice_id": 1,
                "item_price": 0.02882,
                "name": "DEBUGXYZ-2-buntu, 2 CPUs, 2 GB RAM, 20 GB disk",
                "qty": 5,
                "qty_unit": "h"
            },
            {
                "amount": 0.08646,
                "created": 1519309247,
                "descr": "TODO",
                "id": 5,
                "invoice_id": 1,
                "item_price": 0.02882,
                "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
                "qty": 3,
                "qty_unit": "h"
            }
        ],
        "status": 10,
        "totals": {
            "subtotal": 1.23,
            "discount_amount": 0.12,
            "credit": -0.10,
            "vat_tax": 0.2,
            "total": 1.21
        },
        "transaction_list": [
            {
                "additional_data": "{\"id\": \"tran_707a24d54b2432688c2e2a68b12a\", \"amount\": 147, \"origin_amount\": 147, \"status\": \"closed\", \"description\": \"Pay reminder for invoice #1: 'Invoice <nr>'\", \"livemode\": false, \"refunds\": null, \"client\": {\"id\": \"client_57b586239757f585c569\", \"email\": \"user@example.com\", \"description\": null, \"app_id\": null, \"updated_at\": 1507032614, \"created_at\": 1507032614, \"payment\": [\"pay_d2338c36103cd678b657c852\", \"pay_876184a6380bdb25b2a617c2\", \"pay_92572e33a6cf41be8a0ba811\", \"pay_ff5129221ed980d5ced974c3\", \"pay_f0da159c756fcdb8d2f8fa77\", \"pay_80f3731cff7b0157185a314a\", \"pay_948ede1174fa52d79e72b7a9\", \"pay_8c3735b74d9649d2f742e77a\", \"pay_44a5f1d83299ef5488e83b88\", \"pay_77c695e0c85c1a87046cf90d\", \"pay_e0e496b06f7c706ce9f2c21f\", \"pay_bd68fca53a2b7ce493e77f7b\", \"pay_2ecd6ea760e6d0b4b6604d5c\", \"pay_693029dd67472dec44d08320\", \"pay_bcd100532afcac9207c327c3\", \"pay_ea5613ace7154061d95ba76f\", \"pay_d72aa93d0143f1b8d7ffa119\", \"pay_caec3bf657e124e01de21411\", \"pay_ac3756da59891e9986371ae5\", \"pay_6838cf521becb9c290a22264\", \"pay_5344aeabbf04ef507df2d545\", \"pay_1ef76358a95d797cf6741438\", \"pay_7662a834fa17f3dbc7ecced3\", \"pay_e566cf1e776c91857c5d55c0\", \"pay_c4c936c9bbbe12d9e481cad5\"], \"subscription\": null}, \"currency\": \"EUR\", \"created_at\": 1519309499, \"updated_at\": 1519309499, \"response_code\": 20000, \"short_id\": \"0000.9999.0000\", \"is_fraud\": false, \"invoices\": [], \"app_id\": null, \"preauthorization\": null, \"fees\": [], \"payment\": {\"id\": \"pay_e566cf1e776c91857c5d55c0\", \"type\": \"creditcard\", \"client\": \"client_57b586239757f585c569\", \"card_type\": \"visa\", \"country\": \"DE\", \"expire_month\": \"12\", \"expire_year\": \"2029\", \"card_holder\": \"Inimene\", \"last4\": \"1111\", \"updated_at\": 1519219380, \"created_at\": 1519219378, \"app_id\": null, \"is_recurring\": true, \"is_usable_for_preauthorization\": true, \"code\": null, \"account\": null, \"holder\": null}, \"mandate_reference\": null, \"is_refundable\": true, \"is_markable_as_fraud\": true}",
                "amount": 1.21,
                "created": 1519309499,
                "id": 1,
                "identifier": "tran_707a24d54b2432688c2e2a68b12a",
                "payment_object_id": 6
            }
        ],
        "vat_percentage": 20
    }
    

    Get invoice details.

    Invoice Status Code Description
    5 Unpaid
    10 Paid

    HTTP Request

    GET https://api.idcloudhost.com/v1/payment/invoice

    Query Parameters

    Parameter Default Type
    invoice_id A Whole number

    List invoices

    curl "https://api.idcloudhost.com/v1/payment/invoice/list?billing_account_id=6" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "account_snapshot": "{\"address_line1\": \"Puiestee\", \"address_line2\": null, \"city\": \"K\\u00fcla\", \"company_name\": \"Firma\", \"company_reg_code\": \"232\", \"company_vat_number\": \"235235\", \"country\": \"EE\", \"county\": \"Moldaavia\", \"created\": 1519219377, \"credit_amount\": 0, \"email\": \"user@example.com\", \"id\": 6, \"is_deleted\": false, \"post_index\": \"314243123\", \"title\": \"konto\", \"user_id\": 8}",
            "billing_account_id": 6,
            "created": 1520341071,
            "discount_percentage": 0,
            "due_date": 1521541071,
            "id": 3782543,
            "padded_id": "003782543",
            "period_end": 1522540800,
            "period_start": 1519862400,
            "records_list": [
                {
                    "amount": 0.3696,
                    "created": 1520341071,
                    "descr": "TODO",
                    "id": 67,
                    "invoice_id": 3782543,
                    "item_price": 0.0028,
                    "name": "Name of the Clone, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 132,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.3696,
                    "created": 1520341071,
                    "descr": "TODO",
                    "id": 68,
                    "invoice_id": 3782543,
                    "item_price": 0.0028,
                    "name": "Ubuntu-3-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 132,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.3696,
                    "created": 1520341071,
                    "descr": "TODO",
                    "id": 69,
                    "invoice_id": 3782543,
                    "item_price": 0.0028,
                    "name": "DEBUGXYZ-2-buntu, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 132,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.3696,
                    "created": 1520341071,
                    "descr": "TODO",
                    "id": 70,
                    "invoice_id": 3782543,
                    "item_price": 0.0028,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 132,
                    "qty_unit": "h"
                },
                {
                    "amount": 1.1088,
                    "created": 1520341071,
                    "descr": "TODO",
                    "id": 71,
                    "invoice_id": 3782543,
                    "item_price": 0.0084,
                    "name": "Ubuntu-16-04, snapshots",
                    "qty": 132,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.3696,
                    "created": 1520341071,
                    "descr": "TODO",
                    "id": 72,
                    "invoice_id": 3782543,
                    "item_price": 0.0028,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 132,
                    "qty_unit": "h"
                }
            ],
            "status": 5,
            "totals": {
                "subtotal": 2.96,
                "discount_amount": 0.0,
                "credit": 0.0,
                "vat_tax": 0.59,
                "total": 3.55
            },
            "transaction_list": [],
            "vat_percentage": 20
        },
        {
            "account_snapshot": "{\"address_line1\": \"Puiestee\", \"address_line2\": null, \"city\": \"K\\u00fcla\", \"company_name\": \"Firma\", \"company_reg_code\": \"232\", \"company_vat_number\": \"235235\", \"country\": \"EE\", \"county\": \"Moldaavia\", \"created\": 1519219377, \"credit_amount\": 0, \"email\": \"user@example.com\", \"id\": 6, \"is_deleted\": false, \"post_index\": \"314243123\", \"title\": \"konto\", \"user_id\": 8}",
            "billing_account_id": 6,
            "created": 1520341040,
            "discount_percentage": 0,
            "due_date": 1521541040,
            "id": 3782542,
            "padded_id": "003782542",
            "period_end": 1519862400,
            "period_start": 1517443200,
            "records_list": [
                {
                    "amount": 0.02602,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 54,
                    "invoice_id": 3782542,
                    "item_price": 0.02602,
                    "name": "DEBUGXYZ-buntu, 2 CPUs, 2 GB RAM, null GB disk",
                    "qty": 1,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.87927,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 55,
                    "invoice_id": 3782542,
                    "item_price": 0.04187,
                    "name": "buntu-b-Parool123, 4 CPUs, 1 GB RAM, 30 GB disk",
                    "qty": 21,
                    "qty_unit": "h"
                },
                {
                    "amount": 4.0348,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 56,
                    "invoice_id": 3782542,
                    "item_price": 0.02882,
                    "name": "Name of the Clone, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 140,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.0392,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 57,
                    "invoice_id": 3782542,
                    "item_price": 0.0028,
                    "name": "Name of the Clone, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 14,
                    "qty_unit": "h"
                },
                {
                    "amount": 4.12126,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 58,
                    "invoice_id": 3782542,
                    "item_price": 0.02882,
                    "name": "Ubuntu-3-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 143,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.0392,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 59,
                    "invoice_id": 3782542,
                    "item_price": 0.0028,
                    "name": "Ubuntu-3-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 14,
                    "qty_unit": "h"
                },
                {
                    "amount": 4.1789,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 60,
                    "invoice_id": 3782542,
                    "item_price": 0.02882,
                    "name": "DEBUGXYZ-2-buntu, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 145,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.0392,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 61,
                    "invoice_id": 3782542,
                    "item_price": 0.0028,
                    "name": "DEBUGXYZ-2-buntu, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 14,
                    "qty_unit": "h"
                },
                {
                    "amount": 4.12126,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 62,
                    "invoice_id": 3782542,
                    "item_price": 0.02882,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 143,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.0392,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 63,
                    "invoice_id": 3782542,
                    "item_price": 0.0028,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 14,
                    "qty_unit": "h"
                },
                {
                    "amount": 1.2936,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 64,
                    "invoice_id": 3782542,
                    "item_price": 0.0084,
                    "name": "Ubuntu-16-04, snapshots",
                    "qty": 154,
                    "qty_unit": "h"
                },
                {
                    "amount": 4.0348,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 65,
                    "invoice_id": 3782542,
                    "item_price": 0.02882,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 140,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.0392,
                    "created": 1520341040,
                    "descr": "TODO",
                    "id": 66,
                    "invoice_id": 3782542,
                    "item_price": 0.0028,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 14,
                    "qty_unit": "h"
                }
            ],
            "status": 5,
            "totals": {
                "subtotal": 22.89,
                "discount_amount": 0.0,
                "credit": 0.0,
                "vat_tax": 4.58,
                "total": 27.47
            },
            "transaction_list": [],
            "vat_percentage": 20
        },
        {
            "account_snapshot": "{\"address_line1\": \"Puiestee\", \"address_line2\": null, \"city\": \"K\\u00fcla\", \"company_name\": \"Firma\", \"company_reg_code\": \"232\", \"company_vat_number\": \"235235\", \"country\": \"EE\", \"county\": \"Moldaavia\", \"created\": 1519219377, \"credit_amount\": 0, \"email\": \"user@example.com\", \"id\": 6, \"is_deleted\": false, \"post_index\": \"314243123\", \"title\": \"konto\", \"user_id\": 8}",
            "billing_account_id": 6,
            "created": 1520241350,
            "discount_percentage": 0,
            "due_date": 1521441350,
            "id": 3782541,
            "name": "Invoice",
            "padded_id": "003782541",
            "period_end": 1522540800,
            "period_start": 1519862400,
            "records_list": [
                {
                    "amount": 0.294,
                    "created": 1520241350,
                    "descr": "TODO",
                    "id": 48,
                    "invoice_id": 3782541,
                    "item_price": 0.0028,
                    "name": "Name of the Clone, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 105,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.294,
                    "created": 1520241350,
                    "descr": "TODO",
                    "id": 49,
                    "invoice_id": 3782541,
                    "item_price": 0.0028,
                    "name": "Ubuntu-3-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 105,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.294,
                    "created": 1520241350,
                    "descr": "TODO",
                    "id": 50,
                    "invoice_id": 3782541,
                    "item_price": 0.0028,
                    "name": "DEBUGXYZ-2-buntu, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 105,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.294,
                    "created": 1520241350,
                    "descr": "TODO",
                    "id": 51,
                    "invoice_id": 3782541,
                    "item_price": 0.0028,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 105,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.882,
                    "created": 1520241350,
                    "descr": "TODO",
                    "id": 52,
                    "invoice_id": 3782541,
                    "item_price": 0.0084,
                    "name": "Ubuntu-16-04, snapshots",
                    "qty": 105,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.294,
                    "created": 1520241350,
                    "descr": "TODO",
                    "id": 53,
                    "invoice_id": 3782541,
                    "item_price": 0.0028,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 105,
                    "qty_unit": "h"
                }
            ],
            "status": 5,
            "totals": {
                "subtotal": 2.36,
                "discount_amount": 0.0,
                "credit": 0.0,
                "vat_tax": 0.47,
                "total": 2.83
            },
            "transaction_list": [],
            "vat_percentage": 20
        },
        {
            "account_snapshot": "{\"address_line1\": \"Puiestee\", \"address_line2\": null, \"city\": \"K\\u00fcla\", \"company_name\": \"Firma\", \"company_reg_code\": \"232\", \"company_vat_number\": \"235235\", \"country\": \"EE\", \"county\": \"Moldaavia\", \"created\": 1519219377, \"credit_amount\": 0, \"email\": \"user@example.com\", \"id\": 6, \"is_deleted\": false, \"post_index\": \"314243123\", \"title\": \"konto\", \"user_id\": 8}",
            "billing_account_id": 6,
            "created": 1519867923,
            "discount_percentage": 0,
            "due_date": 1521067923,
            "id": 6,
            "name": "Invoice <nr>",
            "padded_id": "006",
            "period_end": 1519862400,
            "period_start": 1517443200,
            "records_list": [
                {
                    "amount": 4.0348,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 16,
                    "invoice_id": 6,
                    "item_price": 0.02882,
                    "name": "Name of the Clone, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 140,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.0392,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 17,
                    "invoice_id": 6,
                    "item_price": 0.0028,
                    "name": "Name of the Clone, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 14,
                    "qty_unit": "h"
                },
                {
                    "amount": 4.0348,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 18,
                    "invoice_id": 6,
                    "item_price": 0.02882,
                    "name": "Ubuntu-3-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 140,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.0392,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 19,
                    "invoice_id": 6,
                    "item_price": 0.0028,
                    "name": "Ubuntu-3-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 14,
                    "qty_unit": "h"
                },
                {
                    "amount": 4.0348,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 20,
                    "invoice_id": 6,
                    "item_price": 0.02882,
                    "name": "DEBUGXYZ-2-buntu, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 140,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.0392,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 21,
                    "invoice_id": 6,
                    "item_price": 0.0028,
                    "name": "DEBUGXYZ-2-buntu, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 14,
                    "qty_unit": "h"
                },
                {
                    "amount": 4.12126,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 22,
                    "invoice_id": 6,
                    "item_price": 0.02882,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 143,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.0392,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 23,
                    "invoice_id": 6,
                    "item_price": 0.0028,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 14,
                    "qty_unit": "h"
                },
                {
                    "amount": 1.2936,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 24,
                    "invoice_id": 6,
                    "item_price": 0.0084,
                    "name": "Ubuntu-16-04, snapshots",
                    "qty": 154,
                    "qty_unit": "h"
                },
                {
                    "amount": 4.0348,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 25,
                    "invoice_id": 6,
                    "item_price": 0.02882,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 140,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.0392,
                    "created": 1519867923,
                    "descr": "TODO",
                    "id": 26,
                    "invoice_id": 6,
                    "item_price": 0.0028,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk, stopped",
                    "qty": 14,
                    "qty_unit": "h"
                }
            ],
            "status": 5,
            "totals": {
                "subtotal": 21.76,
                "discount_amount": 0.0,
                "credit": 0.0,
                "vat_tax": 4.35,
                "total": 26.11
            },
            "transaction_list": [],
            "vat_percentage": 20
        },
        {
            "account_snapshot": "{\"address_line1\": \"Puiestee\", \"address_line2\": null, \"city\": \"K\\u00fcla\", \"company_name\": \"Firma\", \"company_reg_code\": \"232\", \"company_vat_number\": \"235235\", \"country\": \"EE\", \"county\": \"Moldaavia\", \"created\": 1519219377, \"credit_amount\": 0, \"email\": \"user@example.com\", \"id\": 6, \"is_deleted\": false, \"post_index\": \"314243123\", \"title\": \"konto\", \"user_id\": 8}",
            "billing_account_id": 6,
            "created": 1519309247,
            "discount_percentage": 0,
            "due_date": 1520509247,
            "id": 1,
            "name": "Invoice <nr>",
            "padded_id": "001",
            "period_end": 1519862400,
            "period_start": 1517443200,
            "records_list": [
                {
                    "amount": 0.02602,
                    "created": 1519309247,
                    "descr": "TODO",
                    "id": 1,
                    "invoice_id": 1,
                    "item_price": 0.02602,
                    "name": "DEBUGXYZ-buntu, 2 CPUs, 2 GB RAM, null GB disk",
                    "qty": 1,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.87927,
                    "created": 1519309247,
                    "descr": "TODO",
                    "id": 2,
                    "invoice_id": 1,
                    "item_price": 0.04187,
                    "name": "buntu-b-Parool123, 4 CPUs, 1 GB RAM, 30 GB disk",
                    "qty": 21,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.08646,
                    "created": 1519309247,
                    "descr": "TODO",
                    "id": 3,
                    "invoice_id": 1,
                    "item_price": 0.02882,
                    "name": "Ubuntu-3-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 3,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.1441,
                    "created": 1519309247,
                    "descr": "TODO",
                    "id": 4,
                    "invoice_id": 1,
                    "item_price": 0.02882,
                    "name": "DEBUGXYZ-2-buntu, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 5,
                    "qty_unit": "h"
                },
                {
                    "amount": 0.08646,
                    "created": 1519309247,
                    "descr": "TODO",
                    "id": 5,
                    "invoice_id": 1,
                    "item_price": 0.02882,
                    "name": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
                    "qty": 3,
                    "qty_unit": "h"
                }
            ],
            "status": 10,
            "totals": {
                "subtotal": 1.23,
                "discount_amount": 0.0,
                "credit": 0.0,
                "vat_tax": 0.25,
                "total": 1.48
            },
            "transaction_list": [
                {
                    "additional_data": "{\"id\": \"tran_707a24d54b2432688c2e2a68b12a\", \"amount\": 147, \"origin_amount\": 147, \"status\": \"closed\", \"description\": \"Pay reminder for invoice #1: 'Invoice <nr>'\", \"livemode\": false, \"refunds\": null, \"client\": {\"id\": \"client_57b586239757f585c569\", \"email\": \"user@example.com\", \"description\": null, \"app_id\": null, \"updated_at\": 1507032614, \"created_at\": 1507032614, \"payment\": [\"pay_d2338c36103cd678b657c852\", \"pay_876184a6380bdb25b2a617c2\", \"pay_92572e33a6cf41be8a0ba811\", \"pay_ff5129221ed980d5ced974c3\", \"pay_f0da159c756fcdb8d2f8fa77\", \"pay_80f3731cff7b0157185a314a\", \"pay_948ede1174fa52d79e72b7a9\", \"pay_8c3735b74d9649d2f742e77a\", \"pay_44a5f1d83299ef5488e83b88\", \"pay_77c695e0c85c1a87046cf90d\", \"pay_e0e496b06f7c706ce9f2c21f\", \"pay_bd68fca53a2b7ce493e77f7b\", \"pay_2ecd6ea760e6d0b4b6604d5c\", \"pay_693029dd67472dec44d08320\", \"pay_bcd100532afcac9207c327c3\", \"pay_ea5613ace7154061d95ba76f\", \"pay_d72aa93d0143f1b8d7ffa119\", \"pay_caec3bf657e124e01de21411\", \"pay_ac3756da59891e9986371ae5\", \"pay_6838cf521becb9c290a22264\", \"pay_5344aeabbf04ef507df2d545\", \"pay_1ef76358a95d797cf6741438\", \"pay_7662a834fa17f3dbc7ecced3\", \"pay_e566cf1e776c91857c5d55c0\", \"pay_c4c936c9bbbe12d9e481cad5\"], \"subscription\": null}, \"currency\": \"EUR\", \"created_at\": 1519309499, \"updated_at\": 1519309499, \"response_code\": 20000, \"short_id\": \"0000.9999.0000\", \"is_fraud\": false, \"invoices\": [], \"app_id\": null, \"preauthorization\": null, \"fees\": [], \"payment\": {\"id\": \"pay_e566cf1e776c91857c5d55c0\", \"type\": \"creditcard\", \"client\": \"client_57b586239757f585c569\", \"card_type\": \"visa\", \"country\": \"DE\", \"expire_month\": \"12\", \"expire_year\": \"2029\", \"card_holder\": \"Inimene\", \"last4\": \"1111\", \"updated_at\": 1519219380, \"created_at\": 1519219378, \"app_id\": null, \"is_recurring\": true, \"is_usable_for_preauthorization\": true, \"code\": null, \"account\": null, \"holder\": null}, \"mandate_reference\": null, \"is_refundable\": true, \"is_markable_as_fraud\": true}",
                    "amount": 1.48,
                    "created": 1519309499,
                    "id": 1,
                    "identifier": "tran_707a24d54b2432688c2e2a68b12a",
                    "payment_object_id": 6
                }
            ],
            "vat_percentage": 20
        }
    ]
    

    List billing account's invoices.

    HTTP Request

    GET https://api.idcloudhost.com/v1/payment/invoice/list

    Query Parameters

    Parameter Default Type
    billing_account_id A Whole number

    Pay all

    curl "https://api.idcloudhost.com/v1/payment/pay_all" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "billing_account_id=0"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "consumer::resource_forbidden": {
                "msg": "Consumer not allowed to access resource.",
                "subtype": "resource_forbidden",
                "type": "consumer"
            }
        }
    }
    

    Pay all billing account's unpaid invoices. Pays oldest invoices first.

    HTTP Request

    POST https://api.idcloudhost.com/v1/payment/pay_all

    Form Parameters

    Parameter Default Type
    billing_account_id A Whole number

    Pay amount

    curl "https://api.idcloudhost.com/v1/payment/pay_amount" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "billing_account_id=6" \
        -d "amount=10"
    

    The above command returns JSON structured like this:

    {
        "amount_left": 0.0,
        "amount_used": 10.0,
        "error_log": "",
        "message": "All amount were used. Invoices (#6) were paid fully or partially.",
        "paid_invoices": [
            6
        ],
        "success": true
    }
    

    Pay the amount specified with parameters. Pays billing account's oldest unpaid invoices first.

    HTTP Request

    POST https://api.idcloudhost.com/v1/payment/pay_amount

    Form Parameters

    Parameter Default Type
    amount A decimal number
    billing_account_id A Whole number

    Pay invoice

    curl "https://api.idcloudhost.com/v1/payment/pay_invoice" \
        -H "apikey: meowmeowmeow" \
        -X POST \
        -d "invoice_id=0"
    

    The above command returns JSON structured like this:

    {
        "errors": {
            "consumer::resource_forbidden": {
                "msg": "Consumer not allowed to access resource.",
                "subtype": "resource_forbidden",
                "type": "consumer"
            }
        }
    }
    

    Pay invoice specified by id.

    HTTP Request

    POST https://api.idcloudhost.com/v1/payment/pay_invoice

    Form Parameters

    Parameter Default Type
    invoice_id A Whole number

    Pricing

    Pricing policy

    curl "https://api.idcloudhost.com/v1/pricing/policy" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    {
        "policy": [
            {
                "numCpus": 1,
                "policyId": 1001,
                "price": 0.00521,
                "resourceType": "CPU",
                "serviceNameUserFriendly": "1 CPU"
            },
            {
                "megsRam": 512,
                "policyId": 1010,
                "price": 0.001645,
                "resourceType": "RAM",
                "serviceNameUserFriendly": "0.5 GB RAM"
            },
            {
                "megsRam": 1024,
                "policyId": 1011,
                "price": 0.00329,
                "resourceType": "RAM",
                "serviceNameUserFriendly": "1 GB RAM"
            },
            {
                "policyId": 1021,
                "price": 3.42e-05,
                "resourceType": "STORAGE",
                "serviceNameInUptime": "backup",
                "serviceNameUserFriendly": "Backup"
            },
            {
                "policyId": 1022,
                "price": 0.0001,
                "resourceType": "STORAGE",
                "serviceNameInUptime": "snapshot",
                "serviceNameUserFriendly": "Snapshot"
            },
            {
                "policyId": 1023,
                "price": 0.0001,
                "resourceType": "STORAGE",
                "serviceNameInUptime": "main",
                "serviceNameUserFriendly": "Storage"
            },
            {
                "policyId": 1030,
                "price": 0.00548,
                "resourceType": "LICENSE",
                "serviceNameInUptime": "windows",
                "serviceNameUserFriendly": "Windows license per core per hour"
            },
            {
                "policyId": 1040,
                "price": 3.42e-05,
                "resourceType": "OBJECT_STORAGE",
                "serviceNameInUptime": "object_storage",
                "serviceNameUserFriendly": "Object storage per gigabyte per hour"
            }
        ]
    }
    

    Policy that describes how resources are priced.

    HTTP Request

    GET https://api.idcloudhost.com/v1/pricing/policy

    Charging

    Get Resource Usage

    curl "https://api.idcloudhost.com/v1/charging/usage?billing_account_id=6" \
        -H "apikey: meowmeowmeow" \
        -X GET
    

    The above command returns JSON structured like this:

    [
        {
            "billing_account_id": 6,
            "configurations": [
                {
                    "cpus": 2,
                    "disk_size_GB": 20,
                    "os_name": "ubuntu",
                    "ram_MB": 2048,
                    "vm_name": "Ubuntu-16-04"
                },
                {
                    "cpus": 2,
                    "disk_size_GB": null,
                    "os_name": null,
                    "ram_MB": 2048,
                    "vm_name": "Ubuntu-16-04"
                }
            ],
            "cost": 0.08646,
            "description": "Ubuntu-16-04, 2 CPUs, 2 GB RAM, 20 GB disk",
            "hours": 3.0,
            "owner_uuid": "f80b1d62-ffe4-43ef-9210-60f05445456a",
            "price": 0.02882,
            "price_unit": "h",
            "uptime_types": [
                "VM_COMPUTE",
                "VM_RUNNING",
                "MAIN_STORAGE"
            ],
            "user_id": 8
        }
    ]
    

    Resources, prices and costs for the specified billing account, for the current month.

    HTTP Request

    GET https://api.idcloudhost.com/v1/charging/usage

    Query Parameters

    Parameter Default Type
    billing_account_id integer