Commit Graph

60 Commits

Author SHA1 Message Date
Zuul b9c1167fac Merge "Fix typos" 2022-09-19 13:42:15 +00:00
Zuul d0e05e89ac Merge "Remove unicode literal strings" 2022-08-05 14:36:10 +00:00
anguoming 5fbb22901b Remove unicode literal strings
Python 2 has been deprecated. This patch removes all unicode strings.

Change-Id: Ie323d459923b36de544c15c45d61eb89866fc550
2022-08-05 02:15:19 +00:00
Balazs Gibizer 1164497964 Clarify trait filtering in the API doc
Based on the spec[1], the user doc[2] and the implementation[3][4]
the original intention of trait filtering during allocation
candidate query is that the required traits in the unnamed group
needs to be provided by the resource providers contributing resources
to the candidate. So traits on RPs which are in the tree of the
candidate but not providing resource to the candidate should be ignored.

The current API doc is not clear on this and can be misunderstood. So
this patch clarifies that doc.

[1] https://docs.openstack.org/placement/latest/specs/train/implemented/2005575-nested-magic-1.html
[2] https://docs.openstack.org/placement/latest/user/provider-tree.html#filtering-by-traits
[3] d48d22ff24/placement/objects/research_context.py (L745)
[4] d48d22ff24/placement/tests/functional/db/test_allocation_candidates.py (L817-L827)

Story: #2009795
Task: #44334
Change-Id: Idc367df609dc8d4874fc329f2317c582b9e06a4d
2022-08-03 15:21:45 +02:00
Rajesh Tailor 4fff36d52b Fix typos
This change fixes typos in comments, log messages and tests.

Change-Id: Ic035853facfad866be5f99ac28247b2864ca5f8b
2022-07-08 21:46:57 +05:30
Balazs Gibizer b2afade159 Add microversion 1.39 to support any-trait queries
The new microversion adds support for the ``in:`` syntax in the ``required``
query parameter in the ``GET /resource_providers`` API as well as to the
``required`` and ``requiredN`` query params of the
``GET /allocation_candidates`` API. Also adds support for repeating the
``required`` and ``requiredN`` parameters in the respective APIs. So

  required=in:T3,T4&required=T1,!T2

is supported and it means T1 and not T2 and (T3 or T4).

Story: 2005345
Story: 2005346
Change-Id: I66543c0c5509739d1461af2fb2c327a003202d74
2022-02-10 11:09:20 +01:00
melanie witt 419dcc7ce0 Refactor consumer type methods for readability
This contains fixups for change
I24c2315093e07dbf25c4fb53152e6a4de7477a51 to rename a method to more
accurately convey what it does, refactor a keyword arg in a method to
increase readability, and update the reshaper request example to show
the latest available version 1.38.

Story: 2005473
Task: 36421

Change-Id: If6d8ae575400fb8d2f78c871ff7394e9fbcf5816
2021-08-25 18:22:25 +00:00
Chris Dent 3772132579 Microversion 1.38: API support for consumer types
Update allocations, reshaper and usage APIs to accept and present
consumer_type in microversion 1.38.

ensure_consumer in placement/handlers/util.py is updated to be consumer
type aware.

allocation, usage and reshaper schema and handlers are updated

gabbits/consumer-types-1.38.yaml adds tests across the various URIs

A TODO is left in placement/handlers/allocation.py where the database
is being accessed in a way that is not ideal. This will be cleared
up in a followup patch (to add use of an AttributeCache).

Co-Authored-By: Surya Seetharaman <suryaseetharaman.9@gmail.com>
Co-Authored-By: melanie witt <melwittt@gmail.com>

Story: 2005473
Task: 36421

Change-Id: I24c2315093e07dbf25c4fb53152e6a4de7477a51
2021-08-05 23:23:47 +00:00
Balazs Gibizer 00795f31b8 Add support for RP re-parenting and orphaning
This patch adds the new microversion 1.37 in which changing the
parent_provider_uuid of a resource provider to any other provider
(except in the same subtree to avoid loops) or to null (un-parenting /
orphaning) is supported.

Story: 2008764
Task: 42131
Change-Id: I9d16ab7944d7e6ce725a892827b9508b7ba52d7c
2021-07-14 17:55:41 +02:00
Andreas Jaeger 2009e61335 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.

Disable openstackdocs_auto_name to use 'project' variable as name.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I4e3fe772adffbd70d55ce1b73d9161a6de5b9c11
2020-05-21 16:23:00 +02:00
Eric Fried f3558482ab Clarify GET /allocations/$c for nonexistent $c
There was a note in the API reference for "List allocations" indicating
the response payload when a nonexistent consumer is queried, but the
parameter table entry for `consumer_generation` was duplicated from the
"Manage" and "Update" operations, which was confusing.

This commit clarifies that the `consumer_generation` will be entirely
absent from the response payload in this scenario. It also adds the same
clarification for the `project_id` and `user_id` fields. And tightens up
the gabbi coverage proving same.

Change-Id: I70f22b246d0c0acd1ae87a75bc438a9258b704ad
Story: #2006726
Task: #37146
2019-10-18 01:09:45 +00:00
Matt Riedemann 0ed544e8ce api-ref: note GET /resource_providers?resources amount constraints
I was wondering if I could list only compute node resource providers
by doing something like:

  GET /resource_providers?resources=MEMORY_MB:0

The API reference does not explain the constraints on the resource
class amount value so I had to dig into the normalize_resources_qs_param
code to confirm that it must be an integer greater than 0, which is
what I assumed but it was not mentioned in the docs, so I've added
that clarification here.

Change-Id: I1478e7a9c6ffc41f0a31bdab52a04123307708b6
2019-10-16 10:27:23 -04:00
Matt Riedemann 31794c8546 api-ref: fix typo in aggregates note
Change-Id: I81d36e7d0d082423a4c8e31e9a01f5e0285431be
2019-08-20 12:16:54 -04:00
Chris Dent 99b107fb5a Update api-ref to point to API-SIG microversion spec
The docs had been using a reference within the nova docs, which
is similar to, but less generic than the API-SIG doc.

Change-Id: I7087e311209716a2907575573b9c018c352ce63d
2019-07-23 11:33:05 +01:00
Andreas Jaeger 7b3c179fe4 Update api-ref location
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.

Note that redirects will be set up as well but let's point now to the
new location.

For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html

Change-Id: Iccddd4356b5d7c28977ad954654d0875972dae97
2019-07-22 19:17:01 +02:00
Zuul 482d80a5fb Merge "Follow up fix for same_subtree documentation" 2019-07-15 08:38:55 +00:00
Zuul a6ada10049 Merge "api-ref: Document generations" 2019-07-12 17:25:57 +00:00
Eric Fried a09defd661 api-ref: Document generations
The API reference for POST /allocations [1] and PUT
/allocations/{consumer_uuid} [2] specifically mentions that you can get
a 409 on provider/inventory conflict. In microversion 1.28, it also
became possible to get a 409 on an allocation (consumer generation)
conflict.

In the process of adding that information, it became evident that we
weren't doing a good job explaining the whole generation thing in
general, so this commit also adds a descriptive section to the front
matter of the API reference.

Links are included from the updated descriptions for the two affected
allocations operations. Future commits can add links from other
appropriate sections of the reference (e.g. the parameters.yaml entries
for resource provider and consumer generation fields). Future commits
could also enhance the descriptions of error codes for other operations
to (at least) the level of detail at which these have ended up.

[1] https://developer.openstack.org/api-ref/placement/?expanded=manage-allocations-detail#manage-allocations
[2] https://developer.openstack.org/api-ref/placement/?expanded=update-allocations-detail#update-allocations

Change-Id: I42e76785e0fe456b107fe843dbb242f2c5f5b9f7
Story: #2006180
Task: #35705
2019-07-11 16:31:28 -05:00
Tetsuro Nakamura 4ae8ffea1e Add placement.query.missing_value in api-ref
This commit documents a new error code placement.query.missing_value,
which was added via [1] but missed in the summary table in the API
reference [2].

Story: #2006194
Task: #35776

[1] 8395e3f099
[2] https://developer.openstack.org/api-ref/placement/#errors

Change-Id: I36ee636946c2e8b2c4b07b0449460bd31960f637
2019-07-11 06:25:54 +00:00
Eric Fried 328f7a3a36 Add query.duplicate_key and .bad_value in api-ref
This commit documents new error codes placement.query.duplicate_key and
placement.query.bad_value, which were were added via [1] but missed in
the summary table in the API reference [2].

Story: #2006194
Task: #35776

[1] I76cad83248920fa71da122711f1f763c4ebdb1ba
[2] https://developer.openstack.org/api-ref/placement/#errors

Change-Id: I024eaa38c6574f5847d585c83d527e3374031105
2019-07-09 10:32:45 +00:00
Tetsuro Nakamura efaa36443f Follow up fix for same_subtree documentation
This patch fixes incorrect usages of fixed articles changing them to
indefinite articles in same_subtree documentation.

Change-Id: I6ba2e2f13400b4c2ae9a44cad7a1fc9a9e39b41d
Story: 2005575
Task: 30784
2019-07-09 10:23:54 +00:00
Tetsuro Nakamura 8395e3f099 Support `same_subtree` queryparam
A new same_subtree query parameter will be accepted. The value is
a comma-separated list of request group suffix strings $S. Each must
exactly match a suffix on a granular group somewhere else in the
request. Importantly, the identified request groups need not have
a resources$S.

If this is provided, at least one of the resource providers satisfying
the specified request group must be an ancestor of the rest.

The same_subtree query parameter can be repeated and each repeat group
is treated independently.

Co-Authored-By: Chris Dent <cdent@anticdent.org>
Change-Id: I7fdeac24606359d37f1a7405d22c5797840e1a9e
Story: 2005575
Task: 30784
2019-07-09 07:21:53 +00:00
Zuul 435aa8dbe7 Merge "Trivial: Update document for Request IDs" 2019-06-26 20:58:12 +00:00
Tetsuro Nakamura 0d9c510df7 Trivial: Update document for Request IDs
The Request IDs doc had an small error describing that in response
header the value of X-Openstack-Request-Id is generated automatically
for tracking each request to nova, but it is for tracking each request
to placement so this patch updates it.

Change-Id: I92ca8e73016c1d3a73aa1084013e4cec2382dec2
2019-06-26 06:40:16 +00:00
Eric Fried b733786a0a Microversion 1.35: root_required
Microversion 1.35_ adds support for the ``root_required`` query
parameter to the ``GET /allocation_candidates`` API. It accepts a
comma-delimited list of trait names, each optionally prefixed with ``!``
to indicate a forbidden trait, in the same format as the ``required``
query parameter. This restricts allocation requests in the response to
only those whose (non-sharing) tree's root resource provider satisfies
the specified trait requirements.

This is to support use cases like, "Land my VM on a host that is capable
of multi-attach," or, "Reserve my Windows-licensed hosts for special
use."

Story: #2005575
Task: #33753
Change-Id: I76cad83248920fa71da122711f1f763c4ebdb1ba
2019-06-20 17:30:35 -05:00
Chris Dent d38844e390 Implement allocation candidate mappings
In microversion 1.34 add a 'mappings' key to each allocation
request. Its value is dict keyed by resource group suffixes
with values of a list of resource providers satisfying that
group.

To preserve symmetry, the mappings key may be sent back when
writing allocations so the schema for POST and PUT allocations
and POST /reshaper are updated.

api history, api-ref and reno are added

Change-Id: Ie78ed7e050416d4ccb62697ba608131038bb4303
Story: 2005575
Task: 33536
2019-06-12 21:19:14 +00:00
Chris Dent fb0f6f2608 Allow [a-zA-Z0-9_-]{1,64} for request group suffix
Add a 1.33 microversion to move from numeric suffixes to string
suffixes that can be 64 chars longs made from '-', '_', and
mixed-case alphanumeric. The format is shared between schema
and RequestGroup parsing.

Docs, api-ref, api history and microversion upper limit are updated
to indicate the new form in the new microversion.

A release note is added.

Story: 2005575
Task: 30781
Change-Id: Ia44b0922d151695d406883262e891bd932536f38
2019-05-21 11:07:38 +01:00
Matt Riedemann d921ad4bc8 api-ref: fix formatting in member_of param for 1.21
This fixes a formatting issue in the member_of 1.21 parameter
to the GET /allocation_candidates API reference.

Change-Id: I53289e98d76c22b220066b22de7f21552dc5378a
2019-04-12 12:07:22 -04:00
Tetsuro Nakamura 852294bd73 Rename api-ref parameters
Now in API reference, variable name `member_of` is used for
`GET /resource_providers` doc and `member_of_1_12` is used for
`GET /allocation_candidate` doc. However, since we also have
`member_of_granular` this can be confusing.

This patch renames as follows:
 - `member_of` -> `resource_providers_member_of`
 - `member_of_1_12` -> `allocation_candidates_member_of`
 - `member_of_granular` -> `allocation_candidates_member_of_granular`

No content is changed.

Change-Id: I3a8591d9ed76eed60e11d59cff77cfbf95796478
2019-04-02 13:51:43 +00:00
Tetsuro Nakamura e6f234fe44 FUP on negative-aggregate-membership series
This is a follow up patch on negative-aggregate-membership series.

 - Remove allocation candidate related words in the
   `GET /resource_providers` API reference
 - Fix several typos in the API reference
 - Additionaly write in the release note that the forbidden aggregate
   is also supported in granular requests.

Change-Id: Idb187d7ef83ad65aaaa5dbf968a15c41d73057d1
2019-04-02 12:22:42 +00:00
Tetsuro Nakamura 0a3dcadb0a Negative member_of query with microversion 1.32
This patch adds microversion 1.32 supporting the forbidden aggregate
expression within existing ``member_of`` queryparam both in
``GET /resource_providers`` and in ``GET /allocation_candidates``.
Forbidden aggregates are prefixed with a ``!``.

We do NOT support ``!`` within the ``in:`` list:

  ?member_of=in:<agg1>,<agg2>,!<agg3>

but we support ``!in:`` prefix:

  ?member_of=!in:<agg1>,<agg2>,<agg3>

which is equivalent to:

  ?member_of=!<agg1>&member_of=!<agg2>&member_of=!<agg3>

where candidate resource providers must not be in agg1, agg2, or agg3.

Change-Id: Ibba7981744c71ab5d4d0ee5d5a40709c6a5c6b5e
Story: 2005297
Task: 30183
2019-03-29 05:14:27 +00:00
Tetsuro Nakamura f4f98293d1 Add link to case studies in alloc_cands api-ref
This patch adds a link to case studies for
`GET /allocation_candidates` API in the api reference.

Change-Id: I21a73bd1c9056c7ea365bcef43caeee4377e9166
2019-03-16 22:10:45 +00:00
Chris Dent 2588c7b8da Update docs bug links to storyboard
Update doc, api-ref and releasenotes conf.py to set 'use_storyboard' to
True. According to the docs of the theme [1] bug project and tag are
not used when using StoryBoard.

doc/requirements.txt (used by all the docs-related jobs) is updated
to make openstackdocstheme>=1.24.0. That version is the most recent
one to have bug fixes related to use_storyboard.

[1] https://docs.openstack.org/openstackdocstheme/latest/#using-the-theme

Change-Id: I3b28dd1da9e8e75eda151a3025e78a5a47c971f9
Story: 2005190
Task: 29948
2019-03-11 20:54:24 +00:00
Eric Fried 849c89d0e5 Remove pep8 whitespace ignores
We had carried over the full list of pep8 whitespace ignores from nova.
Trying to address them all in the entire nova repository would have been
too big a task; but it's tenable here in placement.

Do it now rather than letting these whitespace issues compound.

This change removes the E* whitespace ignores and fixes the pep8 issues
they were masking.

Change-Id: Icbabdb9b56fd5a3e9fd14ab537abf3d0d6456fee
2019-03-05 18:18:30 -06:00
Tetsuro Nakamura ce10de2a29 in_tree[N] alloc_cands with microversion 1.31
This patch adds microversion 1.31 supporting the `in_tree`/`in_tree<N>`
query parameters to the `GET /allocation_candidates` API. It accepts a
UUID for a resource provider. If this parameter is provided, the only
resource providers returned will be those with the same tree with the
given resource provider.

Change-Id: I24d333d1437168f27aaaac6d894a18271cb6ab91
Blueprint: alloc-candidates-in-tree
2019-02-25 13:00:30 -06:00
Zuul 961f79dc00 Merge "Document API error codes" 2019-01-21 16:50:09 +00:00
Chris Dent 1f0826b5f0 Correct link rest api history
The link was to nova, to documents that are no longer there, so
update to the new location. A change will also be made in nova to
add a redirect.

Change-Id: Ibfe016f25a29b6810ea09c5d03a01dbf3c53371f
2018-12-19 11:13:02 +00:00
Chris Dent 16b29024c2 Document API error codes
Add a section to the api-ref describing the error codes that some
responses produce.

Note in the contributor docs that this should be updated when one is
added.

The reshaper docs is adjusted so a ref can be made to it from the
errors. The implicit link to the header that would be the norm there
doesn't work as there are two headers named "Reshaper".

Change-Id: I89bbd383ba102fdd707ccc9f2fc973c6dd841fa8
Closes-Bug: #1794712
2018-12-17 13:16:58 +00:00
Tetsuro Nakamura c85ae69ee9 Fix aggregate members in nested alloc candidates
When placement picks up allocation candidates, the aggregates of
nested providers were assumed as the same as root providers. This
means that the `GET /allocation_candidates API` ignored the
aggregates on the nested providers. This could result in the lack
of allocation candidates when an aggregate is on a nested provider
but the aggregate is not on its root provider and the aggregate is
specified in the API by the `member_of` query parameter.

This patch fixes the bug changing it to consider the aggregates
not only on root rps but also on the nested rp itself and adds
a release note for this.

The document which explains the whole constraint of `member_of`
and other query parameters with nested providers, will be submitted
in a follow up patch.

Change-Id: I9a11a577174f85a1b47a9e895bb25cadd90bd2ea
Closes-Bug: #1792503
2018-09-21 11:44:58 +09:00
Eric Fried 9b584fcd1d Make docs build
This patch does pretty much the minimum possible to get `tox -e docs`
building and gating. Much, much more needs to be done to make the
content good.

Also corrects a link in the api-ref which, once these are publishing,
would have pointed to the wrong place.

Change-Id: I5cbc3a3cceeaeaa7be5593658b6a03fa25fb69d0
2018-09-06 11:45:11 -05:00
Balazs Gibizer 8c2bb44181 Add api-ref job
As placement-api-ref is renamed to api-ref we can use the standard job
for the doc generation. This patch adds a voting api-ref generation job
for both queues

Change-Id: I0d8a2919e6af4bf41385e7d2324cbad72f7f9a7c
2018-09-06 11:44:21 -05:00
EdLeafe 1dca56f58e Remove the import pathing for the old structure
This commit is the result of running the following search and replace
across the project.
    s/nova\.api\.openstack\.?//g

Change-Id: I4974a28de541aace043504f788cf0d100f778cae
2018-09-04 10:31:24 -05:00
EdLeafe f849f668a9 Move the api-ref directories
This is the result of running the following commands:
    git rm -rf api-ref/
    git mv placement-api-ref api-ref

Change-Id: Iffabaa757187879773ee3e7ffaa438ab95670dea
2018-09-04 10:31:22 -05:00
Jenkins f053ecc737 Merge "Clean up metadata param in doc" 2017-04-03 12:39:18 +00:00
Takashi NATSUME 0c38e0f69d api-ref: Fix parameters and examples in aggregate API
- The type of aggegate ID is changed to 'integer' instead of 'string'.
- The uuid of aggegate is changed to 'required'
  because the uuid is always shown in the response after v2.41.
- The response examples are replaced with v2.41 examples.

Change-Id: Ib106898d32dc67e414f489468e91561ab0a5eb80
Closes-Bug: #1659475
2017-03-13 04:04:39 +00:00
jichenjc 63eb25f517 Clean up metadata param in doc
several params like metadata_xxx are used and actually they are
same, so just clean up them and use metadata_object instead

part of bp:api-ref-in-rst-pike

Change-Id: I455c02b5dcd77df43fc8c0113269f71a5207d3d5
2017-02-25 21:45:05 +08:00
Jay Pipes 8b4fd32e7b Return uuid attribute for aggregates
Adds a Compute API microversion that triggers returning an aggregate's UUID
field. This field is necessary for scripts that must populate the placement API
with resource provider to aggregate relationships, which rely on UUIDs for
global identification.

APIImpact
blueprint: return-uuid-from-os-aggregates-api
Change-Id: I4112ccd508eb85403933fec8b52efd468e866772
Closes-bug: #1652642
2017-01-05 14:32:43 -05:00
Hironori Shiina cf8f6afe12 Fix a few typos in API reference
Change-Id: Ib90100f4ec6b4b03f27ed39166caeb9bdf5bc24c
2016-09-28 14:34:23 +09:00
ghanshyam 2001b99bea Body Verification of os-aggregates.inc
This patch verifies that the title and introductory description
that precedes each rest method clearly reflects the context of the
respective rest method.

- Correct the Response text for delete API
- 'body verification' tag is removed for this commit.

part of bp:api-ref-in-rst

Change-Id: If189c0f0246969527635879d96daa1ba8f77b7c3
2016-09-06 19:03:52 +09:00
jichenjc 080bb81088 Verify os-aggregates.inc on sample files
verified all sample files is correct and adjust
some format of the request Json file

part of bp:api-ref-in-rst

Change-Id: Ie9dd24858056337bcae9b03259d4f84de4fc1ab8
2016-07-26 02:06:28 +08:00