50 Commits

Author SHA1 Message Date
Zuul
7730395cdf Merge "[placement]Enhance doc for placement allocation list" 2017-12-05 13:32:38 +00:00
Zuul
f79aa34529 Merge "Add description for resource class creation" 2017-12-05 13:16:59 +00:00
Takashi NATSUME
af7149f926 [placement] Add aggregate link note in API ref
The aggregate link has been added in resource provider APIs
since microversion 1.1.
But the note is missing in Placement API reference.
Add the note.

The allocations link is missing in the response example
of "Update resource provider" API.
Add it as well.

Change-Id: I325ff34c8b436429c2a2623cf1fb16b368807d29
Closes-Bug: #1733317
2017-12-04 22:07:33 +00:00
jichenjc
39e8926484 Add description for resource class creation
POST /placement/resource_classes with incorrect format body
of the resource class name lead to something like:

JSON does not validate: u'_FPGA' does not match '^CUSTOM\\_[A-Z0-9_]+$'
with return code 400

we should add this into doc

Change-Id: Iab264f6d731a5f757a992d9bd148e7eb30922b9d
2017-12-02 01:24:37 +00:00
Zuul
2ebc3f79e3 Merge "[placement] Add 'CUSTOM_' prefix description in API ref" 2017-12-01 01:44:01 +00:00
Zuul
58d1dc0c9d Merge "[placement] Fix parameter order in placement API ref" 2017-12-01 01:42:27 +00:00
jichenjc
0900f86b6d [placement]Enhance doc for placement allocation list
add a note about when the non-existing consumer id input result

Change-Id: I2a19d8fe8dda5754112361be5ceac8a0dc747ae9
2017-11-30 20:41:08 +00:00
Takashi NATSUME
13c1a39567 [placement] Fix format in placement API ref
In "Delete traits" API of Placement API reference,
the format of response codes description is wrong.
"409 Conflict if the name to delete has associations with any"
is bold, but "ResourceProvider." is not.
So fix it.

TrivialFix
Change-Id: I963c350bfc339d4db769b0bfd6bba1087fa065e0
2017-11-30 08:36:40 +00:00
Chris Dent
18e6a44f9d [placement] Fix GET PUT /allocations nits
In the review of I49f5680c15413bce27f2abba68b699f3ea95dcdc, a few
non-blocking nits were identified. This change addresses some of
those nits, fixing some typos, clarifying method names and what
microversion is in use at particular times.

Change-Id: Iff15340502ce43eba3b98db26aa0652b1da24504
2017-11-28 12:25:13 +00:00
Chris Dent
a51f5b0d4d [placement] POST /allocations to set allocations for >1 consumers
This provides microversion 1.13 of the placement API, giving the
ability to POST to /allocations to set (or clear) allocations for
more than one consumer uuid.

It builds on the recent work to support a dict-based JSON format
when doing a PUT to /allocations/{consumer_uuid}.

Being able to set allocations for multiple consumers in one request
helps to address race conditions when cleaning up allocations during
move operations in nova.

Clearing allocations is done by setting the 'allocations' key for a
specific consumer to an empty dict.

Updates to placement-api-ref, rest version history and a reno are
included.

Change-Id: I239f33841bb9fcd92b406f979674ae8c5f8d57e3
Implements: bp post-allocations
2017-11-28 12:15:53 +00:00
Zuul
07389edc7e Merge "[placement] Symmetric GET and PUT /allocations/{consumer_uuid}" 2017-11-28 11:09:03 +00:00
Takashi NATSUME
a7c5c06fc1 [placement] Add 'CUSTOM_' prefix description in API ref
In the following resource class APIs,
the name of a resource class must start with 'CUSTOM_'.
If not, the request returns a 'Bad Request (400)' response code.
It should be described in the API reference. So add it.

* POST /resource_classes
* PUT /resource_classes/{name}

Change-Id: I132c532678bb74a460515067187fbf1e30885335
Closes-Bug: #1733308
2017-11-23 21:01:10 +00:00
Takashi NATSUME
74bb0f7453 [placement] Fix parameter order in placement API ref
Optional parameters should be after required paramenters.
Parameters added in microversions should be after
original parameters.
So fix them.

Change-Id: I5e3f5df5601d3747debed273e09a8b9b18046a96
Closes-Bug: #1728557
2017-11-23 21:01:07 +00:00
Chris Dent
88624af48d [placement] Symmetric GET and PUT /allocations/{consumer_uuid}
In a new microversion, 1.12, include project_id and user_id in the
output of GET /allocations/{consumer_uuid} and add JSON schema
to enable PUT to /allocations/{consumer_uuid} using the same dict-based
format for request body that is used in the GET response. In later
commits a similar format will be used in POST /allocations. This
symmetry is general good form and also will make client code a little
easier.

Since GET /allocation_candiates includes objects which are capable
of being PUT to /allocations/{consumer_uuid}, its response body has
been updated as well, to change the 'allocation_requests' object
to use the dict-based format.

Internally to handlers/allocation.py the same method (_set_allocations)
is used for every microversion. Any previous data structure is
transformed into the dict-ish form. This means that pre-existing tests
(like allocation-bad-class.yaml) continue to exercise the problems it
was made for, but needs to be pinned to an older microversion, rather than
being latest.

Info about these changes is added to placement-api-ref,
rest_api_version_history and a reno.

Change-Id: I49f5680c15413bce27f2abba68b699f3ea95dcdc
Implements: bp symmetric-allocations
Closes-Bug: #1708204
2017-11-21 19:39:59 +00:00
Zuul
16e0d58608 Merge "placement: Document in: prefix for ?member_of=" 2017-11-21 15:25:58 +00:00
Eric Fried
319ec7df91 placement: Document request headers in api-ref
Briefly document in the Placement API reference:

a) the use of Content-Type: application/json
b) how to use microversion headers, including a link to the main
Microversions reference.

Change-Id: I60d7b9dfe4f1c50fc50eaf07a04848c220ffcf62
2017-11-20 10:47:12 -06:00
Eric Fried
e4189d1251 placement: Document in: prefix for ?member_of=
The documentation for the member_of query parameter for GET
/resource_providers [1] claims that it accepts a "comma-separated list
of strings representing aggregate uuids".  But it turns out the code [2]
is expecting a single UUID unless the prefix 'in:' is specified.

This change set updates the documentation accordingly.

[1] https://developer.openstack.org/api-ref/placement/#resource-providers
[2] 57728836f2/nova/api/openstack/placement/handlers/resource_provider.py (L229-L233)

Change-Id: I2ec46d767ded5be02cfc73136f2d217f1347662a
Closes-Bug: #1733030
2017-11-17 20:02:40 -06:00
Eric Fried
b57109e47b Update placement api-ref: allocations link in 1.11
Following on [1], this change updates the placement api-ref to include
the allocations link in the sample output for GET
/resource_providers[/uuid].

[1] https://review.openstack.org/499826

Depends-On: I6a1d320ce914926791d5f45e89bf4c601a6b10a0

Change-Id: I161da67258afaccd90df12364153f068ef55a3b1
2017-10-27 15:47:16 +00:00
Jenkins
797dd5451c Merge "api-ref: note the microversions for GET /resource_providers query params" 2017-10-11 11:19:03 +00:00
jichenjc
92bbd2513a Add 400 as error code for resource class delete
DELETE /placement/resource_classes/VCPU
leads to something like:
Cannot delete standard resource class VCPU:

with return code 400, we should add this into doc

actually it returns 2 lines of
Cannot delete standard resource class VCPU:
now, another patch will fix it.

Partial implement blueprint placement-doc-enhancement-queens

Change-Id: I957325bc421033743472cdd4de17d260da942174
2017-09-25 17:54:16 +08:00
Jenkins
a4c917123d Merge "[placement] api-ref GET /traits name:startswith" 2017-09-08 21:29:24 +00:00
Matt Riedemann
90625fc076 api-ref: note the microversions for GET /resource_providers query params
The member_of query parameter was new in 1.3.

The resources query parameter was new in 1.4.

As a result, the 'resources' parameter description used for
allocation_candidates has to be decoupled since the entire
allocation_candidates API was new in 1.10 and is not specified
per parameter.

Change-Id: I6e0688b4a12212ace98a6876132735094df84b77
Closes-Bug: #1716046
2017-09-08 16:02:27 -04:00
Jenkins
e995bd5cea Merge "Typo error about help resource_classes.inc" 2017-09-08 14:28:09 +00:00
kangyufei
b871bda935 Typo error about help resource_classes.inc
Change-Id: I6e61aadecc80f87cd75c1331ab2f725583e9966b
2017-09-08 11:03:00 +08:00
Andreas Jaeger
52c57ca2b8 Fix broken URLs
Fix broken nova URLs that linked to the old developer/nova places and
use the new link instead.

Change-Id: Ideb50626e140201dded19fc82584440f1a407e47
2017-09-07 15:42:31 +02:00
Eric Fried
6bcda0e997 [placement] api-ref GET /traits name:startswith
In the Placement API reference, the GET /traits [1] query parameter
'name' says it accepts a key called 'starts_with'. The actual API
accepts 'startswith' (no underscore).

[1] https://developer.openstack.org/api-ref/placement/#list-traits

Change-Id: I5a1fa51fc751f2492ae6aa2b38893a9e06a26ed1
Closes-Bug: #1714283
2017-08-31 10:27:39 -05:00
Andrey Volkov
bdd6214678 [placement] Add api-ref for allocation_candidates
Change-Id: Id89d7c16ca53938e2bc18e904e8d13477ceb15f7
2017-08-10 11:26:19 +00:00
jichenjc
a478e31650 [placement] Add api-ref for RP usages
Add placement-api-ref for resource provider usages.

Co-Authored-by: Andrey Volkov <avolkov@gmail.com>

Change-Id: I6ba8765a427f654dafb32fc3fbf5492b0e1b426a
2017-08-10 09:37:27 +00:00
Andrey Volkov
5570e8993e [placement] Add api-ref for usages
Change-Id: I50954991f80725dc22be95eeecded2ee1e005e97
2017-08-09 15:54:48 +00:00
Andrey Volkov
9e88052434 [placement] Add api-ref for RP allocations
This provides simple documentation of the path and response
body parameters when listing resource provider allocations.

Co-Authored-by: Andrey Volkov <avolkov@gmail.com>

Change-Id: I40fcbc3077151227f33c6a021229b5c549889bbe
2017-08-07 12:06:53 +03:00
Andrey Volkov
21e7a12b59 [placement] Add api-ref for allocations
This provides simple documentation of the path, request and response
body parameters when listing, creating, updating and deleting allocations.

Change-Id: I58e9dfcb62a2f485addeab98dcd835568ba792cf
2017-07-18 13:06:12 +03:00
Andrey Volkov
94813057a6 [placement] Add api-ref for RP traits
This provides simple documentation of the path, request and response
body parameters when managing the association between traits and
resource_providers.

Change-Id: I2ef25313db89a2fd58d11dc023d2d9755d0a86ed
2017-07-18 12:44:08 +03:00
Andrey Volkov
77e1c46a0b [placement] Add api-ref for traits
This provides simple documentation of the path, request and response
body parameters when listing, creating, updating and deleting traits.

Change-Id: If377b725e0910de2e1768666184a0212c8c9fdbc
2017-07-18 12:44:04 +03:00
Jenkins
6a7f1023c4 Merge "[placement] Add api-ref for aggregates" 2017-06-12 16:38:26 +00:00
Andrey Volkov
b817c6b6a6 [placement] Add api-ref for aggregates
This provides simple documentation of the path, request and response
body parameters when listing and updating aggregates.

Change-Id: Ife94d22e87a73fc26c4dcbda9545a9f59680f44f
2017-06-08 15:32:33 +00:00
Vu Cong Tuan
6a59290ec3 Fix html_last_updated_fmt for Python3
html_last_updated_fmt option is interpreted as a
byte string in python3, causing Sphinx build to break.
This patch makes it utf-8 string.

Changing Popen to .check_output because of 3 reasons:
1. check_output() will raise CalledProcessError if
the called process returns a non-zero return code.
2. For consistency with keystone [1] and cinder [2]
3. It makes the code look much better.

[1] https://review.openstack.org/#/c/457142/
[2] https://review.openstack.org/#/c/433081

Change-Id: Ia3e792c512da46c2b92d3ad9ec1657849d379052
2017-06-07 21:05:12 +00:00
Andrey Volkov
6e5e06769f [placement] Add api-ref for resource classes
This provides simple documentation of the path, request and response
body parameters when listing, creating, updating and deleting a resource
class.

Change-Id: I4038d116d53b68344282ef59f9f01753766d2ef8
2017-06-05 14:39:29 +03:00
Andrey Volkov
b694d09e78 [placement] Add api-ref for DELETE resource provider
This provides simple documentation of the path parameters when deleting
a resource provider.

Change-Id: I8cf3f1482450765d3e1daf83b6f595303d191a28
2017-05-29 09:18:32 +03:00
Andrey Volkov
8f2ecfc808 [placement] Add api-ref for PUT resource provider
This provides simple documentation of the request and response body
parameters when setting or replacing a resource provider.

Change-Id: Ifa3c0bad0ec3f9d85f0f18bfd6f90e0bcb52773d
2017-05-29 09:18:32 +03:00
Andrey Volkov
91cb70323d [placement] Add api-ref for GET resource provider
This provides simple documentation of the response body and path
parameters when listing a single resource provider.

Change-Id: I84d472067e4365d59cab4863f87df9d24718701f
2017-05-29 09:18:32 +03:00
Andrey Volkov
4897245ee2 [placement] Add api-ref for POST resource provider
This provides simple documentation of the request
parameters when creating a resource provider.

Change-Id: I1fd189503f33da4febcd2e4dc5132f4c240c19b0
2017-05-29 09:18:32 +03:00
Andrey Volkov
bf75539509 [placement] Add api-ref for DELETE RP inventory
This provides simple documentation of the path parameters when deleting
a single inventory record for a resource provider.

Change-Id: Ie7eeb426744bccf5e976ed304fa6f0a58b38ac01
2017-05-29 09:18:32 +03:00
Andrey Volkov
b2e1a39b14 [placement] Add api-ref for PUT RP inventory
This provides simple documentation of the response body and path
parameters when setting or replacing an inventory record for a resource
provider.

Change-Id: I77d99c174b50eef5d2b72e226ff31f03807e69aa
2017-05-29 09:18:32 +03:00
Andrey Volkov
6d0ca61ba8 [placement] Add api-ref for GET RP inventory
This provides simple documentation of the response body and path
parameters when showing a single class of inventory for a resource
provider.

Change-Id: Ic562baa3e74445c8f6dbeb416c1ec183cc2ad14d
2017-05-29 09:18:32 +03:00
Andrey Volkov
f9da91541f [placement] Add api-ref for DELETE RP inventories
This provides simple documentation of the path
parameters when deleting resource provider inventories.

Change-Id: Ia1f787fb9def8473a9698a9bf1ab1990a1c21f48
2017-05-29 09:18:32 +03:00
Andrey Volkov
2b567f0403 [placement] Add api-ref for PUT RP inventories
This provides simple documentation of the request and response body
parameters when setting or replacing all inventories for a resource provider.

Change-Id: I720f5b6792b9f4ced905aef31715a835b07be504
2017-05-29 09:18:32 +03:00
Andrey Volkov
a945d5c105 [placement] Add api-ref for GET RP inventories
This provides simple documentation of the response body and path
parameters when listing resource provider inventories.

Change-Id: Id4ed2450ab70fc63d47dabb21c4a9b21f25d85b1
2017-05-27 10:15:12 +00:00
Andrey Volkov
435cefd637 [placement] Split api-ref topics per file
For more convinient text management each ROUTE_DECLARATIONS
has its own inc file in api-ref.

Change-Id: Ia2fd62ae7f401cad34ee7c2b355c9a5ab1c93f6b
2017-03-24 20:09:17 +03:00
Chris Dent
5978b02539 [placement] add api-ref for GET /resource_providers
This provides simple documentation of the response body and query
parameters when listing resource providers.

Change-Id: Ic8db81b5f17d4c380b64b3da24e525297db18584
2017-03-24 15:16:16 +03:00
Chris Dent
e0d598ec13 Structure for simply managing placement-api-ref
This consists of a duplicate of the [nova-]api-ref setup and
conf.py along with tooling to fail the tox -edocs target when
a route that is defined in
nova.api.openstack.placement.handler.ROUTE_DECLARATIONS is not
present in placement-api-ref/source/index.rst.
tools/placement_api_docs.py will report which routes are missing.

Though completely gameable (as demonstrated in the current lame
index.rst) it's better than nothing and provides some useful
structuring on what to do next. It's also the case that the 'docs'
target in tox is not part of gating.

The response for GET / is in place with the necessary
parameters.yaml for it to be correctly described. The 'get-root.json'
file provides the JSON of the expected response. The expectation is
that later commits will add information for other urls and their
JSON files will be named method-path-separated-by-dash.json with a
request/response qualifier as necessary.

Followup patches will add other routes.

A new parameters.yaml is used instead of reusing the one from
api-ref as there isn't a lot of expected overlap and having a
separate file will ease eventual extraction.

Running tox -eplacement-api-ref will generate the docs for review,
with output in placement-api-ref/build/html/index.html.

This will be hooked up with CI to deploy the generated docs,
eventually.

Change-Id: Ifb4d91d39db0e49b55952e37cdfc9f63dcd37aa3
2017-03-24 15:15:53 +03:00