Change 'image_ref'/'flavor_ref' into v2 style for servers

This patch changes 'image_ref'/'flavor_ref' to 'imageRef'/'flavorRef'
that same with v2 api. And also change the related unittest.
The differences between v2 and v3 are described on the wiki page

https://wiki.openstack.org/wiki/NovaAPIv2tov3.

Partially implements blueprint v2-on-v3-api

Change-Id: Ic17334e0a9de89488d5e0c8b75950027d51a3cd4
This commit is contained in:
He Jie Xu 2014-08-15 11:29:26 +08:00
parent af8f401eb5
commit 5ed82cf7ed
91 changed files with 287 additions and 287 deletions

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -2,7 +2,7 @@
"rebuild" : {
"os-access-ips:access_ip_v4": "4.3.2.1",
"os-access-ips:access_ip_v6": "80fe::",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"name" : "new-server-test",
"metadata" : {
"meta_var" : "meta_val"

View File

@ -3,8 +3,8 @@
"os-access-ips:access_ip_v4": "1.2.3.4",
"os-access-ips:access_ip_v6": "fe80::",
"name" : "new-server-test",
"image_ref" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
"imageRef" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/openstack/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
"imageRef" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/openstack/flavors/1",
"os-availability-zone:availability_zone" : "test"
"metadata" : {
"My Server Name" : "Apache1"

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
"imageRef" : "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/openstack/flavors/1",
"os-scheduler-hints:scheduler_hints": {
"same_host": "48e6a9f6-30af-47e0-bc04-acaed113bb4e"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
"imageRef" : "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/openstack/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
"imageRef" : "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/openstack/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/openstack/flavors/1",
"imageRef" : "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/openstack/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,6 +1,6 @@
{
"rebuild" : {
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"name" : "foobar",
"adminPass" : "seekr3t",
"metadata" : {

View File

@ -1,6 +1,6 @@
{
"rebuild" : {
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"name" : "foobar",
"adminPass" : "seekr3t",
"metadata" : {

View File

@ -1,5 +1,5 @@
{
"resize" : {
"flavor_ref" : "2"
"flavorRef" : "2"
}
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavor_ref" : "http://openstack.example.com/flavors/1",
"imageRef" : "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b",
"flavorRef" : "http://openstack.example.com/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -491,7 +491,7 @@ class ServersController(wsgi.Controller):
try:
flavor_id = self._flavor_id_from_req_data(body)
except ValueError as error:
msg = _("Invalid flavor_ref provided.")
msg = _("Invalid flavorRef provided.")
raise exc.HTTPBadRequest(explanation=msg)
try:
@ -519,7 +519,7 @@ class ServersController(wsgi.Controller):
msg = _("Can not find requested image")
raise exc.HTTPBadRequest(explanation=msg)
except exception.FlavorNotFound as error:
msg = _("Invalid flavor_ref provided.")
msg = _("Invalid flavorRef provided.")
raise exc.HTTPBadRequest(explanation=msg)
except exception.KeypairNotFound as error:
msg = _("Invalid key_name provided.")
@ -779,7 +779,7 @@ class ServersController(wsgi.Controller):
image_uuid = image_href.split('/').pop()
if not uuidutils.is_uuid_like(image_uuid):
msg = _("Invalid image_ref provided.")
msg = _("Invalid imageRef provided.")
raise exc.HTTPBadRequest(explanation=msg)
return image_uuid
@ -788,24 +788,24 @@ class ServersController(wsgi.Controller):
"""Get image data from the request or raise appropriate
exceptions.
The field image_ref is mandatory when no block devices have been
The field imageRef is mandatory when no block devices have been
defined and must be a proper uuid when present.
"""
image_href = server_dict.get('image_ref')
image_href = server_dict.get('imageRef')
if not image_href and create_kwargs.get('block_device_mapping'):
return ''
elif image_href:
return self._image_uuid_from_href(unicode(image_href))
else:
msg = _("Missing image_ref attribute")
msg = _("Missing imageRef attribute")
raise exc.HTTPBadRequest(explanation=msg)
def _flavor_id_from_req_data(self, data):
try:
flavor_ref = data['server']['flavor_ref']
flavor_ref = data['server']['flavorRef']
except (TypeError, KeyError):
msg = _("Missing flavor_ref attribute")
msg = _("Missing flavorRef attribute")
raise exc.HTTPBadRequest(explanation=msg)
return common.get_id_from_href(flavor_ref)
@ -817,12 +817,12 @@ class ServersController(wsgi.Controller):
"""Resizes a given instance to the flavor size requested."""
resize_dict = body['resize']
try:
flavor_ref = str(resize_dict["flavor_ref"])
flavor_ref = str(resize_dict["flavorRef"])
if not flavor_ref:
msg = _("Resize request has invalid 'flavor_ref' attribute.")
msg = _("Resize request has invalid 'flavorRef' attribute.")
raise exc.HTTPBadRequest(explanation=msg)
except (KeyError, TypeError):
msg = _("Resize requests require 'flavor_ref' attribute.")
msg = _("Resize requests require 'flavorRef' attribute.")
raise exc.HTTPBadRequest(explanation=msg)
resize_kwargs = {}
@ -837,9 +837,9 @@ class ServersController(wsgi.Controller):
rebuild_dict = body['rebuild']
try:
image_href = rebuild_dict["image_ref"]
image_href = rebuild_dict["imageRef"]
except (KeyError, TypeError):
msg = _("Could not parse image_ref from request.")
msg = _("Could not parse imageRef from request.")
raise exc.HTTPBadRequest(explanation=msg)
image_href = self._image_uuid_from_href(image_href)

View File

@ -344,9 +344,9 @@ class ServersControllerCreateTest(test.TestCase):
def _test_create_extra(self, params, no_image=False,
override_controller=None):
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
server = dict(name='server_test', image_ref=image_uuid, flavor_ref=2)
server = dict(name='server_test', imageRef=image_uuid, flavorRef=2)
if no_image:
server.pop('image_ref', None)
server.pop('imageRef', None)
server.update(params)
body = dict(server=server)
req = fakes.HTTPRequestV3.blank('/v3/servers')
@ -384,8 +384,8 @@ class ServersControllerCreateTest(test.TestCase):
body = {
'server': {
'name': 'config_drive_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {
'hello': 'world',
'open': 'stack',
@ -416,8 +416,8 @@ class ServersControllerCreateTest(test.TestCase):
body = {
'server': {
'name': 'config_drive_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {
'hello': 'world',
'open': 'stack',

View File

@ -62,8 +62,8 @@ class BlockDeviceMappingTest(test.TestCase):
'server': {
'min_count': 2,
'name': 'server_test',
'image_ref': '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6',
'flavor_ref': 'http://localhost/123/flavors/3',
'imageRef': '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6',
'flavorRef': 'http://localhost/123/flavors/3',
'metadata': {
'hello': 'world',
'open': 'stack',
@ -72,7 +72,7 @@ class BlockDeviceMappingTest(test.TestCase):
}
if no_image:
del body['server']['image_ref']
del body['server']['imageRef']
body['server'].update(params)
@ -109,7 +109,7 @@ class BlockDeviceMappingTest(test.TestCase):
old_create = compute_api.API.create
def create(*args, **kwargs):
self.assertNotIn('image_ref', kwargs)
self.assertNotIn('imageRef', kwargs)
return old_create(*args, **kwargs)
self.stubs.Set(compute_api.API, 'create', create)

View File

@ -177,9 +177,9 @@ class ServersControllerCreateTest(test.TestCase):
def _test_create_extra(self, params, no_image=False,
override_controller=None):
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
server = dict(name='server_test', image_ref=image_uuid, flavor_ref=2)
server = dict(name='server_test', imageRef=image_uuid, flavorRef=2)
if no_image:
server.pop('image_ref', None)
server.pop('imageRef', None)
server.update(params)
body = dict(server=server)
req = fakes.HTTPRequestV3.blank('/servers')
@ -215,8 +215,8 @@ class ServersControllerCreateTest(test.TestCase):
body = {
'server': {
'name': 'config_drive_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {
'hello': 'world',
'open': 'stack',

View File

@ -140,9 +140,9 @@ class ServersControllerCreateTest(test.TestCase):
def _test_create_extra(self, params, no_image=False,
override_controller=None):
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
server = dict(name='server_test', image_ref=image_uuid, flavor_ref=2)
server = dict(name='server_test', imageRef=image_uuid, flavorRef=2)
if no_image:
server.pop('image_ref', None)
server.pop('imageRef', None)
server.update(params)
body = dict(server=server)
req = fakes.HTTPRequestV3.blank('/servers')
@ -217,8 +217,8 @@ class ServersControllerCreateTest(test.TestCase):
'server': {
multiple_create.MIN_ATTRIBUTE_NAME: -1,
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
}
}
req = fakes.HTTPRequestV3.blank('/servers')
@ -238,8 +238,8 @@ class ServersControllerCreateTest(test.TestCase):
'server': {
multiple_create.MAX_ATTRIBUTE_NAME: -1,
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
}
}
req = fakes.HTTPRequestV3.blank('/servers')
@ -260,8 +260,8 @@ class ServersControllerCreateTest(test.TestCase):
multiple_create.MIN_ATTRIBUTE_NAME: 4,
multiple_create.MAX_ATTRIBUTE_NAME: 2,
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
}
}
req = fakes.HTTPRequestV3.blank('/servers')
@ -281,8 +281,8 @@ class ServersControllerCreateTest(test.TestCase):
'server': {
multiple_create.MIN_ATTRIBUTE_NAME: 'abcd',
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
}
}
req = fakes.HTTPRequestV3.blank('/servers')
@ -302,8 +302,8 @@ class ServersControllerCreateTest(test.TestCase):
'server': {
multiple_create.MAX_ATTRIBUTE_NAME: 'abcd',
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
}
}
req = fakes.HTTPRequestV3.blank('/servers')
@ -325,8 +325,8 @@ class ServersControllerCreateTest(test.TestCase):
'server': {
multiple_create.MIN_ATTRIBUTE_NAME: 2,
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {'hello': 'world',
'open': 'stack'},
}
@ -352,8 +352,8 @@ class ServersControllerCreateTest(test.TestCase):
'server': {
multiple_create.MIN_ATTRIBUTE_NAME: 2,
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {'hello': 'world',
'open': 'stack'},
}
@ -387,8 +387,8 @@ class ServersControllerCreateTest(test.TestCase):
'server': {
multiple_create.MIN_ATTRIBUTE_NAME: 2,
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {'hello': 'world',
'open': 'stack'},
multiple_create.RRID_ATTRIBUTE_NAME: resv_id_return
@ -463,8 +463,8 @@ class ServersControllerCreateTest(test.TestCase):
'server': {
multiple_create.MAX_ATTRIBUTE_NAME: 2.5,
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {'hello': 'world',
'open': 'stack'},
}
@ -484,8 +484,8 @@ class ServersControllerCreateTest(test.TestCase):
'server': {
multiple_create.MIN_ATTRIBUTE_NAME: 2.5,
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {'hello': 'world',
'open': 'stack'},
}

View File

@ -66,8 +66,8 @@ class SchedulerHintsTestCase(test.TestCase):
req.content_type = 'application/json'
body = {'server': {
'name': 'server_test',
'image_ref': 'cedef40a-ed67-4d10-800e-17455edce175',
'flavor_ref': '1',
'imageRef': 'cedef40a-ed67-4d10-800e-17455edce175',
'flavorRef': '1',
}}
req.body = jsonutils.dumps(body)
@ -89,8 +89,8 @@ class SchedulerHintsTestCase(test.TestCase):
body = {
'server': {
'name': 'server_test',
'image_ref': 'cedef40a-ed67-4d10-800e-17455edce175',
'flavor_ref': '1',
'imageRef': 'cedef40a-ed67-4d10-800e-17455edce175',
'flavorRef': '1',
'os-scheduler-hints:scheduler_hints': hints,
},
}
@ -106,8 +106,8 @@ class SchedulerHintsTestCase(test.TestCase):
body = {
'server': {
'name': 'server_test',
'image_ref': 'cedef40a-ed67-4d10-800e-17455edce175',
'flavor_ref': '1',
'imageRef': 'cedef40a-ed67-4d10-800e-17455edce175',
'flavorRef': '1',
'os-scheduler-hints:scheduler_hints': 'non-dict',
},
}
@ -213,9 +213,9 @@ class ServersControllerCreateTest(test.TestCase):
def _test_create_extra(self, params, no_image=False,
override_controller=None):
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
server = dict(name='server_test', image_ref=image_uuid, flavor_ref=2)
server = dict(name='server_test', imageRef=image_uuid, flavorRef=2)
if no_image:
server.pop('image_ref', None)
server.pop('imageRef', None)
server.update(params)
body = dict(server=server)
req = fakes.HTTPRequestV3.blank('/servers')

View File

@ -141,7 +141,7 @@ class SecurityGroupsOutputTest(test.TestCase):
def test_create(self):
url = '/v3/servers'
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
server = dict(name='server_test', image_ref=image_uuid, flavor_ref=2)
server = dict(name='server_test', imageRef=image_uuid, flavorRef=2)
res = self._make_request(url, {'server': server})
self.assertEqual(res.status_int, 202)
server = self._get_server(res.body)
@ -277,9 +277,9 @@ class ServersControllerCreateTest(test.TestCase):
def _test_create_extra(self, params, no_image=False,
override_controller=None):
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
server = dict(name='server_test', image_ref=image_uuid, flavor_ref=2)
server = dict(name='server_test', imageRef=image_uuid, flavorRef=2)
if no_image:
server.pop('image_ref', None)
server.pop('imageRef', None)
server.update(params)
body = dict(server=server)
req = fakes.HTTPRequestV3.blank('/servers')

View File

@ -152,9 +152,9 @@ class ServerActionsControllerTest(test.TestCase):
actions = ['resize', 'confirm_resize', 'revert_resize', 'reboot',
'rebuild']
body_map = {'resize': {'flavor_ref': '2'},
body_map = {'resize': {'flavorRef': '2'},
'reboot': {'type': 'HARD'},
'rebuild': {'image_ref': self.image_uuid,
'rebuild': {'imageRef': self.image_uuid,
'adminPass': 'TNc53Dr8s7vw'}}
args_map = {'resize': (('2'), {}),
@ -260,7 +260,7 @@ class ServerActionsControllerTest(test.TestCase):
body = {
"rebuild": {
"image_ref": self._image_href,
"imageRef": self._image_href,
},
}
@ -287,7 +287,7 @@ class ServerActionsControllerTest(test.TestCase):
# proper local hrefs must start with 'http://localhost/v3/'
body = {
'rebuild': {
'image_ref': self.image_uuid,
'imageRef': self.image_uuid,
},
}
@ -308,7 +308,7 @@ class ServerActionsControllerTest(test.TestCase):
# proper local hrefs must start with 'http://localhost/v3/'
body = {
'rebuild': {
'image_ref': self.image_href,
'imageRef': self.image_href,
},
}
@ -328,7 +328,7 @@ class ServerActionsControllerTest(test.TestCase):
body = {
"rebuild": {
"image_ref": self._image_href,
"imageRef": self._image_href,
},
}
@ -344,7 +344,7 @@ class ServerActionsControllerTest(test.TestCase):
def test_rebuild_raises_conflict_on_invalid_state(self):
body = {
"rebuild": {
"image_ref": self._image_href,
"imageRef": self._image_href,
},
}
@ -369,7 +369,7 @@ class ServerActionsControllerTest(test.TestCase):
body = {
"rebuild": {
"image_ref": self._image_href,
"imageRef": self._image_href,
"metadata": metadata,
},
}
@ -382,7 +382,7 @@ class ServerActionsControllerTest(test.TestCase):
def test_rebuild_accepted_with_bad_metadata(self):
body = {
"rebuild": {
"image_ref": self._image_href,
"imageRef": self._image_href,
"metadata": "stack",
},
}
@ -395,7 +395,7 @@ class ServerActionsControllerTest(test.TestCase):
def test_rebuild_with_too_large_metadata(self):
body = {
"rebuild": {
"image_ref": self._image_href,
"imageRef": self._image_href,
"metadata": {
256 * "k": "value"
}
@ -426,7 +426,7 @@ class ServerActionsControllerTest(test.TestCase):
body = {
"rebuild": {
"image_ref": self._image_href,
"imageRef": self._image_href,
"adminPass": "asdf",
},
}
@ -448,7 +448,7 @@ class ServerActionsControllerTest(test.TestCase):
body = {
"rebuild": {
"image_ref": self._image_href,
"imageRef": self._image_href,
"admin_password": "asdf",
},
}
@ -467,7 +467,7 @@ class ServerActionsControllerTest(test.TestCase):
body = {
"rebuild": {
"image_ref": self._image_href,
"imageRef": self._image_href,
},
}
@ -479,7 +479,7 @@ class ServerActionsControllerTest(test.TestCase):
def test_rebuild_with_bad_image(self):
body = {
"rebuild": {
"image_ref": "foo",
"imageRef": "foo",
},
}
req = fakes.HTTPRequestV3.blank(self.url)
@ -507,7 +507,7 @@ class ServerActionsControllerTest(test.TestCase):
self.stubs.Set(fake._FakeImageService, 'show', return_image_meta)
body = {
"rebuild": {
"image_ref": "155d900f-4e14-4e4c-a73d-069cbf4541e6",
"imageRef": "155d900f-4e14-4e4c-a73d-069cbf4541e6",
},
}
req = fakes.HTTPRequestV3.blank(self.url)
@ -552,7 +552,7 @@ class ServerActionsControllerTest(test.TestCase):
self.stubs.Set(objects.Instance, 'save', fake_save)
body = {
"rebuild": {
"image_ref": "155d900f-4e14-4e4c-a73d-069cbf4541e6",
"imageRef": "155d900f-4e14-4e4c-a73d-069cbf4541e6",
},
}
req = fakes.HTTPRequestV3.blank(self.url)
@ -568,7 +568,7 @@ class ServerActionsControllerTest(test.TestCase):
body = {
"rebuild": {
"image_ref": self._image_href,
"imageRef": self._image_href,
},
}
if value is not None:
@ -599,7 +599,7 @@ class ServerActionsControllerTest(test.TestCase):
def test_resize_server(self):
body = dict(resize=dict(flavor_ref="http://localhost/3"))
body = dict(resize=dict(flavorRef="http://localhost/3"))
self.resize_called = False
@ -622,7 +622,7 @@ class ServerActionsControllerTest(test.TestCase):
req, FAKE_UUID, body)
def test_resize_server_no_flavor_ref(self):
body = dict(resize=dict(flavor_ref=None))
body = dict(resize=dict(flavorRef=None))
req = fakes.HTTPRequestV3.blank(self.url)
self.assertRaises(webob.exc.HTTPBadRequest,
@ -630,7 +630,7 @@ class ServerActionsControllerTest(test.TestCase):
req, FAKE_UUID, body)
def test_resize_with_server_not_found(self):
body = dict(resize=dict(flavor_ref="http://localhost/3"))
body = dict(resize=dict(flavorRef="http://localhost/3"))
self.stubs.Set(compute_api.API, 'get', return_server_not_found)
@ -640,7 +640,7 @@ class ServerActionsControllerTest(test.TestCase):
req, FAKE_UUID, body)
def test_resize_with_image_exceptions(self):
body = dict(resize=dict(flavor_ref="http://localhost/3"))
body = dict(resize=dict(flavorRef="http://localhost/3"))
self.resize_called = 0
image_id = 'fake_image_id'
@ -668,7 +668,7 @@ class ServerActionsControllerTest(test.TestCase):
self.assertEqual(self.resize_called, call_no + 1)
def test_resize_with_too_many_instances(self):
body = dict(resize=dict(flavor_ref="http://localhost/3"))
body = dict(resize=dict(flavorRef="http://localhost/3"))
def fake_resize(*args, **kwargs):
raise exception.TooManyInstances(message="TooManyInstance")
@ -683,7 +683,7 @@ class ServerActionsControllerTest(test.TestCase):
@mock.patch('nova.compute.api.API.resize',
side_effect=exception.CannotResizeDisk(reason=''))
def test_resize_raises_cannot_resize_disk(self, mock_resize):
body = dict(resize=dict(flavor_ref="http://localhost/3"))
body = dict(resize=dict(flavorRef="http://localhost/3"))
req = fakes.HTTPRequestV3.blank(self.url)
self.assertRaises(webob.exc.HTTPBadRequest,
self.controller._action_resize,
@ -693,14 +693,14 @@ class ServerActionsControllerTest(test.TestCase):
side_effect=exception.FlavorNotFound(reason='',
flavor_id='fake_id'))
def test_resize_raises_flavor_not_found(self, mock_resize):
body = dict(resize=dict(flavor_ref="http://localhost/3"))
body = dict(resize=dict(flavorRef="http://localhost/3"))
req = fakes.HTTPRequestV3.blank(self.url)
self.assertRaises(webob.exc.HTTPBadRequest,
self.controller._action_resize,
req, FAKE_UUID, body)
def test_resize_raises_conflict_on_invalid_state(self):
body = dict(resize=dict(flavor_ref="http://localhost/3"))
body = dict(resize=dict(flavorRef="http://localhost/3"))
def fake_resize(*args, **kwargs):
raise exception.InstanceInvalidState(attr='fake_attr',

View File

@ -1381,7 +1381,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
self.body = {
'rebuild': {
'name': 'new_name',
'image_ref': self.image_href,
'imageRef': self.image_href,
'metadata': {
'open': 'stack',
},
@ -1891,8 +1891,8 @@ class ServersControllerCreateTest(test.TestCase):
self.body = {
'server': {
'name': 'server_test',
'image_ref': self.image_uuid,
'flavor_ref': self.flavor_ref,
'imageRef': self.image_uuid,
'flavorRef': self.flavor_ref,
'metadata': {
'hello': 'world',
'open': 'stack',
@ -1919,8 +1919,8 @@ class ServersControllerCreateTest(test.TestCase):
def _test_create_instance(self, flavor=2):
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
self.body['server']['image_ref'] = image_uuid
self.body['server']['flavor_ref'] = flavor
self.body['server']['imageRef'] = image_uuid
self.body['server']['flavorRef'] = flavor
self.req.body = jsonutils.dumps(self.body)
server = self.controller.create(self.req, body=self.body).obj['server']
self._check_admin_password_len(server)
@ -1947,7 +1947,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_server_bad_image_href(self):
image_href = 1
self.body['server']['min_count'] = 1
self.body['server']['image_ref'] = image_href,
self.body['server']['imageRef'] = image_href,
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest,
self.controller.create,
@ -1983,7 +1983,7 @@ class ServersControllerCreateTest(test.TestCase):
self.addCleanup(image_service.update, context, self.image_uuid,
{'status': 'active'})
self.body['server']['flavor_ref'] = 2
self.body['server']['flavorRef'] = 2
self.req.body = jsonutils.dumps(self.body)
with testtools.ExpectedException(
webob.exc.HTTPBadRequest,
@ -2004,7 +2004,7 @@ class ServersControllerCreateTest(test.TestCase):
self.addCleanup(image_service.update, context, self.image_uuid,
{'size': orig_size})
self.body['server']['flavor_ref'] = 2
self.body['server']['flavorRef'] = 2
self.req.body = jsonutils.dumps(self.body)
with testtools.ExpectedException(
@ -2014,7 +2014,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_image_ref_is_bookmark(self):
image_href = 'http://localhost/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.req.body = jsonutils.dumps(self.body)
res = self.controller.create(self.req, body=self.body).obj
@ -2025,8 +2025,8 @@ class ServersControllerCreateTest(test.TestCase):
image_uuid = 'this_is_not_a_valid_uuid'
image_href = 'http://localhost/images/%s' % image_uuid
flavor_ref = 'http://localhost/flavors/3'
self.body['server']['image_ref'] = image_href
self.body['server']['flavor_ref'] = flavor_ref
self.body['server']['imageRef'] = image_href
self.body['server']['flavorRef'] = flavor_ref
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest, self.controller.create,
self.req, body=self.body)
@ -2036,9 +2036,9 @@ class ServersControllerCreateTest(test.TestCase):
self._test_create_instance()
def _test_create_extra(self, params, no_image=False):
self.body['server']['flavor_ref'] = 2
self.body['server']['flavorRef'] = 2
if no_image:
self.body['server'].pop('image_ref', None)
self.body['server'].pop('imageRef', None)
self.body['server'].update(params)
self.req.body = jsonutils.dumps(self.body)
self.req.headers["content-type"] = "application/json"
@ -2167,7 +2167,7 @@ class ServersControllerCreateTest(test.TestCase):
# proper local hrefs must start with 'http://localhost/v3/'
self.flags(enable_instance_password=False)
image_href = 'http://localhost/v2/fake/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.req.body = jsonutils.dumps(self.body)
res = self.controller.create(self.req, body=self.body).obj
@ -2179,7 +2179,7 @@ class ServersControllerCreateTest(test.TestCase):
# proper local hrefs must start with 'http://localhost/v3/'
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
self.body['server']['name'] = 'X' * 256
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest, self.controller.create,
self.req, body=self.body)
@ -2211,7 +2211,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance(self):
# proper local hrefs must start with 'http://localhost/v3/'
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.req.body = jsonutils.dumps(self.body)
res = self.controller.create(self.req, body=self.body).obj
@ -2233,8 +2233,8 @@ class ServersControllerCreateTest(test.TestCase):
body = {
'server': {
'name': 'server_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {
'hello': 'world',
'open': 'stack',
@ -2253,7 +2253,7 @@ class ServersControllerCreateTest(test.TestCase):
self.flags(enable_instance_password=False)
# proper local hrefs must start with 'http://localhost/v3/'
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.req.body = jsonutils.dumps(self.body)
res = self.controller.create(self.req, body=self.body).obj
@ -2264,7 +2264,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_too_much_metadata(self):
self.flags(quota_metadata_items=1)
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.body['server']['metadata']['vote'] = 'fiddletown'
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPForbidden,
@ -2273,7 +2273,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_metadata_key_too_long(self):
self.flags(quota_metadata_items=1)
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.body['server']['metadata'] = {('a' * 260): '12345'}
self.req.body = jsonutils.dumps(self.body)
@ -2283,7 +2283,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_metadata_value_too_long(self):
self.flags(quota_metadata_items=1)
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.body['server']['metadata'] = {'key1': ('a' * 260)}
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPRequestEntityTooLarge,
@ -2292,7 +2292,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_metadata_key_blank(self):
self.flags(quota_metadata_items=1)
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.body['server']['metadata'] = {'': 'abcd'}
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest,
@ -2301,7 +2301,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_metadata_not_dict(self):
self.flags(quota_metadata_items=1)
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.body['server']['metadata'] = 'string'
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest,
@ -2310,7 +2310,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_metadata_key_not_string(self):
self.flags(quota_metadata_items=1)
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.body['server']['metadata'] = {1: 'test'}
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest,
@ -2319,7 +2319,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_metadata_value_not_string(self):
self.flags(quota_metadata_items=1)
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.body['server']['metadata'] = {'test': ['a', 'list']}
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest,
@ -2332,7 +2332,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_invalid_key_name(self):
image_href = 'http://localhost/v2/images/2'
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.body['server']['key_name'] = 'nonexistentkey'
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest,
@ -2349,8 +2349,8 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_invalid_flavor_href(self):
image_href = 'http://localhost/v2/images/2'
flavor_ref = 'http://localhost/v2/flavors/asdf'
self.body['server']['image_ref'] = image_href
self.body['server']['flavor_ref'] = flavor_ref
self.body['server']['imageRef'] = image_href
self.body['server']['flavorRef'] = flavor_ref
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest,
self.controller.create, self.req, body=self.body)
@ -2358,8 +2358,8 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_invalid_flavor_id_int(self):
image_href = 'http://localhost/v2/images/2'
flavor_ref = -1
self.body['server']['image_ref'] = image_href
self.body['server']['flavor_ref'] = flavor_ref
self.body['server']['imageRef'] = image_href
self.body['server']['flavorRef'] = flavor_ref
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest,
self.controller.create, self.req, body=self.body)
@ -2367,15 +2367,15 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_bad_flavor_href(self):
image_href = 'http://localhost/v2/images/2'
flavor_ref = 'http://localhost/v2/flavors/17'
self.body['server']['image_ref'] = image_href
self.body['server']['flavor_ref'] = flavor_ref
self.body['server']['imageRef'] = image_href
self.body['server']['flavorRef'] = flavor_ref
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest,
self.controller.create, self.req, body=self.body)
def test_create_instance_bad_href(self):
image_href = 'asdf'
self.body['server']['image_ref'] = image_href
self.body['server']['imageRef'] = image_href
self.req.body = jsonutils.dumps(self.body)
self.assertRaises(webob.exc.HTTPBadRequest,
@ -2389,7 +2389,7 @@ class ServersControllerCreateTest(test.TestCase):
self.assertEqual(FAKE_UUID, server['id'])
def test_create_instance_admin_password(self):
self.body['server']['flavor_ref'] = 3
self.body['server']['flavorRef'] = 3
self.body['server']['adminPass'] = 'testpass'
self.req.body = jsonutils.dumps(self.body)
res = self.controller.create(self.req, body=self.body).obj
@ -2400,7 +2400,7 @@ class ServersControllerCreateTest(test.TestCase):
def test_create_instance_admin_password_pass_disabled(self):
self.flags(enable_instance_password=False)
self.body['server']['flavor_ref'] = 3
self.body['server']['flavorRef'] = 3
self.body['server']['adminPass'] = 'testpass'
self.req.body = jsonutils.dumps(self.body)
res = self.controller.create(self.req, body=self.body).obj
@ -2409,7 +2409,7 @@ class ServersControllerCreateTest(test.TestCase):
self.assertIn('adminPass', self.body['server'])
def test_create_instance_admin_password_empty(self):
self.body['server']['flavor_ref'] = 3
self.body['server']['flavorRef'] = 3
self.body['server']['adminPass'] = ''
self.req.body = jsonutils.dumps(self.body)
@ -2426,7 +2426,7 @@ class ServersControllerCreateTest(test.TestCase):
def _do_test_create_instance_above_quota(self, resource, allowed, quota,
expected_msg):
fakes.stub_out_instance_quota(self.stubs, allowed, quota, resource)
self.body['server']['flavor_ref'] = 3
self.body['server']['flavorRef'] = 3
self.req.body = jsonutils.dumps(self.body)
try:
self.controller.create(self.req, body=self.body).obj['server']
@ -2546,8 +2546,8 @@ class ServersControllerCreateTestWithMock(test.TestCase):
self.body = {
'server': {
'name': 'server_test',
'image_ref': self.image_uuid,
'flavor_ref': self.flavor_ref,
'imageRef': self.image_uuid,
'flavorRef': self.flavor_ref,
'metadata': {
'hello': 'world',
'open': 'stack',
@ -2559,9 +2559,9 @@ class ServersControllerCreateTestWithMock(test.TestCase):
self.req.headers["content-type"] = "application/json"
def _test_create_extra(self, params, no_image=False):
self.body['server']['flavor_ref'] = 2
self.body['server']['flavorRef'] = 2
if no_image:
self.body['server'].pop('image_ref', None)
self.body['server'].pop('imageRef', None)
self.body['server'].update(params)
self.req.body = jsonutils.dumps(self.body)
self.req.headers["content-type"] = "application/json"

View File

@ -143,9 +143,9 @@ class ServersControllerCreateTest(test.TestCase):
def _test_create_extra(self, params, no_image=False,
override_controller=None):
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
server = dict(name='server_test', image_ref=image_uuid, flavor_ref=2)
server = dict(name='server_test', imageRef=image_uuid, flavorRef=2)
if no_image:
server.pop('image_ref', None)
server.pop('imageRef', None)
server.update(params)
body = dict(server=server)
req = fakes.HTTPRequestV3.blank('/servers')
@ -188,8 +188,8 @@ class ServersControllerCreateTest(test.TestCase):
body = {
'server': {
'name': 'user_data_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {
'hello': 'world',
'open': 'stack',
@ -214,8 +214,8 @@ class ServersControllerCreateTest(test.TestCase):
body = {
'server': {
'name': 'user_data_test',
'image_ref': image_href,
'flavor_ref': flavor_ref,
'imageRef': image_href,
'flavorRef': flavor_ref,
'metadata': {
'hello': 'world',
'open': 'stack',

View File

@ -512,8 +512,8 @@ class ServersTest(integrated_helpers._IntegratedTestBase):
class ServersTestV3(client.TestOpenStackClientV3Mixin, ServersTest):
_force_delete_parameter = 'force_delete'
_api_version = 'v3'
_image_ref_parameter = 'image_ref'
_flavor_ref_parameter = 'flavor_ref'
_image_ref_parameter = 'imageRef'
_flavor_ref_parameter = 'flavorRef'
_return_resv_id_parameter = 'os-multiple-create:return_reservation_id'
_min_count_parameter = 'os-multiple-create:min_count'
_access_ipv4_parameter = None

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -2,7 +2,7 @@
"rebuild" : {
"os-access-ips:access_ip_v4": "%(access_ip_v4)s",
"os-access-ips:access_ip_v6": "%(access_ip_v6)s",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"name" : "new-server-test",
"metadata" : {
"meta_var" : "meta_val"

View File

@ -3,8 +3,8 @@
"os-access-ips:access_ip_v4": "%(access_ip_v4)s",
"os-access-ips:access_ip_v6": "%(access_ip_v6)s",
"name" : "new-server-test",
"image_ref" : "%(host)s/openstack/images/%(image_id)s",
"flavor_ref" : "%(host)s/openstack/flavors/1",
"imageRef" : "%(host)s/openstack/images/%(image_id)s",
"flavorRef" : "%(host)s/openstack/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(host)s/openstack/images/%(image_id)s",
"flavor_ref" : "%(host)s/openstack/flavors/1",
"imageRef" : "%(host)s/openstack/images/%(image_id)s",
"flavorRef" : "%(host)s/openstack/flavors/1",
"os-availability-zone:availability_zone": "nova",
"metadata" : {
"My Server Name" : "Apache1"

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/openstack/images/%(image_id)s",
"flavor_ref" : "%(host)s/openstack/flavors/1",
"imageRef" : "%(glance_host)s/openstack/images/%(image_id)s",
"flavorRef" : "%(host)s/openstack/flavors/1",
"os-scheduler-hints:scheduler_hints": {
"same_host": "%(uuid)s"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/openstack/images/%(image_id)s",
"flavor_ref" : "%(host)s/openstack/flavors/1",
"imageRef" : "%(glance_host)s/openstack/images/%(image_id)s",
"flavorRef" : "%(host)s/openstack/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/openstack/images/%(image_id)s",
"flavor_ref" : "%(host)s/openstack/flavors/1",
"imageRef" : "%(glance_host)s/openstack/images/%(image_id)s",
"flavorRef" : "%(host)s/openstack/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(host)s/openstack/images/%(image_id)s",
"flavor_ref" : "%(host)s/openstack/flavors/1",
"imageRef" : "%(host)s/openstack/images/%(image_id)s",
"flavorRef" : "%(host)s/openstack/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
},

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}

View File

@ -1,6 +1,6 @@
{
"rebuild" : {
"image_ref" : "%(glance_host)s/images/%(uuid)s",
"imageRef" : "%(glance_host)s/images/%(uuid)s",
"name" : "%(name)s",
"adminPass" : "%(pass)s",
"metadata" : {

View File

@ -1,6 +1,6 @@
{
"rebuild" : {
"image_ref" : "%(glance_host)s/images/%(uuid)s",
"imageRef" : "%(glance_host)s/images/%(uuid)s",
"name" : "%(name)s",
"adminPass" : "%(pass)s",
"metadata" : {

View File

@ -1,5 +1,5 @@
{
"resize" : {
"flavor_ref" : "%(id)s"
"flavorRef" : "%(id)s"
}
}

View File

@ -1,8 +1,8 @@
{
"server" : {
"name" : "new-server-test",
"image_ref" : "%(glance_host)s/images/%(image_id)s",
"flavor_ref" : "%(host)s/flavors/1",
"imageRef" : "%(glance_host)s/images/%(image_id)s",
"flavorRef" : "%(host)s/flavors/1",
"metadata" : {
"My Server Name" : "Apache1"
}