Description
About root password for VM
Root password for VM is based on “adminPass” parameter.
"adminPass" is optional. It changes depending the image you specify.
Request URL
Compute API v2.0 POST /v2/{tenant_id}/servers
Request Paramters
Parameter | Value | Style | Description |
---|---|---|---|
X-Auth-Token | User Token | header | |
tenant_id | URI | ||
imageRef | plain | ||
flavorRef | plain | ||
adminPass (Optional) | plain | For details of root password for VM, refer to "About root password for VM ". | |
key_name (Optional) | ssh key name | plain | Specify when you use SSH key. |
security_groups (Optional) | security_group object | plain | Specify "name" to key, and name of security group to value. (Refer the RequestJson below.) |
metadata (Optional) | plain | ||
instance_name_tag (Optional) | Default : GlobalIP address related to VM | plain | Use when you want to put it a name tag. Half-width alphanumeric, "-" and "_" are only allowed. The length should be of 1-255 characters. |
block_device_mapping (Optional) | Array | Device can be mapped only one. | |
volume_id (Optional) | plain | Specify the volume ID you want to attach to |
Request Json (When Specifying Only Basic Requirement)
{ "server": { "imageRef": "1f7bcc63-4a18-4371-85b1-bcdd4301ff31", "flavorRef": "nc1g", "adminPass":"72LY2hf38Kf84vCy4sUr" } }
Request Json (When Specifying SSH Key)
{ "server": { "imageRef": "1f7bcc63-4a18-4371-85b1-bcdd4301ff31", "flavorRef": "nc1g", "adminPass":"72LY2hf38Kf84vCy4sUr", "key_name": "xxxxxx-key-01" } }
Request Json(When Specifying metadata)
{ "server": { "imageRef": "1f7bcc63-4a18-4371-85b1-bcdd4301ff31", "flavorRef": "nc1g", "adminPass":"72LY2hf38Kf84vCy4sUr", "metadata": { "instance_name_tag": "testtest" } } }
Request Json(When Specifying Additional Disk)
{ "server": { "imageRef": "1f7bcc63-4a18-4371-85b1-bcdd4301ff31", "flavorRef": "nc1g", "adminPass":"72LY2hf38Kf84vCy4sUr", "block_device_mapping": [ { "volume_id": "fa90d521-7918-4b13-ad71-7aeb8667887a" } ] } }
Request Json(When Specifying Security Group)
{ "server": { "imageRef": "1f7bcc63-4a18-4371-85b1-bcdd4301ff31", "flavorRef": "nc1g", "adminPass":"72LY2hf38Kf84vCy4sUr", "security_groups": [ { "name": "default" }, { "name": "another-secgroup-name" } ] } }
Normal response codes
202
Example
curl -i -X POST \ -H "Accept: application/json" \ -H "X-Auth-Token: 35941e7df872405d84e5b026dba8323c" \ -d '{"server": {"adminPass": "7AwxbUP6M4,R","imageRef": "e2b62c96-abbc-41ae-a5f2-b0fe514b755c","flavorRef": "294639c7-72ba-43a5-8ff2-513c8995b869"}}' \ https://compute.tyo1.cloud.z.com/v2/1864e71d2deb46f6b47526b69c65a45d/servers
HTTP/1.1 202 Accepted Date: Mon, 02 Feb 2015 08:55:18 GMT Server: Apache Content-Length: 422 Content-Type: application/json { "server": { "OS-DCF:diskConfig": "MANUAL", "adminPass": "7AwxbUP6M4,R", "id": "967fee34-e6dc-4237-9e39-134783c90516", "links": [ { "href": "https://compute.tyo1.cloud.z.com/v2/1864e71d2deb46f6b47526b69c65a45d/servers/967fee34-e6dc-4237-9e39-134783c90516", "rel": "self" }, { "href": "https://compute.tyo1.cloud.z.com/1864e71d2deb46f6b47526b69c65a45d/servers/967fee34-e6dc-4237-9e39-134783c90516", "rel": "bookmark" } ], "security_groups": [ { "name": "default" } ] } }