From d413c236edf0a65a08bc8008d22643e2575ee2b7 Mon Sep 17 00:00:00 2001 From: He Jie Xu Date: Wed, 28 Aug 2013 14:51:29 +0800 Subject: [PATCH] Adds V3 API samples for evacuate,ext-az,ext-serv-attrs Partially implements blueprint v3-api-unittests Partially implements blueprint v3-api-specification Change-Id: I340456ba688bad4a42d66247899ee9f494fb429c --- .../os-evacuate/server-evacuate-req.json | 7 +++ .../os-evacuate/server-evacuate-req.xml | 5 ++ .../os-evacuate/server-evacuate-resp.json | 3 + .../os-evacuate/server-evacuate-resp.xml | 2 + .../os-evacuate/server-post-req.json | 16 +++++ .../os-evacuate/server-post-req.xml | 19 ++++++ .../os-evacuate/server-post-resp.json | 16 +++++ .../os-evacuate/server-post-resp.xml | 6 ++ .../server-get-resp.json | 58 +++++++++++++++++ .../server-get-resp.xml | 19 ++++++ .../server-post-req.json | 16 +++++ .../server-post-req.xml | 19 ++++++ .../server-post-resp.json | 16 +++++ .../server-post-resp.xml | 6 ++ .../servers-detail-resp.json | 60 ++++++++++++++++++ .../servers-detail-resp.xml | 21 +++++++ .../server-get-resp.json | 60 ++++++++++++++++++ .../server-get-resp.xml | 19 ++++++ .../server-post-req.json | 16 +++++ .../server-post-req.xml | 19 ++++++ .../server-post-resp.json | 16 +++++ .../server-post-resp.xml | 6 ++ .../servers-detail-resp.json | 62 +++++++++++++++++++ .../servers-detail-resp.xml | 21 +++++++ .../os-evacuate/server-evacuate-req.json.tpl | 7 +++ .../os-evacuate/server-evacuate-req.xml.tpl | 5 ++ .../os-evacuate/server-evacuate-resp.json.tpl | 3 + .../os-evacuate/server-evacuate-resp.xml.tpl | 1 + .../os-evacuate/server-post-req.json.tpl | 16 +++++ .../os-evacuate/server-post-req.xml.tpl | 19 ++++++ .../os-evacuate/server-post-resp.json.tpl | 16 +++++ .../os-evacuate/server-post-resp.xml.tpl | 6 ++ .../server-get-resp.json.tpl | 58 +++++++++++++++++ .../server-get-resp.xml.tpl | 19 ++++++ .../server-post-req.json.tpl | 16 +++++ .../server-post-req.xml.tpl | 19 ++++++ .../server-post-resp.json.tpl | 16 +++++ .../server-post-resp.xml.tpl | 6 ++ .../servers-detail-resp.json.tpl | 60 ++++++++++++++++++ .../servers-detail-resp.xml.tpl | 20 ++++++ .../server-get-resp.json.tpl | 60 ++++++++++++++++++ .../server-get-resp.xml.tpl | 19 ++++++ .../server-post-req.json.tpl | 16 +++++ .../server-post-req.xml.tpl | 19 ++++++ .../server-post-resp.json.tpl | 16 +++++ .../server-post-resp.xml.tpl | 6 ++ .../servers-detail-resp.json.tpl | 62 +++++++++++++++++++ .../servers-detail-resp.xml.tpl | 21 +++++++ .../servers/server-post-req.json.tpl | 2 +- .../servers/server-post-req.xml.tpl | 2 +- nova/tests/integrated/v3/test_evacuate.py | 58 +++++++++++++++++ .../v3/test_extended_availability_zone.py | 39 ++++++++++++ .../v3/test_extended_server_attributes.py | 47 ++++++++++++++ 53 files changed, 1160 insertions(+), 2 deletions(-) create mode 100644 doc/v3/api_samples/os-evacuate/server-evacuate-req.json create mode 100644 doc/v3/api_samples/os-evacuate/server-evacuate-req.xml create mode 100644 doc/v3/api_samples/os-evacuate/server-evacuate-resp.json create mode 100644 doc/v3/api_samples/os-evacuate/server-evacuate-resp.xml create mode 100644 doc/v3/api_samples/os-evacuate/server-post-req.json create mode 100644 doc/v3/api_samples/os-evacuate/server-post-req.xml create mode 100644 doc/v3/api_samples/os-evacuate/server-post-resp.json create mode 100644 doc/v3/api_samples/os-evacuate/server-post-resp.xml create mode 100644 doc/v3/api_samples/os-extended-availability-zone/server-get-resp.json create mode 100644 doc/v3/api_samples/os-extended-availability-zone/server-get-resp.xml create mode 100644 doc/v3/api_samples/os-extended-availability-zone/server-post-req.json create mode 100644 doc/v3/api_samples/os-extended-availability-zone/server-post-req.xml create mode 100644 doc/v3/api_samples/os-extended-availability-zone/server-post-resp.json create mode 100644 doc/v3/api_samples/os-extended-availability-zone/server-post-resp.xml create mode 100644 doc/v3/api_samples/os-extended-availability-zone/servers-detail-resp.json create mode 100644 doc/v3/api_samples/os-extended-availability-zone/servers-detail-resp.xml create mode 100644 doc/v3/api_samples/os-extended-server-attributes/server-get-resp.json create mode 100644 doc/v3/api_samples/os-extended-server-attributes/server-get-resp.xml create mode 100644 doc/v3/api_samples/os-extended-server-attributes/server-post-req.json create mode 100644 doc/v3/api_samples/os-extended-server-attributes/server-post-req.xml create mode 100644 doc/v3/api_samples/os-extended-server-attributes/server-post-resp.json create mode 100644 doc/v3/api_samples/os-extended-server-attributes/server-post-resp.xml create mode 100644 doc/v3/api_samples/os-extended-server-attributes/servers-detail-resp.json create mode 100644 doc/v3/api_samples/os-extended-server-attributes/servers-detail-resp.xml create mode 100644 nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-req.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-req.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-evacuate/server-post-req.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-evacuate/server-post-req.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-evacuate/server-post-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-evacuate/server-post-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-get-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-get-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-req.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-req.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-availability-zone/servers-detail-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-availability-zone/servers-detail-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-get-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-get-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-req.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-req.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-server-attributes/servers-detail-resp.json.tpl create mode 100644 nova/tests/integrated/v3/api_samples/os-extended-server-attributes/servers-detail-resp.xml.tpl create mode 100644 nova/tests/integrated/v3/test_evacuate.py create mode 100644 nova/tests/integrated/v3/test_extended_availability_zone.py create mode 100644 nova/tests/integrated/v3/test_extended_server_attributes.py diff --git a/doc/v3/api_samples/os-evacuate/server-evacuate-req.json b/doc/v3/api_samples/os-evacuate/server-evacuate-req.json new file mode 100644 index 0000000000..6d041f7da7 --- /dev/null +++ b/doc/v3/api_samples/os-evacuate/server-evacuate-req.json @@ -0,0 +1,7 @@ +{ + "evacuate": { + "host": "b419863b7d814906a68fb31703c0dbd6", + "admin_password": "MySecretPass", + "on_shared_storage": "False" + } +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-evacuate/server-evacuate-req.xml b/doc/v3/api_samples/os-evacuate/server-evacuate-req.xml new file mode 100644 index 0000000000..adfdf6127d --- /dev/null +++ b/doc/v3/api_samples/os-evacuate/server-evacuate-req.xml @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/doc/v3/api_samples/os-evacuate/server-evacuate-resp.json b/doc/v3/api_samples/os-evacuate/server-evacuate-resp.json new file mode 100644 index 0000000000..fcd865c043 --- /dev/null +++ b/doc/v3/api_samples/os-evacuate/server-evacuate-resp.json @@ -0,0 +1,3 @@ +{ + "admin_password": "MySecretPass" +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-evacuate/server-evacuate-resp.xml b/doc/v3/api_samples/os-evacuate/server-evacuate-resp.xml new file mode 100644 index 0000000000..cdb77b6821 --- /dev/null +++ b/doc/v3/api_samples/os-evacuate/server-evacuate-resp.xml @@ -0,0 +1,2 @@ + +MySecretPass \ No newline at end of file diff --git a/doc/v3/api_samples/os-evacuate/server-post-req.json b/doc/v3/api_samples/os-evacuate/server-post-req.json new file mode 100644 index 0000000000..33a7156562 --- /dev/null +++ b/doc/v3/api_samples/os-evacuate/server-post-req.json @@ -0,0 +1,16 @@ +{ + "server" : { + "name" : "new-server-test", + "image_ref" : "http://openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b", + "flavor_ref" : "http://openstack.example.com/flavors/1", + "metadata" : { + "My Server Name" : "Apache1" + }, + "personality" : [ + { + "path" : "/etc/banner.txt", + "contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA==" + } + ] + } +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-evacuate/server-post-req.xml b/doc/v3/api_samples/os-evacuate/server-post-req.xml new file mode 100644 index 0000000000..ac49b9cb61 --- /dev/null +++ b/doc/v3/api_samples/os-evacuate/server-post-req.xml @@ -0,0 +1,19 @@ + + + + Apache1 + + + + ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp + dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k + IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs + c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g + QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo + ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv + dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy + c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 + b25zLiINCg0KLVJpY2hhcmQgQmFjaA== + + + \ No newline at end of file diff --git a/doc/v3/api_samples/os-evacuate/server-post-resp.json b/doc/v3/api_samples/os-evacuate/server-post-resp.json new file mode 100644 index 0000000000..d3d4b43b28 --- /dev/null +++ b/doc/v3/api_samples/os-evacuate/server-post-resp.json @@ -0,0 +1,16 @@ +{ + "server": { + "admin_pass": "xCQm2Cs2vSFx", + "id": "5f1fbc62-29ed-4e4a-9f15-8affc5e0a796", + "links": [ + { + "href": "http://openstack.example.com/v3/servers/5f1fbc62-29ed-4e4a-9f15-8affc5e0a796", + "rel": "self" + }, + { + "href": "http://openstack.example.com/servers/5f1fbc62-29ed-4e4a-9f15-8affc5e0a796", + "rel": "bookmark" + } + ] + } +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-evacuate/server-post-resp.xml b/doc/v3/api_samples/os-evacuate/server-post-resp.xml new file mode 100644 index 0000000000..4f13fd8e79 --- /dev/null +++ b/doc/v3/api_samples/os-evacuate/server-post-resp.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-availability-zone/server-get-resp.json b/doc/v3/api_samples/os-extended-availability-zone/server-get-resp.json new file mode 100644 index 0000000000..d2cde22f52 --- /dev/null +++ b/doc/v3/api_samples/os-extended-availability-zone/server-get-resp.json @@ -0,0 +1,58 @@ +{ + "server": { + "access_ip_v4": "", + "access_ip_v6": "", + "addresses": { + "private": [ + { + "addr": "192.168.0.3", + "mac_addr": "aa:bb:cc:dd:ee:ff", + "type": "fixed", + "version": 4 + } + ] + }, + "created": "2013-09-16T02:54:56Z", + "flavor": { + "id": "1", + "links": [ + { + "href": "http://openstack.example.com/flavors/1", + "rel": "bookmark" + } + ] + }, + "host_id": "b75d6736650f9b272223ceb48f4cde001de1856e381613a922117ab7", + "id": "f22e4521-d03a-4e9f-9fd3-016b9e227219", + "image": { + "id": "70a599e0-31e7-49b7-b260-868f441e862b", + "links": [ + { + "href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b", + "rel": "bookmark" + } + ] + }, + "key_name": null, + "links": [ + { + "href": "http://openstack.example.com/v3/servers/f22e4521-d03a-4e9f-9fd3-016b9e227219", + "rel": "self" + }, + { + "href": "http://openstack.example.com/servers/f22e4521-d03a-4e9f-9fd3-016b9e227219", + "rel": "bookmark" + } + ], + "metadata": { + "My Server Name": "Apache1" + }, + "name": "new-server-test", + "os-extended-availability-zone:availability_zone": "nova", + "progress": 0, + "status": "ACTIVE", + "tenant_id": "openstack", + "updated": "2013-09-16T02:54:57Z", + "user_id": "fake" + } +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-availability-zone/server-get-resp.xml b/doc/v3/api_samples/os-extended-availability-zone/server-get-resp.xml new file mode 100644 index 0000000000..24865f0cc1 --- /dev/null +++ b/doc/v3/api_samples/os-extended-availability-zone/server-get-resp.xml @@ -0,0 +1,19 @@ + + + + + + + + + + Apache1 + + + + + + + + + \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-availability-zone/server-post-req.json b/doc/v3/api_samples/os-extended-availability-zone/server-post-req.json new file mode 100644 index 0000000000..30851df41a --- /dev/null +++ b/doc/v3/api_samples/os-extended-availability-zone/server-post-req.json @@ -0,0 +1,16 @@ +{ + "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", + "metadata" : { + "My Server Name" : "Apache1" + }, + "personality" : [ + { + "path" : "/etc/banner.txt", + "contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA==" + } + ] + } +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-availability-zone/server-post-req.xml b/doc/v3/api_samples/os-extended-availability-zone/server-post-req.xml new file mode 100644 index 0000000000..24eabe8533 --- /dev/null +++ b/doc/v3/api_samples/os-extended-availability-zone/server-post-req.xml @@ -0,0 +1,19 @@ + + + + Apache1 + + + + ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp + dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k + IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs + c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g + QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo + ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv + dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy + c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 + b25zLiINCg0KLVJpY2hhcmQgQmFjaA== + + + \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-availability-zone/server-post-resp.json b/doc/v3/api_samples/os-extended-availability-zone/server-post-resp.json new file mode 100644 index 0000000000..00886622d8 --- /dev/null +++ b/doc/v3/api_samples/os-extended-availability-zone/server-post-resp.json @@ -0,0 +1,16 @@ +{ + "server": { + "admin_pass": "87taVVreqh6R", + "id": "f22e4521-d03a-4e9f-9fd3-016b9e227219", + "links": [ + { + "href": "http://openstack.example.com/v3/servers/f22e4521-d03a-4e9f-9fd3-016b9e227219", + "rel": "self" + }, + { + "href": "http://openstack.example.com/servers/f22e4521-d03a-4e9f-9fd3-016b9e227219", + "rel": "bookmark" + } + ] + } +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-availability-zone/server-post-resp.xml b/doc/v3/api_samples/os-extended-availability-zone/server-post-resp.xml new file mode 100644 index 0000000000..c55ec91403 --- /dev/null +++ b/doc/v3/api_samples/os-extended-availability-zone/server-post-resp.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-availability-zone/servers-detail-resp.json b/doc/v3/api_samples/os-extended-availability-zone/servers-detail-resp.json new file mode 100644 index 0000000000..125ecf5152 --- /dev/null +++ b/doc/v3/api_samples/os-extended-availability-zone/servers-detail-resp.json @@ -0,0 +1,60 @@ +{ + "servers": [ + { + "access_ip_v4": "", + "access_ip_v6": "", + "addresses": { + "private": [ + { + "addr": "192.168.0.3", + "mac_addr": "aa:bb:cc:dd:ee:ff", + "type": "fixed", + "version": 4 + } + ] + }, + "created": "2013-09-16T02:54:56Z", + "flavor": { + "id": "1", + "links": [ + { + "href": "http://openstack.example.com/flavors/1", + "rel": "bookmark" + } + ] + }, + "host_id": "cf5540800371e53064a60b36ff9d6d1d6a8719ffc870c63a270c6bee", + "id": "55f43fa2-dc7c-4c0b-b21a-76f9abe516f9", + "image": { + "id": "70a599e0-31e7-49b7-b260-868f441e862b", + "links": [ + { + "href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b", + "rel": "bookmark" + } + ] + }, + "key_name": null, + "links": [ + { + "href": "http://openstack.example.com/v3/servers/55f43fa2-dc7c-4c0b-b21a-76f9abe516f9", + "rel": "self" + }, + { + "href": "http://openstack.example.com/servers/55f43fa2-dc7c-4c0b-b21a-76f9abe516f9", + "rel": "bookmark" + } + ], + "metadata": { + "My Server Name": "Apache1" + }, + "name": "new-server-test", + "os-extended-availability-zone:availability_zone": "nova", + "progress": 0, + "status": "ACTIVE", + "tenant_id": "openstack", + "updated": "2013-09-16T02:54:58Z", + "user_id": "fake" + } + ] +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-availability-zone/servers-detail-resp.xml b/doc/v3/api_samples/os-extended-availability-zone/servers-detail-resp.xml new file mode 100644 index 0000000000..4584514151 --- /dev/null +++ b/doc/v3/api_samples/os-extended-availability-zone/servers-detail-resp.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + Apache1 + + + + + + + + + + \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-server-attributes/server-get-resp.json b/doc/v3/api_samples/os-extended-server-attributes/server-get-resp.json new file mode 100644 index 0000000000..769826a014 --- /dev/null +++ b/doc/v3/api_samples/os-extended-server-attributes/server-get-resp.json @@ -0,0 +1,60 @@ +{ + "server": { + "access_ip_v4": "", + "access_ip_v6": "", + "addresses": { + "private": [ + { + "addr": "192.168.0.3", + "mac_addr": "aa:bb:cc:dd:ee:ff", + "type": "fixed", + "version": 4 + } + ] + }, + "created": "2013-09-16T02:55:07Z", + "flavor": { + "id": "1", + "links": [ + { + "href": "http://openstack.example.com/flavors/1", + "rel": "bookmark" + } + ] + }, + "host_id": "3bf189131c61d0e71b0a8686a897a0f50d1693b48c47b721fe77155b", + "id": "c278163e-36f9-4cf2-b1ac-80db4c63f7a8", + "image": { + "id": "70a599e0-31e7-49b7-b260-868f441e862b", + "links": [ + { + "href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b", + "rel": "bookmark" + } + ] + }, + "key_name": null, + "links": [ + { + "href": "http://openstack.example.com/v3/servers/c278163e-36f9-4cf2-b1ac-80db4c63f7a8", + "rel": "self" + }, + { + "href": "http://openstack.example.com/servers/c278163e-36f9-4cf2-b1ac-80db4c63f7a8", + "rel": "bookmark" + } + ], + "metadata": { + "My Server Name": "Apache1" + }, + "name": "new-server-test", + "os-extended-server-attributes:host": "c5f474bf81474f9dbbc404d5b2e4e9b3", + "os-extended-server-attributes:hypervisor_hostname": "fake-mini", + "os-extended-server-attributes:instance_name": "instance-00000001", + "progress": 0, + "status": "ACTIVE", + "tenant_id": "openstack", + "updated": "2013-09-16T02:55:08Z", + "user_id": "fake" + } +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-server-attributes/server-get-resp.xml b/doc/v3/api_samples/os-extended-server-attributes/server-get-resp.xml new file mode 100644 index 0000000000..3e919b8035 --- /dev/null +++ b/doc/v3/api_samples/os-extended-server-attributes/server-get-resp.xml @@ -0,0 +1,19 @@ + + + + + + + + + + Apache1 + + + + + + + + + \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-server-attributes/server-post-req.json b/doc/v3/api_samples/os-extended-server-attributes/server-post-req.json new file mode 100644 index 0000000000..30851df41a --- /dev/null +++ b/doc/v3/api_samples/os-extended-server-attributes/server-post-req.json @@ -0,0 +1,16 @@ +{ + "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", + "metadata" : { + "My Server Name" : "Apache1" + }, + "personality" : [ + { + "path" : "/etc/banner.txt", + "contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA==" + } + ] + } +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-server-attributes/server-post-req.xml b/doc/v3/api_samples/os-extended-server-attributes/server-post-req.xml new file mode 100644 index 0000000000..24eabe8533 --- /dev/null +++ b/doc/v3/api_samples/os-extended-server-attributes/server-post-req.xml @@ -0,0 +1,19 @@ + + + + Apache1 + + + + ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp + dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k + IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs + c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g + QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo + ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv + dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy + c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 + b25zLiINCg0KLVJpY2hhcmQgQmFjaA== + + + \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-server-attributes/server-post-resp.json b/doc/v3/api_samples/os-extended-server-attributes/server-post-resp.json new file mode 100644 index 0000000000..195707a5f5 --- /dev/null +++ b/doc/v3/api_samples/os-extended-server-attributes/server-post-resp.json @@ -0,0 +1,16 @@ +{ + "server": { + "admin_pass": "UCvmH8nHXm66", + "id": "a8c1c13d-ec7e-47c7-b4ff-077f72c1ca46", + "links": [ + { + "href": "http://openstack.example.com/v3/servers/a8c1c13d-ec7e-47c7-b4ff-077f72c1ca46", + "rel": "self" + }, + { + "href": "http://openstack.example.com/servers/a8c1c13d-ec7e-47c7-b4ff-077f72c1ca46", + "rel": "bookmark" + } + ] + } +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-server-attributes/server-post-resp.xml b/doc/v3/api_samples/os-extended-server-attributes/server-post-resp.xml new file mode 100644 index 0000000000..195bc1b52a --- /dev/null +++ b/doc/v3/api_samples/os-extended-server-attributes/server-post-resp.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-server-attributes/servers-detail-resp.json b/doc/v3/api_samples/os-extended-server-attributes/servers-detail-resp.json new file mode 100644 index 0000000000..4c36d7d09c --- /dev/null +++ b/doc/v3/api_samples/os-extended-server-attributes/servers-detail-resp.json @@ -0,0 +1,62 @@ +{ + "servers": [ + { + "access_ip_v4": "", + "access_ip_v6": "", + "addresses": { + "private": [ + { + "addr": "192.168.0.3", + "mac_addr": "aa:bb:cc:dd:ee:ff", + "type": "fixed", + "version": 4 + } + ] + }, + "created": "2013-09-16T02:55:03Z", + "flavor": { + "id": "1", + "links": [ + { + "href": "http://openstack.example.com/flavors/1", + "rel": "bookmark" + } + ] + }, + "host_id": "63cf07a9fd82e1d2294926ec5c0d2e1e0ca449224246df75e16f23dc", + "id": "a8c1c13d-ec7e-47c7-b4ff-077f72c1ca46", + "image": { + "id": "70a599e0-31e7-49b7-b260-868f441e862b", + "links": [ + { + "href": "http://glance.openstack.example.com/images/70a599e0-31e7-49b7-b260-868f441e862b", + "rel": "bookmark" + } + ] + }, + "key_name": null, + "links": [ + { + "href": "http://openstack.example.com/v3/servers/a8c1c13d-ec7e-47c7-b4ff-077f72c1ca46", + "rel": "self" + }, + { + "href": "http://openstack.example.com/servers/a8c1c13d-ec7e-47c7-b4ff-077f72c1ca46", + "rel": "bookmark" + } + ], + "metadata": { + "My Server Name": "Apache1" + }, + "name": "new-server-test", + "os-extended-server-attributes:host": "bc8efe4fdb7148a4bb921a2b03d17de6", + "os-extended-server-attributes:hypervisor_hostname": "fake-mini", + "os-extended-server-attributes:instance_name": "instance-00000001", + "progress": 0, + "status": "ACTIVE", + "tenant_id": "openstack", + "updated": "2013-09-16T02:55:05Z", + "user_id": "fake" + } + ] +} \ No newline at end of file diff --git a/doc/v3/api_samples/os-extended-server-attributes/servers-detail-resp.xml b/doc/v3/api_samples/os-extended-server-attributes/servers-detail-resp.xml new file mode 100644 index 0000000000..7f7625eb1b --- /dev/null +++ b/doc/v3/api_samples/os-extended-server-attributes/servers-detail-resp.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + Apache1 + + + + + + + + + + \ No newline at end of file diff --git a/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-req.json.tpl new file mode 100644 index 0000000000..3639d1ed8e --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-req.json.tpl @@ -0,0 +1,7 @@ +{ + "evacuate": { + "host": "%(host)s", + "admin_password": "%(adminPass)s", + "on_shared_storage": "%(onSharedStorage)s" + } +} diff --git a/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-req.xml.tpl new file mode 100644 index 0000000000..4c0e0f0462 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-req.xml.tpl @@ -0,0 +1,5 @@ + + diff --git a/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-resp.json.tpl new file mode 100644 index 0000000000..e6d6ad9ed1 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-resp.json.tpl @@ -0,0 +1,3 @@ +{ + "admin_password": "%(password)s" +} diff --git a/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-resp.xml.tpl new file mode 100644 index 0000000000..50c7386a7f --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-evacuate/server-evacuate-resp.xml.tpl @@ -0,0 +1 @@ +%(password)s \ No newline at end of file diff --git a/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-req.json.tpl new file mode 100644 index 0000000000..2a8c020df3 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-req.json.tpl @@ -0,0 +1,16 @@ +{ + "server" : { + "name" : "new-server-test", + "image_ref" : "%(host)s/images/%(image_id)s", + "flavor_ref" : "%(host)s/flavors/1", + "metadata" : { + "My Server Name" : "Apache1" + }, + "personality" : [ + { + "path" : "/etc/banner.txt", + "contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA==" + } + ] + } +} diff --git a/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-req.xml.tpl new file mode 100644 index 0000000000..14f6bfdc89 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-req.xml.tpl @@ -0,0 +1,19 @@ + + + + Apache1 + + + + ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp + dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k + IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs + c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g + QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo + ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv + dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy + c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 + b25zLiINCg0KLVJpY2hhcmQgQmFjaA== + + + diff --git a/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-resp.json.tpl new file mode 100644 index 0000000000..d061e9cb2e --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-resp.json.tpl @@ -0,0 +1,16 @@ +{ + "server": { + "admin_pass": "%(password)s", + "id": "%(id)s", + "links": [ + { + "href": "%(host)s/v3/servers/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/servers/%(uuid)s", + "rel": "bookmark" + } + ] + } +} diff --git a/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-resp.xml.tpl new file mode 100644 index 0000000000..3470373e17 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-evacuate/server-post-resp.xml.tpl @@ -0,0 +1,6 @@ + + + + + + diff --git a/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-get-resp.json.tpl new file mode 100644 index 0000000000..9e1370437c --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-get-resp.json.tpl @@ -0,0 +1,58 @@ +{ + "server": { + "updated": "%(timestamp)s", + "created": "%(timestamp)s", + "os-extended-availability-zone:availability_zone": "nova", + "access_ip_v4": "", + "access_ip_v6": "", + "addresses": { + "private": [ + { + "addr": "%(ip)s", + "version": 4, + "mac_addr": "aa:bb:cc:dd:ee:ff", + "type": "fixed" + } + ] + }, + "flavor": { + "id": "1", + "links": [ + { + "href": "%(host)s/flavors/1", + "rel": "bookmark" + } + ] + }, + "host_id": "%(hostid)s", + "id": "%(uuid)s", + "image": { + "id": "%(uuid)s", + "links": [ + { + "href": "%(glance_host)s/images/%(uuid)s", + "rel": "bookmark" + } + ] + }, + "links": [ + { + "href": "%(host)s/v3/servers/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/servers/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": { + "My Server Name": "Apache1" + }, + "name": "new-server-test", + "progress": 0, + "status": "ACTIVE", + "tenant_id": "openstack", + "user_id": "fake", + "key_name": null + } +} diff --git a/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-get-resp.xml.tpl new file mode 100644 index 0000000000..4a05e0e67a --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-get-resp.xml.tpl @@ -0,0 +1,19 @@ + + + + + + + + + + Apache1 + + + + + + + + + diff --git a/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-req.json.tpl new file mode 100644 index 0000000000..e6c046ceb4 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-req.json.tpl @@ -0,0 +1,16 @@ +{ + "server" : { + "name" : "new-server-test", + "image_ref" : "%(glance_host)s/images/%(image_id)s", + "flavor_ref" : "%(host)s/flavors/1", + "metadata" : { + "My Server Name" : "Apache1" + }, + "personality" : [ + { + "path" : "/etc/banner.txt", + "contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA==" + } + ] + } +} diff --git a/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-req.xml.tpl new file mode 100644 index 0000000000..31892a3c1f --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-req.xml.tpl @@ -0,0 +1,19 @@ + + + + Apache1 + + + + ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp + dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k + IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs + c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g + QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo + ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv + dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy + c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 + b25zLiINCg0KLVJpY2hhcmQgQmFjaA== + + + diff --git a/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-resp.json.tpl new file mode 100644 index 0000000000..d061e9cb2e --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-resp.json.tpl @@ -0,0 +1,16 @@ +{ + "server": { + "admin_pass": "%(password)s", + "id": "%(id)s", + "links": [ + { + "href": "%(host)s/v3/servers/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/servers/%(uuid)s", + "rel": "bookmark" + } + ] + } +} diff --git a/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-resp.xml.tpl new file mode 100644 index 0000000000..3470373e17 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/server-post-resp.xml.tpl @@ -0,0 +1,6 @@ + + + + + + diff --git a/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/servers-detail-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/servers-detail-resp.json.tpl new file mode 100644 index 0000000000..cb87232626 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/servers-detail-resp.json.tpl @@ -0,0 +1,60 @@ +{ + "servers": [ + { + "updated": "%(timestamp)s", + "created": "%(timestamp)s", + "os-extended-availability-zone:availability_zone": "nova", + "access_ip_v4": "", + "access_ip_v6": "", + "addresses": { + "private": [ + { + "addr": "%(ip)s", + "version": 4, + "mac_addr": "aa:bb:cc:dd:ee:ff", + "type": "fixed" + } + ] + }, + "flavor": { + "id": "1", + "links": [ + { + "href": "%(host)s/flavors/1", + "rel": "bookmark" + } + ] + }, + "host_id": "%(hostid)s", + "id": "%(uuid)s", + "image": { + "id": "%(uuid)s", + "links": [ + { + "href": "%(glance_host)s/images/%(uuid)s", + "rel": "bookmark" + } + ] + }, + "links": [ + { + "href": "%(host)s/v3/servers/%(id)s", + "rel": "self" + }, + { + "href": "%(host)s/servers/%(id)s", + "rel": "bookmark" + } + ], + "metadata": { + "My Server Name": "Apache1" + }, + "name": "new-server-test", + "progress": 0, + "status": "ACTIVE", + "tenant_id": "openstack", + "user_id": "fake", + "key_name": null + } + ] +} diff --git a/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/servers-detail-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/servers-detail-resp.xml.tpl new file mode 100644 index 0000000000..5695ef6453 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-availability-zone/servers-detail-resp.xml.tpl @@ -0,0 +1,20 @@ + + + + + + + + + + Apache1 + + + + + + + + + + diff --git a/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-get-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-get-resp.json.tpl new file mode 100644 index 0000000000..7efc1d0cb2 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-get-resp.json.tpl @@ -0,0 +1,60 @@ +{ + "server": { + "os-extended-server-attributes:host": "%(compute_host)s", + "os-extended-server-attributes:hypervisor_hostname": "%(hypervisor_hostname)s", + "os-extended-server-attributes:instance_name": "%(instance_name)s", + "updated": "%(timestamp)s", + "created": "%(timestamp)s", + "access_ip_v4": "", + "access_ip_v6": "", + "addresses": { + "private": [ + { + "addr": "%(ip)s", + "version": 4, + "mac_addr": "aa:bb:cc:dd:ee:ff", + "type": "fixed" + } + ] + }, + "flavor": { + "id": "1", + "links": [ + { + "href": "%(host)s/flavors/1", + "rel": "bookmark" + } + ] + }, + "host_id": "%(hostid)s", + "id": "%(uuid)s", + "image": { + "id": "%(uuid)s", + "links": [ + { + "href": "%(glance_host)s/images/%(uuid)s", + "rel": "bookmark" + } + ] + }, + "links": [ + { + "href": "%(host)s/v3/servers/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/servers/%(uuid)s", + "rel": "bookmark" + } + ], + "metadata": { + "My Server Name": "Apache1" + }, + "name": "new-server-test", + "progress": 0, + "status": "ACTIVE", + "tenant_id": "openstack", + "user_id": "fake", + "key_name": null + } +} \ No newline at end of file diff --git a/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-get-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-get-resp.xml.tpl new file mode 100644 index 0000000000..15e676bec2 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-get-resp.xml.tpl @@ -0,0 +1,19 @@ + + + + + + + + + + Apache1 + + + + + + + + + \ No newline at end of file diff --git a/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-req.json.tpl new file mode 100644 index 0000000000..e6c046ceb4 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-req.json.tpl @@ -0,0 +1,16 @@ +{ + "server" : { + "name" : "new-server-test", + "image_ref" : "%(glance_host)s/images/%(image_id)s", + "flavor_ref" : "%(host)s/flavors/1", + "metadata" : { + "My Server Name" : "Apache1" + }, + "personality" : [ + { + "path" : "/etc/banner.txt", + "contents" : "ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA==" + } + ] + } +} diff --git a/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-req.xml.tpl new file mode 100644 index 0000000000..31892a3c1f --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-req.xml.tpl @@ -0,0 +1,19 @@ + + + + Apache1 + + + + ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBp + dCBtb3ZlcyBpbiBqdXN0IHN1Y2ggYSBkaXJlY3Rpb24gYW5k + IGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVs + c2lvbi4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4g + QnV0IHRoZSBza3kga25vd3MgdGhlIHJlYXNvbnMgYW5kIHRo + ZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlv + dSB3aWxsIGtub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vy + c2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b25kIGhvcml6 + b25zLiINCg0KLVJpY2hhcmQgQmFjaA== + + + diff --git a/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-resp.json.tpl new file mode 100644 index 0000000000..d061e9cb2e --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-resp.json.tpl @@ -0,0 +1,16 @@ +{ + "server": { + "admin_pass": "%(password)s", + "id": "%(id)s", + "links": [ + { + "href": "%(host)s/v3/servers/%(uuid)s", + "rel": "self" + }, + { + "href": "%(host)s/servers/%(uuid)s", + "rel": "bookmark" + } + ] + } +} diff --git a/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-resp.xml.tpl new file mode 100644 index 0000000000..3470373e17 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/server-post-resp.xml.tpl @@ -0,0 +1,6 @@ + + + + + + diff --git a/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/servers-detail-resp.json.tpl b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/servers-detail-resp.json.tpl new file mode 100644 index 0000000000..8f2c195fa5 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/servers-detail-resp.json.tpl @@ -0,0 +1,62 @@ +{ + "servers": [ + { + "os-extended-server-attributes:host": "%(compute_host)s", + "os-extended-server-attributes:hypervisor_hostname": "%(hypervisor_hostname)s", + "os-extended-server-attributes:instance_name": "%(instance_name)s", + "updated": "%(timestamp)s", + "created": "%(timestamp)s", + "access_ip_v4": "", + "access_ip_v6": "", + "addresses": { + "private": [ + { + "addr": "%(ip)s", + "version": 4, + "mac_addr": "aa:bb:cc:dd:ee:ff", + "type": "fixed" + } + ] + }, + "flavor": { + "id": "1", + "links": [ + { + "href": "%(host)s/flavors/1", + "rel": "bookmark" + } + ] + }, + "host_id": "%(hostid)s", + "id": "%(uuid)s", + "image": { + "id": "%(uuid)s", + "links": [ + { + "href": "%(glance_host)s/images/%(uuid)s", + "rel": "bookmark" + } + ] + }, + "links": [ + { + "href": "%(host)s/v3/servers/%(id)s", + "rel": "self" + }, + { + "href": "%(host)s/servers/%(id)s", + "rel": "bookmark" + } + ], + "metadata": { + "My Server Name": "Apache1" + }, + "name": "new-server-test", + "progress": 0, + "status": "ACTIVE", + "tenant_id": "openstack", + "user_id": "fake", + "key_name": null + } + ] +} \ No newline at end of file diff --git a/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/servers-detail-resp.xml.tpl b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/servers-detail-resp.xml.tpl new file mode 100644 index 0000000000..7e31716633 --- /dev/null +++ b/nova/tests/integrated/v3/api_samples/os-extended-server-attributes/servers-detail-resp.xml.tpl @@ -0,0 +1,21 @@ + + + + + + + + + + + Apache1 + + + + + + + + + + diff --git a/nova/tests/integrated/v3/api_samples/servers/server-post-req.json.tpl b/nova/tests/integrated/v3/api_samples/servers/server-post-req.json.tpl index 1dcb63e3b2..b1013defdf 100644 --- a/nova/tests/integrated/v3/api_samples/servers/server-post-req.json.tpl +++ b/nova/tests/integrated/v3/api_samples/servers/server-post-req.json.tpl @@ -1,7 +1,7 @@ { "server" : { "name" : "new-server-test", - "image_ref" : "%(host)s/openstack/images/%(image_id)s", + "image_ref" : "%(glance_host)s/openstack/images/%(image_id)s", "flavor_ref" : "%(host)s/openstack/flavors/1", "metadata" : { "My Server Name" : "Apache1" diff --git a/nova/tests/integrated/v3/api_samples/servers/server-post-req.xml.tpl b/nova/tests/integrated/v3/api_samples/servers/server-post-req.xml.tpl index ddb5ea78c4..c7c6e31bb5 100644 --- a/nova/tests/integrated/v3/api_samples/servers/server-post-req.xml.tpl +++ b/nova/tests/integrated/v3/api_samples/servers/server-post-req.xml.tpl @@ -1,5 +1,5 @@ - + Apache1 diff --git a/nova/tests/integrated/v3/test_evacuate.py b/nova/tests/integrated/v3/test_evacuate.py new file mode 100644 index 0000000000..c6cefa572a --- /dev/null +++ b/nova/tests/integrated/v3/test_evacuate.py @@ -0,0 +1,58 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# Copyright 2012 Nebula, Inc. +# Copyright 2013 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from nova.compute import api as compute_api +from nova.servicegroup import api as service_group_api +from nova.tests.integrated.v3 import test_servers + + +class EvacuateJsonTest(test_servers.ServersSampleBase): + extension_name = "os-evacuate" + + def test_server_evacuate(self): + uuid = self._post_server() + + req_subs = { + 'host': self.compute.host, + "adminPass": "MySecretPass", + "onSharedStorage": 'False' + } + + def fake_service_is_up(self, service): + """Simulate validation of instance host is down.""" + return False + + def fake_service_get_by_compute_host(self, context, host): + """Simulate that given host is a valid host.""" + return { + 'host_name': host, + 'service': 'compute', + 'zone': 'nova' + } + + self.stubs.Set(service_group_api.API, 'service_is_up', + fake_service_is_up) + self.stubs.Set(compute_api.HostAPI, 'service_get_by_compute_host', + fake_service_get_by_compute_host) + + response = self._do_post('servers/%s/action' % uuid, + 'server-evacuate-req', req_subs) + subs = self._get_regexes() + self._verify_response('server-evacuate-resp', subs, response, 200) + + +class EvacuateXmlTest(EvacuateJsonTest): + ctype = 'xml' diff --git a/nova/tests/integrated/v3/test_extended_availability_zone.py b/nova/tests/integrated/v3/test_extended_availability_zone.py new file mode 100644 index 0000000000..dc84f5bac4 --- /dev/null +++ b/nova/tests/integrated/v3/test_extended_availability_zone.py @@ -0,0 +1,39 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# Copyright 2012 Nebula, Inc. +# Copyright 2013 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from nova.tests.integrated.v3 import test_servers + + +class ExtendedAvailabilityZoneJsonTests(test_servers.ServersSampleBase): + extension_name = "os-extended-availability-zone" + + def test_show(self): + uuid = self._post_server() + response = self._do_get('servers/%s' % uuid) + subs = self._get_regexes() + subs['hostid'] = '[a-f0-9]+' + self._verify_response('server-get-resp', subs, response, 200) + + def test_detail(self): + self._post_server() + response = self._do_get('servers/detail') + subs = self._get_regexes() + subs['hostid'] = '[a-f0-9]+' + self._verify_response('servers-detail-resp', subs, response, 200) + + +class ExtendedAvailabilityZoneXmlTests(ExtendedAvailabilityZoneJsonTests): + ctype = 'xml' diff --git a/nova/tests/integrated/v3/test_extended_server_attributes.py b/nova/tests/integrated/v3/test_extended_server_attributes.py new file mode 100644 index 0000000000..46ed7b7c3c --- /dev/null +++ b/nova/tests/integrated/v3/test_extended_server_attributes.py @@ -0,0 +1,47 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# Copyright 2012 Nebula, Inc. +# Copyright 2013 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from nova.tests.integrated.v3 import test_servers + + +class ExtendedServerAttributesJsonTest(test_servers.ServersSampleBase): + extension_name = "os-extended-server-attributes" + + def test_show(self): + uuid = self._post_server() + + response = self._do_get('servers/%s' % uuid) + subs = self._get_regexes() + subs['hostid'] = '[a-f0-9]+' + subs['id'] = uuid + subs['instance_name'] = 'instance-\d{8}' + subs['hypervisor_hostname'] = r'[\w\.\-]+' + self._verify_response('server-get-resp', subs, response, 200) + + def test_detail(self): + uuid = self._post_server() + + response = self._do_get('servers/detail') + subs = self._get_regexes() + subs['hostid'] = '[a-f0-9]+' + subs['id'] = uuid + subs['instance_name'] = 'instance-\d{8}' + subs['hypervisor_hostname'] = r'[\w\.\-]+' + self._verify_response('servers-detail-resp', subs, response, 200) + + +class ExtendedServerAttributesXmlTest(ExtendedServerAttributesJsonTest): + ctype = 'xml'