From 8d43c3fba1a5e07703cae6f7b631d0787c4f41bb Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Tue, 18 Sep 2012 12:02:50 -0700 Subject: Makes scheduler hints and disk config xml correct The scheduler hints and disk config extensions were not using proper prefixes when deserializing xml. This patch modifes them to deserialize properly. It leaves the old deserialization in place as well so anyone using the broken implementation will continue to work. It also updates the api samples to use the new format. Note that the proper fix required changing the alias for the scheduler hints extension, since the alias is used for xml, so the samples had to be moved. Finally it fixes an issue with deserialization, allowing it to support multiple hints with the same name. Part of bug 1050997 Change-Id: I9969582d65d44de25388f07b6d2013fb7d093fb2 --- .../OS-SCH-HNT/scheduler-hints-post-req.json | 11 +++++++++++ .../OS-SCH-HNT/scheduler-hints-post-req.xml | 12 ++++++++++++ .../OS-SCH-HNT/scheduler-hints-post-resp.json | 16 ++++++++++++++++ .../OS-SCH-HNT/scheduler-hints-post-resp.xml | 6 ++++++ .../all_extensions/extensions-get-resp.json | 18 +++++++++--------- doc/api_samples/all_extensions/extensions-get-resp.xml | 8 ++++---- .../os-scheduler-hints/scheduler-hints-post-req.json | 11 ----------- .../os-scheduler-hints/scheduler-hints-post-req.xml | 10 ---------- .../os-scheduler-hints/scheduler-hints-post-resp.json | 16 ---------------- .../os-scheduler-hints/scheduler-hints-post-resp.xml | 6 ------ 10 files changed, 58 insertions(+), 56 deletions(-) create mode 100644 doc/api_samples/OS-SCH-HNT/scheduler-hints-post-req.json create mode 100644 doc/api_samples/OS-SCH-HNT/scheduler-hints-post-req.xml create mode 100644 doc/api_samples/OS-SCH-HNT/scheduler-hints-post-resp.json create mode 100644 doc/api_samples/OS-SCH-HNT/scheduler-hints-post-resp.xml delete mode 100644 doc/api_samples/os-scheduler-hints/scheduler-hints-post-req.json delete mode 100644 doc/api_samples/os-scheduler-hints/scheduler-hints-post-req.xml delete mode 100644 doc/api_samples/os-scheduler-hints/scheduler-hints-post-resp.json delete mode 100644 doc/api_samples/os-scheduler-hints/scheduler-hints-post-resp.xml (limited to 'doc') diff --git a/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-req.json b/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-req.json new file mode 100644 index 000000000..3e437e63f --- /dev/null +++ b/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-req.json @@ -0,0 +1,11 @@ +{ + "server": { + "name": "new-server-test", + "imageRef": "70a599e0-31e7-49b7-b260-868f441e862b", + "flavorRef": "1" + }, + "os:scheduler_hints": { + "hypervisor": "xen", + "near": "2b7c42eb-7736-4a0f-afab-f23969a35ada" + } +} \ No newline at end of file diff --git a/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-req.xml b/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-req.xml new file mode 100644 index 000000000..66843fae3 --- /dev/null +++ b/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-req.xml @@ -0,0 +1,12 @@ + + + xen + eb999657-dd6b-464e-8713-95c532ac3b18 + + diff --git a/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-resp.json b/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-resp.json new file mode 100644 index 000000000..cc3a87316 --- /dev/null +++ b/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-resp.json @@ -0,0 +1,16 @@ +{ + "server": { + "adminPass": "yjzytFHb7XHc", + "id": "f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45", + "links": [ + { + "href": "http://openstack.example.com/v2/openstack/servers/f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45", + "rel": "self" + }, + { + "href": "http://openstack.example.com/openstack/servers/f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45", + "rel": "bookmark" + } + ] + } +} \ No newline at end of file diff --git a/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-resp.xml b/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-resp.xml new file mode 100644 index 000000000..59929d808 --- /dev/null +++ b/doc/api_samples/OS-SCH-HNT/scheduler-hints-post-resp.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/doc/api_samples/all_extensions/extensions-get-resp.json b/doc/api_samples/all_extensions/extensions-get-resp.json index 22eb1e207..e459340d5 100644 --- a/doc/api_samples/all_extensions/extensions-get-resp.json +++ b/doc/api_samples/all_extensions/extensions-get-resp.json @@ -48,6 +48,14 @@ "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_data/api/v1.1", "updated": "2011-09-14T00:00:00+00:00" }, + { + "alias": "OS-SCH-HNT", + "description": "Pass arbitrary key/value pairs to the scheduler", + "links": [], + "name": "SchedulerHints", + "namespace": "http://docs.openstack.org/compute/ext/scheduler-hints/api/v2", + "updated": "2011-07-19T00:00:00+00:00" + }, { "alias": "os-admin-actions", "description": "Enable admin-only server actions\n\n Actions include: pause, unpause, suspend, resume, migrate,\n resetNetwork, injectNetworkInfo, lock, unlock, createBackup\n ", @@ -264,14 +272,6 @@ "namespace": "http://docs.openstack.org/compute/ext/rescue/api/v1.1", "updated": "2011-08-18T00:00:00+00:00" }, - { - "alias": "os-scheduler-hints", - "description": "Pass arbitrary key/value pairs to the scheduler", - "links": [], - "name": "SchedulerHints", - "namespace": "http://docs.openstack.org/compute/ext/scheduler-hints/api/v2", - "updated": "2011-07-19T00:00:00+00:00" - }, { "alias": "os-security-groups", "description": "Security group support", @@ -345,4 +345,4 @@ "updated": "2011-03-25T00:00:00+00:00" } ] -} \ No newline at end of file +} diff --git a/doc/api_samples/all_extensions/extensions-get-resp.xml b/doc/api_samples/all_extensions/extensions-get-resp.xml index 4532244d9..0ecb97c6f 100644 --- a/doc/api_samples/all_extensions/extensions-get-resp.xml +++ b/doc/api_samples/all_extensions/extensions-get-resp.xml @@ -18,6 +18,9 @@ Provide additional data for flavors + + Pass arbitrary key/value pairs to the scheduler + Enable admin-only server actions @@ -113,9 +116,6 @@ Instance rescue mode - - Pass arbitrary key/value pairs to the scheduler - Security group support @@ -143,4 +143,4 @@ Volumes support - \ No newline at end of file + diff --git a/doc/api_samples/os-scheduler-hints/scheduler-hints-post-req.json b/doc/api_samples/os-scheduler-hints/scheduler-hints-post-req.json deleted file mode 100644 index 3e437e63f..000000000 --- a/doc/api_samples/os-scheduler-hints/scheduler-hints-post-req.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "server": { - "name": "new-server-test", - "imageRef": "70a599e0-31e7-49b7-b260-868f441e862b", - "flavorRef": "1" - }, - "os:scheduler_hints": { - "hypervisor": "xen", - "near": "2b7c42eb-7736-4a0f-afab-f23969a35ada" - } -} \ No newline at end of file diff --git a/doc/api_samples/os-scheduler-hints/scheduler-hints-post-req.xml b/doc/api_samples/os-scheduler-hints/scheduler-hints-post-req.xml deleted file mode 100644 index 079289de0..000000000 --- a/doc/api_samples/os-scheduler-hints/scheduler-hints-post-req.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - xen - eb999657-dd6b-464e-8713-95c532ac3b18 - - \ No newline at end of file diff --git a/doc/api_samples/os-scheduler-hints/scheduler-hints-post-resp.json b/doc/api_samples/os-scheduler-hints/scheduler-hints-post-resp.json deleted file mode 100644 index cc3a87316..000000000 --- a/doc/api_samples/os-scheduler-hints/scheduler-hints-post-resp.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "server": { - "adminPass": "yjzytFHb7XHc", - "id": "f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45", - "links": [ - { - "href": "http://openstack.example.com/v2/openstack/servers/f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45", - "rel": "self" - }, - { - "href": "http://openstack.example.com/openstack/servers/f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45", - "rel": "bookmark" - } - ] - } -} \ No newline at end of file diff --git a/doc/api_samples/os-scheduler-hints/scheduler-hints-post-resp.xml b/doc/api_samples/os-scheduler-hints/scheduler-hints-post-resp.xml deleted file mode 100644 index 59929d808..000000000 --- a/doc/api_samples/os-scheduler-hints/scheduler-hints-post-resp.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file -- cgit