Add VS

Da Wiki Neen.
(Differenze fra le revisioni)
 
(25 revisioni intermedie di un utente non mostrate)
Riga 1: Riga 1:
 
+
<br>
POST /virtual_machines.xml
+
 
POST /virtual_machines.json  
+
POST /virtual_machines.xml POST /virtual_machines.json  
XML Request example
+
 
curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d  
+
'''XML Request example''' <br>
'<virtual_machine><template_id>8</neen.cloud.it><licensing_key></licensing_key><label>zaza</label><hostname>zaza</hostname><hypervisor_group_id>14</hypervisor_group_id><hypervisor_id>1</hypervisor_id><initial_root_password>ehgebhewvtwh</initial_root_password><memory>128</memory><cpus>1</cpus><cpu_shares>1</cpu_shares><data_store_group_primary_id>18</data_store_group_primary_id><primary_disk_size>5</primary_disk_size><primary_disk_min_iops>100</primary_disk_min_iops><data_store_group_swap_id>18</data_store_group_swap_id><swap_disk_size>1</swap_disk_size><swap_disk_min_iops>100</swap_disk_min_iops><primary_network_group_id>19</primary_network_group_id><selected_ip_address_id>386</selected_ip_address_id><rate_limit>1</rate_limit><required_ip_address_assignment>1</required_ip_address_assignment><required_automatic_backup>0</required_automatic_backup><required_virtual_machine_build>1</required_virtual_machine_build><required_virtual_machine_startup>1</required_virtual_machine_startup><type_of_format>ext4</type_of_format><enable_autoscale>0</enable_autoscale><custom_recipe_variables><custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled><recipe_ids type='array'><recipe_id>11</recipe_id></recipe_ids></custom_recipe_variable></custom_recipe_variables></virtual_machine>' --url http://neen.cloud.it/virtual_machines.xml
+
 

JSON Request example
+
<br>curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '&lt;virtual_machine&gt;&lt;template_id&gt;8&lt;/template_id&gt;&lt;licensing_key&gt;&lt;/licensing_key&gt;&lt;label&gt;zaza&lt;/label&gt;&lt;hostname&gt;zaza&lt;/hostname&gt;&lt;hypervisor_group_id&gt;14&lt;/hypervisor_group_id&gt;&lt;hypervisor_id&gt;1&lt;/hypervisor_id&gt;&lt;initial_root_password&gt;ehgebhewvtwh&lt;/initial_root_password&gt;&lt;memory&gt;128&lt;/memory&gt;&lt;cpus&gt;1&lt;/cpus&gt;&lt;cpu_shares&gt;1&lt;/cpu_shares&gt;&lt;data_store_group_primary_id&gt;18&lt;/data_store_group_primary_id&gt;&lt;primary_disk_size&gt;5&lt;/primary_disk_size&gt;&lt;primary_disk_min_iops&gt;100&lt;/primary_disk_min_iops&gt;&lt;data_store_group_swap_id&gt;18&lt;/data_store_group_swap_id&gt;&lt;swap_disk_size&gt;1&lt;/swap_disk_size&gt;&lt;swap_disk_min_iops&gt;100&lt;/swap_disk_min_iops&gt;&lt;primary_network_group_id&gt;19&lt;/primary_network_group_id&gt;&lt;selected_ip_address_id&gt;386&lt;/selected_ip_address_id&gt;&lt;rate_limit&gt;1&lt;/rate_limit&gt;&lt;required_ip_address_assignment&gt;1&lt;/required_ip_address_assignment&gt;&lt;required_automatic_backup&gt;0&lt;/required_automatic_backup&gt;&lt;required_virtual_machine_build&gt;1&lt;/required_virtual_machine_build&gt;&lt;required_virtual_machine_startup&gt;1&lt;/required_virtual_machine_startup&gt;&lt;type_of_format&gt;ext4&lt;/type_of_format&gt;&lt;enable_autoscale&gt;0&lt;/enable_autoscale&gt;&lt;custom_recipe_variables&gt;&lt;custom_recipe_variable&gt;&lt;name&gt;varname&lt;/name&gt;&lt;value&gt;value&lt;/value&gt;&lt;enabled&gt;1&lt;/enabled&gt;&lt;recipe_ids type='array'&gt;&lt;recipe_id&gt;11&lt;/recipe_id&gt;&lt;/recipe_ids&gt;&lt;/custom_recipe_variable&gt;&lt;/custom_recipe_variables&gt;&lt;/virtual_machine&gt;' --url http://cloud.neen.it/virtual_machines.xml  
curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"virtual_machine":{"template_id":"8", "licensing_key":"", "label":"zaza", "hostname":"zaza", "hypervisor_group_id":"14", "hypervisor_id":"1", "initial_root_password":"tyrhsghj657th", "memory":"128", "cpus":"1", "cpu_shares":"1", "data_store_group_primary_id":"18", "primary_disk_size":"5", "primary_disk_min_iops":"100", "data_store_group_swap_id":"18", "swap_disk_size":"1", "swap_disk_min_iops":"100", "primary_network_group_id":"19", "selected_ip_address_id":"386", "rate_limit":"1", "required_ip_address_assignment":"1", "required_automatic_backup":"0", "required_virtual_machine_build":"1", "required_virtual_machine_startup":"1", "type_of_format":"ext4", "enable_autoscale":"0","recipe_ids":["11"],"custom_recipe_variables":{"custom_recipe_variable":{"name":"varname","value":"var_value","enabled":"1"}}}}' --url http://neen.cloud.it/virtual_machines.json
+
 

The following parameters should be sent:
+
<br> <br>'''JSON Request example'''
memory* - amount of RAM assigned to the VS
+
 
cpus* - number of CPUs assigned to the VS
+
curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"virtual_machine":{"template_id":"8", "licensing_key":"", "label":"zaza", "hostname":"zaza", "hypervisor_group_id":"14", "hypervisor_id":"1", "initial_root_password":"tyrhsghj657th", "memory":"128", "cpus":"1", "cpu_shares":"1", "data_store_group_primary_id":"18", "primary_disk_size":"5", "primary_disk_min_iops":"100", "data_store_group_swap_id":"18", "swap_disk_size":"1", "swap_disk_min_iops":"100", "primary_network_group_id":"19", "selected_ip_address_id":"386", "rate_limit":"1", "required_ip_address_assignment":"1", "required_automatic_backup":"0", "required_virtual_machine_build":"1", "required_virtual_machine_startup":"1", "type_of_format":"ext4", "enable_autoscale":"0","recipe_ids":["11"],"custom_recipe_variables":{"custom_recipe_variable":{"name":"varname","value":"var_value","enabled":"1"}}}}' --url http://cloud.neen.it/virtual_machines.json  
cpu_shares* - required parameter. For KVM hypervisor the CPU priority value is always 100. For XEN, set a custom value. The default value for XEN is 1
+
 
hostname* - set the host name for this VS
+
<br> The following parameters should be sent:  
label* - user-friendly VS description
+
 
primary_disk_size* - set the disk space for this VS
+
*memory* - amount of RAM assigned to the VS  
swap_disk_size* - set swap space. There is no swap disk for Windows-based VSs
+
*cpus* - number of CPUs assigned to the VS  
primary_disk_min_iops - minimum number of  IO operations per second for primary disk (this is a SolidFire related parameter)
+
*cpu_shares* - required parameter. For KVM hypervisor the CPU priority value is always 100. For XEN, set a custom value. The default value for XEN is 1  
swap_disk_min_iops - minimum number of  IO operations per second for swap disk (this is a SolidFire related parameter)
+
*hostname* - set the host name for this VS  
type_of_format - type of filesystem - ext4. For Linux templates, you can choose ext4 file system instead of the ext3 default one
+
*label* - user-friendly VS description  
data_store_group_primary_id - set the ID of the data store zone to which this primary disk is allocated
+
*primary_disk_size* - set the disk space for this VS  
data_store_group_swap_id - set the ID of the data store zone to which this swap disk is allocated
+
*swap_disk_size* - set swap space. There is no swap disk for Windows-based VSs  
primary_network_id - the ID of the primary network. Optional parameter that can be used only if it is assigned to the network zone
+
*primary_disk_min_iops - minimum number of IO operations per second for primary disk (this is a SolidFire related parameter)  
primary_network_group_id - the ID of the primary network group. Optional parameter
+
*swap_disk_min_iops - minimum number of IO operations per second for swap disk (this is a SolidFire related parameter)  
required_automatic_backup - set 1 if you need automatic backups
+
*type_of_format - type of filesystem - ext4. For Linux templates, you can choose ext4 file system instead of the ext3 default one  
rate_limit - set max port speed. Optional parameter: if none set, the system sets port speed to unlimited
+
*data_store_group_primary_id - set the ID of the data store zone to which this primary disk is allocated  
required_virtual_machine_build * - set 1 to build VS automatically
+
*data_store_group_swap_id - set the ID of the data store zone to which this swap disk is allocated  
required_virtual_machine_startup - set 1 to start up the VS automatically, otherwise set 0 (default state is "1")
+
*primary_network_id - the ID of the primary network. Optional parameter that can be used only if it is assigned to the network zone  
required_ip_address_assignment* - set "1" if you want IP address to be assigned automatically after creation, otherwise set "0"
+
*primary_network_group_id - the ID of the primary network group. Optional parameter  
selected_ip_address_id - specify ID of an IP address to assign to this VS
+
*required_automatic_backup - set 1 if you need automatic backups  
admin_note - enter a brief comment for the VS. Optional parameter
+
*rate_limit - set max port speed. Optional parameter: if none set, the system sets port speed to unlimited  
note - a brief comment a user can add to a VS
+
*required_virtual_machine_build * - set 1 to build VS automatically  
template_id * - the ID of a template from which a VS should be built
+
*required_virtual_machine_startup - set 1 to start up the VS automatically, otherwise set 0 (default state is "1")  
licensing_server_id - the ID of a licensing server/template group – this parameter is for Windows XP/7 virtual machines only
+
*required_ip_address_assignment* - set "1" if you want IP address to be assigned automatically after creation, otherwise set "0"  
licensing_type - the type of a license: MAK, KMS or user own license. This parameter is for Windows XP/7 virtual machines only
+
*selected_ip_address_id - specify ID of an IP address to assign to this VS  
licensing_key - the key of a license. This parameter is for Windows XP/7 virtual machines only
+
*admin_note - enter a brief comment for the VS. Optional parameter  
hypervisor_group_id - the ID of the hypervisor zone in which the VS will be created. Optional: if no hypervisor zone is set, the VS will be built in any available hypervisor zone
+
*note - a brief comment a user can add to a VS  
hypervisor_id - the ID of a hypervisor where the VS will be built. Optional: if no hypervisor ID is specified, the VS will be built on the hypervisor with the least available RAM (but sufficient RAM for the VS)
+
*template_id * - the ID of a template from which a VS should be built  
initial_root_password - the root password for a VS. Optional, if none specified, the system will provide a random password. It can consist of 6-32 characters, letters [A-Za-z], digits [0-9], dash [ - ] and lower dash [ _ ]. You can use both lowercase and uppercase letters
+
*licensing_server_id - the ID of a licensing server/template group – this parameter is for Windows XP/7 virtual machines only  
initial_root_password_encryption_key - specify the password encryption passphrase
+
*licensing_type - the type of a license: MAK, KMS or user own license. This parameter is for Windows XP/7 virtual machines only  
recipe_ids - an array of recipe ID you want to run on the virtual server provisioning
+
*licensing_key - the key of a license. This parameter is for Windows XP/7 virtual machines only  
custom_variables - an array of custom variables with the following details:
+
*hypervisor_group_id - the ID of the hypervisor zone in which the VS will be created. Optional: if no hypervisor zone is set, the VS will be built in any available hypervisor zone  
enabled - true, if the variable is enabled, otherwise false
+
*hypervisor_id - the ID of a hypervisor where the VS will be built. Optional: if no hypervisor ID is specified, the VS will be built on the hypervisor with the least available RAM (but sufficient RAM for the VS)  
id - variable ID
+
*initial_root_password - the root password for a VS. Optional, if none specified, the system will provide a random password. It can consist of 6-32 characters, letters [A-Za-z], digits [0-9], dash [ - ] and lower dash [ _ ]. You can use both lowercase and uppercase letters  
name - variable name
+
*initial_root_password_encryption_key - specify the password encryption passphrase  
value - variable value script
+
*(lightbulb)recipe_ids - an array of recipe ID you want to run on the virtual server provisioning  
XML Output example
+
*(lightbulb) custom_variables - an array of custom variables with the following details:  
<?xml version="1.0" encoding="UTF-8"?>
+
*enabled - true, if the variable is enabled, otherwise false  
<virtual_machine>
+
*id - variable ID  
  <add_to_marketplace nil="true"/>
+
*name - variable name  
  <admin_note nil="true"/>
+
*value - variable value script  
  <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot>
+
*XML Output example
  <allowed_hot_migrate type="boolean">true</allowed_hot_migrate>
+
 
  <allowed_swap type="boolean">true</allowed_swap>
+
<source lang="xml">
  <booted type="boolean">false</booted>
+
<?xml version="1.0" encoding="UTF-8"?>  
  <built type="boolean">false</built>
+
<virtual_machine>  
  <cpu_shares type="integer">1</cpu_shares>
+
<add_to_marketplace nil="true"/>
  <cpus type="integer">1</cpus>
+
<admin_note nil="true"/>
  <created_at type="datetime">2013-06-11T16:03:58+03:00</created_at>
+
<allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot>
  <customer_network_id nil="true"/>
+
<allowed_hot_migrate type="boolean">true</allowed_hot_migrate>
  <deleted_at nil="true"/>
+
<allowed_swap type="boolean">true</allowed_swap>
  <edge_server_type nil="true"/>
+
<booted type="boolean">false</booted>
  <enable_autoscale type="boolean">false</enable_autoscale>
+
<built type="boolean">false</built>
  <enable_monitis type="boolean">false</enable_monitis>
+
<cpu_shares type="integer">1</cpu_shares>
  <firewall_notrack type="boolean">false</firewall_notrack>
+
<cpus type="integer">1</cpus>
  <hostname>zaza</hostname>
+
<created_at type="datetime">2013-06-11T16:03:58+03:00</created_at>
  <hypervisor_id type="integer">1</hypervisor_id>
+
<customer_network_id nil="true"/>
  <id type="integer">15</id>
+
<deleted_at nil="true"/>
  <identifier>l2lnf62bs44bjf</identifier>
+
<edge_server_type nil="true"/>
<initial_root_password>ehgebhewvtwh</initial_root_password>
+
<enable_autoscale type="boolean">false</enable_autoscale>
  <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted>
+
<enable_monitis type="boolean">false</enable_monitis>
  <label>zaza</label>
+
<firewall_notrack type="boolean">false</firewall_notrack>
<local_remote_access_ip_address>109.123.91.35</local_remote_access_ip_address>
+
<hostname>zaza</hostname>
  <local_remote_access_port nil="true"/>
+
<hypervisor_id type="integer">1</hypervisor_id>
  <locked type="boolean">true</locked>
+
<id type="integer">15</id>
  <memory type="integer">128</memory>
+
<identifier>l2lnf62bs44bjf</identifier>
  <min_disk_size type="integer">5</min_disk_size>
+
<initial_root_password>ehgebhewvtwh</initial_root_password>  
  <note nil="true"/>
+
<initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted>
  <operating_system>linux</operating_system>
+
<label>zaza</label>
<operating_system_distro>ubuntu</operating_system_distro>
+
<local_remote_access_ip_address>109.123.91.35</local_remote_access_ip_address>  
  <preferred_hvs type="array"/>
+
<local_remote_access_port nil="true"/>
  <recovery_mode nil="true"/>
+
<locked type="boolean">true</locked>
<remote_access_password>x9yk3fIMXZBG</remote_access_password>
+
<memory type="integer">128</memory>
  <service_password nil="true"/>
+
<min_disk_size type="integer">5</min_disk_size>
  <state>new</state>
+
<note nil="true"/>
  <storage_server_type nil="true"/>
+
<operating_system>linux</operating_system>
  <strict_virtual_machine_id nil="true"/>
+
<operating_system_distro>ubuntu</operating_system_distro>  
  <suspended type="boolean">false</suspended>
+
<preferred_hvs type="array"/>
  <template_id type="integer">8</template_id>
+
<recovery_mode nil="true"/>
  <template_label>Ubuntu 13.04 x64</template_label>
+
<remote_access_password>x9yk3fIMXZBG</remote_access_password>  
  <updated_at type="datetime">2013-06-11T16:03:59+03:00</updated_at>
+
<service_password nil="true"/>
  <user_id type="integer">1</user_id>
+
<state>new</state>
  <vip nil="true"/>
+
<storage_server_type nil="true"/>
  <xen_id nil="true"/>
+
<strict_virtual_machine_id nil="true"/>
  <ip_addresses type="array">
+
<suspended type="boolean">false</suspended>
    <ip_address>
+
<template_id type="integer">8</template_id>
      <address>109.123.91.171</address>
+
<template_label>Ubuntu 13.04 x64</template_label>
      <broadcast>109.123.91.191</broadcast>
+
<updated_at type="datetime">2013-06-11T16:03:59+03:00</updated_at>
      <created_at type="datetime">2013-06-11T14:16:21+03:00</created_at>
+
<user_id type="integer">1</user_id>
      <customer_network_id nil="true"/>
+
<vip nil="true"/>
      <disallowed_primary type="boolean">false</disallowed_primary>
+
<xen_id nil="true"/>
      <gateway>109.123.91.129</gateway>
+
<ip_addresses type="array">
      <hypervisor_id nil="true"/>
+
<ip_address>
      <id type="integer">386</id>
+
<address>109.123.91.171</address>
      <ip_address_pool_id nil="true"/>
+
<broadcast>109.123.91.191</broadcast>
      <network_address>109.123.91.128</network_address>
+
<created_at type="datetime">2013-06-11T14:16:21+03:00</created_at>
      <network_id type="integer">9</network_id>
+
<customer_network_id nil="true"/>
      <pxe type="boolean">false</pxe>
+
<disallowed_primary type="boolean">false</disallowed_primary>
      <updated_at type="datetime">2013-06-11T14:16:21+03:00</updated_at>
+
<gateway>109.123.91.129</gateway>
      <user_id nil="true"/>
+
<hypervisor_id nil="true"/>
      <free type="boolean">false</free>
+
<id type="integer">386</id>
      <netmask>255.255.255.192</netmask>
+
<ip_address_pool_id nil="true"/>
    </ip_address>
+
<network_address>109.123.91.128</network_address>
  </ip_addresses>
+
<network_id type="integer">9</network_id>
  <monthly_bandwidth_used>0</monthly_bandwidth_used>
+
<pxe type="boolean">false</pxe>
  <total_disk_size type="integer">6</total_disk_size>
+
<updated_at type="datetime">2013-06-11T14:16:21+03:00</updated_at>
</virtual_machine>
+
<user_id nil="true"/>
Where:
+
<free type="boolean">false</free>
add_to_marketplace – true, if the edge server is added to marketplace. The default value is "false". This parameter is for CDN servers only.
+
<netmask>255.255.255.192</netmask>
admin_note - administrator comment for the VS
+
</ip_address>
allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise false
+
</ip_addresses>
allowed_hot_migrate – true if hot migration is allowed, otherwise false
+
<monthly_bandwidth_used>0</monthly_bandwidth_used>
allowed_swap – true if swap is allowed, otherwise false
+
<total_disk_size type="integer">6</total_disk_size>
booted - true, if the VS is boothed, otherwise false
+
</virtual_machine>
built - true, if the VS is built, otherwise false
+
</source>
cpu_shares - the percentage of allocated CPU priority resource
+
 
cpus - number of CPUs assigned to the VS
+
<br>
created_at – the date when the VS was created in the [YYYY][MM][DD]T[hh][mm][ss] format
+
 
updated_at – the date when the VS was updated in the [YYYY][MM][DD]T[hh][mm][ss] format
+
<br> Where:  
customer_network_id - ID of the customer network
+
 
edge_server_type - type of the CDN edge server. This parameter is for CDN servers only.
+
*add_to_marketplace – true, if the edge server is added to marketplace. The default value is "false". This parameter is for CDN servers only.  
enable_autoscale — true if autoscaling is allowed for this VS
+
*admin_note - administrator comment for the VS  
enable_monitis - deprecated attribute
+
*allowed_resize_without_reboot – true if resize without reboot is allowed, otherwise false  
firewall notrack - parameter for adding firewall rules. It true for edge servers only. 
+
*allowed_hot_migrate – true if hot migration is allowed, otherwise false  
hostname - VS hostname
+
*allowed_swap – true if swap is allowed, otherwise false  
hypervisor_id – the ID of the hypervisor, on which the server is deployed
+
*booted - true, if the VS is boothed, otherwise false  
id – the VS ID in OnApp CP database
+
*built - true, if the VS is built, otherwise false  
identifier – the VS identifier
+
*cpu_shares - the percentage of allocated CPU priority resource  
initial_root_password — the VS root password
+
*cpus - number of CPUs assigned to the VS  
initial_root_password_encrypted - true, if the root password is encrypted, otherwise false
+
*created_at – the date when the VS was created in the [YYYY][MM][DD]T[hh][mm][ss] format  
label - user-friendly VS description
+
*updated_at – the date when the VS was updated in the [YYYY][MM][DD]T[hh][mm][ss] format  
local_remote_access_ip_address - IP address for remote connection
+
*customer_network_id - ID of the customer network  
local_remote_access_port  - port for remote connection
+
*edge_server_type - type of the CDN edge server. This parameter is for CDN servers only.  
locked - true if the VS is locked; otherwise false
+
*enable_autoscale — true if autoscaling is allowed for this VS  
memory - the RAM size allocated to this VS
+
*enable_monitis - deprecated attribute  
min_disk_size — the minimum disk size required to build a VS from a specified template
+
*firewall notrack - parameter for adding firewall rules. It true for edge servers only.  
operating_system — operating system used by the VS
+
*hostname - VS hostname  
operating_system_distro — the distribution of the OS from which this VS is built
+
*hypervisor_id – the ID of the hypervisor, on which the server is deployed  
recovery_mode - true if recovery mode allowed, otherwise false
+
*id – the VS ID in OnApp CP database  
remote_access_password — the password for the remote access
+
*identifier – the VS identifier  
service_password - password of a service user
+
*initial_root_password — the VS root password  
storage_server_type -  
+
*initial_root_password_encrypted - true, if the root password is encrypted, otherwise false  
strict_virtual_machine_id - the ID of a virtual machine that will never reside on the same HV with this VS
+
*label - user-friendly VS description  
suspended - true if VS is suspended, otherwise false
+
*local_remote_access_ip_address - IP address for remote connection  
template_id - the ID of the template the VS is based on
+
*local_remote_access_port - port for remote connection  
template_label - the name of the template from which this VS is built
+
*locked - true if the VS is locked; otherwise false  
user_id — the ID of a user assigned to this VS
+
*memory - the RAM size allocated to this VS  
vip — true if the VS has VIP status (gives migration priority)
+
*min_disk_size — the minimum disk size required to build a VS from a specified template  
xen_id — the VS ID set by the virtualization engine
+
*operating_system — operating system used by the VS  
 ip_addresses - an array of IP addresses with the following parameters:
+
*operating_system_distro — the distribution of the OS from which this VS is built  
address - IP address
+
*recovery_mode - true if recovery mode allowed, otherwise false  
broadcast - broadcast address
+
*remote_access_password — the password for the remote access  
created_at - the date when the IP address was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format
+
*service_password - password of a service user  
disallowed_primary - true if not allowed to be used as primary (for VS build), otherwise false
+
*storage_server_type -  
gateway - gateway address
+
*strict_virtual_machine_id - the ID of a virtual machine that will never reside on the same HV with this VS  
id - the ID of the IP address
+
*suspended - true if VS is suspended, otherwise false  
ip_address_pool_id - ID of the IP address pool to the IP address belongs to
+
*template_id - the ID of the template the VS is based on  
network_address - the address of the network
+
*template_label - the name of the template from which this VS is built  
network_id - the ID of the network
+
*user_id — the ID of a user assigned to this VS  
updated_at - the date when the IP address was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format
+
*vip — true if the VS has VIP status (gives migration priority)  
user_id - the ID of a user associated with this IP address
+
*xen_id — the VS ID set by the virtualization engine  
free - true if free, otherwise false
+
*ip_addresses - an array of IP addresses with the following parameters:  
netmask - netmask for the IP address
+
*address - IP address  
monthly_bandwidth_used - VS monthly bandwidth
+
*broadcast - broadcast address  
total_disk_size - total VS disk size
+
*created_at - the date when the IP address was created in the [YYYY][MM][DD]T[hh][mm][ss]Z format  
 +
*disallowed_primary - true if not allowed to be used as primary (for VS build), otherwise false  
 +
*gateway - gateway address  
 +
*id - the ID of the IP address  
 +
*ip_address_pool_id - ID of the IP address pool to the IP address belongs to  
 +
*network_address - the address of the network  
 +
*network_id - the ID of the network  
 +
*updated_at - the date when the IP address was updated in the [YYYY][MM][DD]T[hh][mm][ss]Z format  
 +
*user_id - the ID of a user associated with this IP address  
 +
*free - true if free, otherwise false  
 +
*netmask - netmask for the IP address  
 +
*monthly_bandwidth_used - VS monthly bandwidth  
 +
*total_disk_size - total VS disk size
 +
 
 +
[[Category:Neencloud]]

Versione attuale delle 20:30, 20 feb 2014


POST /virtual_machines.xml POST /virtual_machines.json

XML Request example


curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass -d '<virtual_machine><template_id>8</template_id><licensing_key></licensing_key><label>zaza</label><hostname>zaza</hostname><hypervisor_group_id>14</hypervisor_group_id><hypervisor_id>1</hypervisor_id><initial_root_password>ehgebhewvtwh</initial_root_password><memory>128</memory><cpus>1</cpus><cpu_shares>1</cpu_shares><data_store_group_primary_id>18</data_store_group_primary_id><primary_disk_size>5</primary_disk_size><primary_disk_min_iops>100</primary_disk_min_iops><data_store_group_swap_id>18</data_store_group_swap_id><swap_disk_size>1</swap_disk_size><swap_disk_min_iops>100</swap_disk_min_iops><primary_network_group_id>19</primary_network_group_id><selected_ip_address_id>386</selected_ip_address_id><rate_limit>1</rate_limit><required_ip_address_assignment>1</required_ip_address_assignment><required_automatic_backup>0</required_automatic_backup><required_virtual_machine_build>1</required_virtual_machine_build><required_virtual_machine_startup>1</required_virtual_machine_startup><type_of_format>ext4</type_of_format><enable_autoscale>0</enable_autoscale><custom_recipe_variables><custom_recipe_variable><name>varname</name><value>value</value><enabled>1</enabled><recipe_ids type='array'><recipe_id>11</recipe_id></recipe_ids></custom_recipe_variable></custom_recipe_variables></virtual_machine>' --url http://cloud.neen.it/virtual_machines.xml



JSON Request example

curl -i -X POST -H 'Accept: application/json' -H 'Content-type: application/json' -u user:userpass -d '{"virtual_machine":{"template_id":"8", "licensing_key":"", "label":"zaza", "hostname":"zaza", "hypervisor_group_id":"14", "hypervisor_id":"1", "initial_root_password":"tyrhsghj657th", "memory":"128", "cpus":"1", "cpu_shares":"1", "data_store_group_primary_id":"18", "primary_disk_size":"5", "primary_disk_min_iops":"100", "data_store_group_swap_id":"18", "swap_disk_size":"1", "swap_disk_min_iops":"100", "primary_network_group_id":"19", "selected_ip_address_id":"386", "rate_limit":"1", "required_ip_address_assignment":"1", "required_automatic_backup":"0", "required_virtual_machine_build":"1", "required_virtual_machine_startup":"1", "type_of_format":"ext4", "enable_autoscale":"0","recipe_ids":["11"],"custom_recipe_variables":{"custom_recipe_variable":{"name":"varname","value":"var_value","enabled":"1"}}}}' --url http://cloud.neen.it/virtual_machines.json


The following parameters should be sent:

 
 <?xml version="1.0" encoding="UTF-8"?> 
 <virtual_machine> 
 <add_to_marketplace nil="true"/>
 <admin_note nil="true"/>
 <allow_resize_without_reboot type="boolean">false</allow_resize_without_reboot>
 <allowed_hot_migrate type="boolean">true</allowed_hot_migrate>
 <allowed_swap type="boolean">true</allowed_swap>
 <booted type="boolean">false</booted>
 <built type="boolean">false</built>
 <cpu_shares type="integer">1</cpu_shares>
 <cpus type="integer">1</cpus>
 <created_at type="datetime">2013-06-11T16:03:58+03:00</created_at>
 <customer_network_id nil="true"/>
 <deleted_at nil="true"/>
 <edge_server_type nil="true"/>
 <enable_autoscale type="boolean">false</enable_autoscale>
 <enable_monitis type="boolean">false</enable_monitis>
 <firewall_notrack type="boolean">false</firewall_notrack>
 <hostname>zaza</hostname>
 <hypervisor_id type="integer">1</hypervisor_id>
 <id type="integer">15</id>
 <identifier>l2lnf62bs44bjf</identifier>
 <initial_root_password>ehgebhewvtwh</initial_root_password> 
 <initial_root_password_encrypted type="boolean">false</initial_root_password_encrypted>
 <label>zaza</label>
 <local_remote_access_ip_address>109.123.91.35</local_remote_access_ip_address> 
 <local_remote_access_port nil="true"/>
 <locked type="boolean">true</locked>
 <memory type="integer">128</memory>
 <min_disk_size type="integer">5</min_disk_size>
 <note nil="true"/>
 <operating_system>linux</operating_system>
 <operating_system_distro>ubuntu</operating_system_distro> 
 <preferred_hvs type="array"/>
 <recovery_mode nil="true"/>
 <remote_access_password>x9yk3fIMXZBG</remote_access_password> 
 <service_password nil="true"/>
 <state>new</state>
 <storage_server_type nil="true"/>
 <strict_virtual_machine_id nil="true"/>
 <suspended type="boolean">false</suspended>
 <template_id type="integer">8</template_id>
 <template_label>Ubuntu 13.04 x64</template_label>
 <updated_at type="datetime">2013-06-11T16:03:59+03:00</updated_at>
 <user_id type="integer">1</user_id>
 <vip nil="true"/>
 <xen_id nil="true"/>
 <ip_addresses type="array">
 <ip_address>
 <address>109.123.91.171</address>
 <broadcast>109.123.91.191</broadcast>
 <created_at type="datetime">2013-06-11T14:16:21+03:00</created_at>
 <customer_network_id nil="true"/>
 <disallowed_primary type="boolean">false</disallowed_primary>
 <gateway>109.123.91.129</gateway>
 <hypervisor_id nil="true"/>
 <id type="integer">386</id>
 <ip_address_pool_id nil="true"/>
 <network_address>109.123.91.128</network_address>
 <network_id type="integer">9</network_id>
 <pxe type="boolean">false</pxe>
 <updated_at type="datetime">2013-06-11T14:16:21+03:00</updated_at>
 <user_id nil="true"/>
 <free type="boolean">false</free>
 <netmask>255.255.255.192</netmask>
 </ip_address>
 </ip_addresses>
 <monthly_bandwidth_used>0</monthly_bandwidth_used>
 <total_disk_size type="integer">6</total_disk_size>
 </virtual_machine>



Where:

Strumenti personali
Namespace
Varianti
Azioni
Navigazione
Strumenti