Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

API Essentials

API Key Generation

Autoscaling

Backups

Credit

DNS

Firewall Rules

Flex Cloud VM Control

Getting Started with Superb Flex Cloud

IP Addresses

Logs

Network Interfaces

Recipes

SSH Keys

Templates

Test Route

Troubleshooting API Issues

Viewing Activity Logs

Virtual Server Operating Systems

Virtual Servers

VS Disks

POST /virtual_machines/:virtual_machine_id/build 

Build or re-build a VM

Sections:

Request Parameters

template_id* - the ID of a template from which a VS should be built.

required_startup - set to 1 if you wish to start a VS after it is built. Otherwise set to 0.

 
Instead of virtual server ID (:virtual_machine_id) you may use virtual server identifier (:virtual_machine_identifier).

initial_root_password_encryption_key -  specify the password encryption passphrase

Response Parameters

On success response is 201 status and a newly created Virtual Machine Object

JSON Request example

 curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"virtual_machine":{"template_id":"1","required_startup":"1"}}' --url http://onapp.test/virtual_machines/:virtual_machine_id/build.json

JSON Response

 {
    "virtual_machine": {
        "add_to_marketplace": null,
        "admin_note": null,
        "allowed_hot_migrate": true,
        "allowed_swap": true,
        "booted": false,
        "built": false,
        "cores_per_socket": 0,
        "cpu_shares": 1,
        "cpu_sockets": null,
        "cpu_threads": null,
        "cpu_units": 10,
        "cpus": 1,
        "created_at": "2015-08-25T21:52:34+00:00",
        "customer_network_id": null,
        "deleted_at": null,
        "edge_server_type": null,
        "enable_autoscale": null,
        "enable_monitis": null,
        "firewall_notrack": false,
        "hostname": "zaza",
        "hypervisor_id": 12,
        "id": 502,
        "identifier": "abcde224e600fv",
        "initial_root_password_encrypted": false,
        "iso_id": null,
        "label": "zaza",
        "local_remote_access_ip_address": "192.168.0.1",
        "local_remote_access_port": null,
        "locked": true,
        "memory": 20000,
        "min_disk_size": 5,
        "note": null,
        "operating_system": "linux",
        "operating_system_distro": "lbva",
        "preferred_hvs": [
            11,
            12,
            5,
            10,
            4
        ],
        "recovery_mode": null,
        "remote_access_password": "password",
        "service_password": null,
        "state": "failed",
        "storage_server_type": null,
        "strict_virtual_machine_id": null,
        "suspended": false,
        "template_id": 10,
        "template_label": "Load Balancer Virtual Appliance",
        "updated_at": "2015-08-26T18:43:18+00:00",
        "user_id": 123,
        "vip": null,
        "xen_id": null,
        "ip_addresses": [
            {
                "ip_address": {
                    "address": "192.168.0.1",
                    "broadcast": "192.168.0.1",
                    "created_at": "2015-07-30T01:35:54+00:00",
                    "customer_network_id": null,
                    "disallowed_primary": false,
                    "gateway": "66.148.116.1",
                    "hypervisor_id": null,
                    "id": 1667,
                    "ip_address_pool_id": null,
                    "network_address": "192.168.0.1",
                    "network_id": 1,
                    "pxe": false,
                    "updated_at": "2015-08-25T21:52:34+00:00",
                    "user_id": null,
                    "free": false,
                    "netmask": "255.255.252.0"
                }
            }
        ],
        "monthly_bandwidth_used": "0",
        "total_disk_size": 26,
        "price_per_hour": 0.28557783000000003,
        "price_per_hour_powered_off": 0.007083389999999999,
        "support_incremental_backups": true,
        "cpu_priority": 1
    }
}

XML Request example

 curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<?xml version="1.0" encoding="UTF-8"?><virtual_machine><template_id>1</template_id><required_startup>1</required_startup></virtual_machine>' --url http://onapp.test/virtual_machines/:virtual_machine_id/build.xml

XML Response example

 
  • No labels