diff options
author | Dan Peschman <dpeschman@godaddy.com> | 2017-07-18 13:54:47 -0400 |
---|---|---|
committer | Matt Riedemann <mriedem.os@gmail.com> | 2017-07-18 15:39:57 -0400 |
commit | 2f7bf29d472d349759ffd8aece23a75f4e27a4f9 (patch) | |
tree | 1233123e800d2da2c8e3c7b2c2344780c28fbf91 /doc/api_samples | |
parent | 430ec6504b02c5fb69b3808f7e47cf44e865f104 (diff) | |
download | nova-2f7bf29d472d349759ffd8aece23a75f4e27a4f9.tar.gz |
Use uuid for id in os-services API
This patch introduces a new microversion to identify services by uuid
instead of id, to ensure uniqueness across cells. GET /os-services
returns uuid in the id field, and uuid must be provided to delete a
service with DELETE /os-services/{service_uuid}.
The old PUT /os-services/* APIs are now capped and replaced
with a new PUT /os-services/{service_uuid} which takes a uuid path
parameter to uniquely identify the service to update. It also restricts
updates to nova-compute services only, since disabling or forcing-down
a non-compute service like nova-scheduler doesn't make sense as it
doesn't do anything.
The new update() method in this microversion also avoids trying to
re-use the existing private action methods like _enable and _disable
since those are predicated on looking up the service by host/binary,
are confusing to follow for code flow, and just don't really make sense
with a pure PUT resource update method.
Part of blueprint service-hyper-uuid-in-api
Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>
Change-Id: I45494a4df7ee4454edb3ef8e7c5817d8c4e9e5ad
Diffstat (limited to 'doc/api_samples')
11 files changed, 115 insertions, 2 deletions
diff --git a/doc/api_samples/os-services/v2.53/service-disable-log-put-req.json b/doc/api_samples/os-services/v2.53/service-disable-log-put-req.json new file mode 100644 index 0000000000..6491f6316c --- /dev/null +++ b/doc/api_samples/os-services/v2.53/service-disable-log-put-req.json @@ -0,0 +1,4 @@ +{ + "status": "disabled", + "disabled_reason": "maintenance" +}
\ No newline at end of file diff --git a/doc/api_samples/os-services/v2.53/service-disable-log-put-resp.json b/doc/api_samples/os-services/v2.53/service-disable-log-put-resp.json new file mode 100644 index 0000000000..bbf18edaf1 --- /dev/null +++ b/doc/api_samples/os-services/v2.53/service-disable-log-put-resp.json @@ -0,0 +1,13 @@ +{ + "service": { + "id": "e81d66a4-ddd3-4aba-8a84-171d1cb4d339", + "binary": "nova-compute", + "disabled_reason": "maintenance", + "host": "host1", + "state": "up", + "status": "disabled", + "updated_at": "2012-10-29T13:42:05.000000", + "forced_down": false, + "zone": "nova" + } +}
\ No newline at end of file diff --git a/doc/api_samples/os-services/v2.53/service-disable-put-req.json b/doc/api_samples/os-services/v2.53/service-disable-put-req.json new file mode 100644 index 0000000000..c39c93446a --- /dev/null +++ b/doc/api_samples/os-services/v2.53/service-disable-put-req.json @@ -0,0 +1,3 @@ +{ + "status": "disabled" +}
\ No newline at end of file diff --git a/doc/api_samples/os-services/v2.53/service-disable-put-resp.json b/doc/api_samples/os-services/v2.53/service-disable-put-resp.json new file mode 100644 index 0000000000..5f05d3002e --- /dev/null +++ b/doc/api_samples/os-services/v2.53/service-disable-put-resp.json @@ -0,0 +1,13 @@ +{ + "service": { + "id": "e81d66a4-ddd3-4aba-8a84-171d1cb4d339", + "binary": "nova-compute", + "disabled_reason": null, + "host": "host1", + "state": "up", + "status": "disabled", + "updated_at": "2012-10-29T13:42:05.000000", + "forced_down": false, + "zone": "nova" + } +}
\ No newline at end of file diff --git a/doc/api_samples/os-services/v2.53/service-enable-put-req.json b/doc/api_samples/os-services/v2.53/service-enable-put-req.json new file mode 100644 index 0000000000..274ae2d6b3 --- /dev/null +++ b/doc/api_samples/os-services/v2.53/service-enable-put-req.json @@ -0,0 +1,3 @@ +{ + "status": "enabled" +}
\ No newline at end of file diff --git a/doc/api_samples/os-services/v2.53/service-enable-put-resp.json b/doc/api_samples/os-services/v2.53/service-enable-put-resp.json new file mode 100644 index 0000000000..b301843949 --- /dev/null +++ b/doc/api_samples/os-services/v2.53/service-enable-put-resp.json @@ -0,0 +1,13 @@ +{ + "service": { + "id": "e81d66a4-ddd3-4aba-8a84-171d1cb4d339", + "binary": "nova-compute", + "disabled_reason": null, + "host": "host1", + "state": "up", + "status": "enabled", + "updated_at": "2012-10-29T13:42:05.000000", + "forced_down": false, + "zone": "nova" + } +}
\ No newline at end of file diff --git a/doc/api_samples/os-services/v2.53/service-force-down-put-req.json b/doc/api_samples/os-services/v2.53/service-force-down-put-req.json new file mode 100644 index 0000000000..1545475c8f --- /dev/null +++ b/doc/api_samples/os-services/v2.53/service-force-down-put-req.json @@ -0,0 +1,3 @@ +{ + "forced_down": true +}
\ No newline at end of file diff --git a/doc/api_samples/os-services/v2.53/service-force-down-put-resp.json b/doc/api_samples/os-services/v2.53/service-force-down-put-resp.json new file mode 100644 index 0000000000..cb37faeaaf --- /dev/null +++ b/doc/api_samples/os-services/v2.53/service-force-down-put-resp.json @@ -0,0 +1,13 @@ +{ + "service": { + "id": "e81d66a4-ddd3-4aba-8a84-171d1cb4d339", + "binary": "nova-compute", + "disabled_reason": "test2", + "host": "host1", + "state": "down", + "status": "disabled", + "updated_at": "2012-10-29T13:42:05.000000", + "forced_down": true, + "zone": "nova" + } +}
\ No newline at end of file diff --git a/doc/api_samples/os-services/v2.53/services-list-get-resp.json b/doc/api_samples/os-services/v2.53/services-list-get-resp.json new file mode 100644 index 0000000000..351908830a --- /dev/null +++ b/doc/api_samples/os-services/v2.53/services-list-get-resp.json @@ -0,0 +1,48 @@ +{ + "services": [ + { + "id": "c4726392-27de-4ff9-b2e0-5aa1d08a520f", + "binary": "nova-scheduler", + "disabled_reason": "test1", + "host": "host1", + "state": "up", + "status": "disabled", + "updated_at": "2012-10-29T13:42:02.000000", + "forced_down": false, + "zone": "internal" + }, + { + "id": "e81d66a4-ddd3-4aba-8a84-171d1cb4d339", + "binary": "nova-compute", + "disabled_reason": "test2", + "host": "host1", + "state": "up", + "status": "disabled", + "updated_at": "2012-10-29T13:42:05.000000", + "forced_down": false, + "zone": "nova" + }, + { + "id": "bbd684ff-d3f6-492e-a30a-a12a2d2db0e0", + "binary": "nova-scheduler", + "disabled_reason": null, + "host": "host2", + "state": "down", + "status": "enabled", + "updated_at": "2012-09-19T06:55:34.000000", + "forced_down": false, + "zone": "internal" + }, + { + "id": "13aa304e-5340-45a7-a7fb-b6d6e914d272", + "binary": "nova-compute", + "disabled_reason": "test4", + "host": "host2", + "state": "down", + "status": "disabled", + "updated_at": "2012-09-18T08:03:38.000000", + "forced_down": false, + "zone": "nova" + } + ] +} diff --git a/doc/api_samples/versions/v21-version-get-resp.json b/doc/api_samples/versions/v21-version-get-resp.json index 4e8809b178..1fc439ffae 100644 --- a/doc/api_samples/versions/v21-version-get-resp.json +++ b/doc/api_samples/versions/v21-version-get-resp.json @@ -19,7 +19,7 @@ } ], "status": "CURRENT", - "version": "2.52", + "version": "2.53", "min_version": "2.1", "updated": "2013-07-23T11:33:21Z" } diff --git a/doc/api_samples/versions/versions-get-resp.json b/doc/api_samples/versions/versions-get-resp.json index e3cc545b5d..f9965b4167 100644 --- a/doc/api_samples/versions/versions-get-resp.json +++ b/doc/api_samples/versions/versions-get-resp.json @@ -22,7 +22,7 @@ } ], "status": "CURRENT", - "version": "2.52", + "version": "2.53", "min_version": "2.1", "updated": "2013-07-23T11:33:21Z" } |