Commit Graph

8 Commits

Author SHA1 Message Date
Stephen Finucane 32c43fc801 api: Set min, maxItems for server_group.policies field
As noted inline, the 'policies' field may be a list but it expects one
of two items.

Change-Id: I34c68df1e6330dab1524aa0abec733610211a407
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-Bug: #1894966
2020-09-16 11:13:47 +01:00
Ghanshyam Mann b26bc7fd7a Multiple API cleanup changes
This microversion implements below API cleanups:

1. 400 for unknown param for query param and for request body.

2. Making server representation always consistent among all APIs
   returning the complete server representation.

3. Change the default return value of ``swap`` field from the empty string
   to 0 (integer) in flavor APIs.

4. Return ``servers`` field always in the response of GET
   hypervisors API even there are no servers on hypervisor

Details: https://specs.openstack.org/openstack/nova-specs/specs/train/approved/api-consistency-cleanup.html

Partial-Implements: blueprint api-consistency-cleanup

Change-Id: I9d257a003d315b84b937dcef91f3cb41f3e24b53
2019-08-12 08:52:38 -05:00
Yikun Jiang 5cdb1ce26b Microversion 2.64 - Use new format policy in server group
Enable users to define the policy rules on server group policy
to meet more advanced policy requirement. This microversion
brings the following changes in server group APIs:

* Add  ``policy`` and ``rules`` fields in the request of POST
  ``/os-server-groups``.
* The ``policy`` and ``rules`` fields will be
  returned in response body of POST, GET ``/os-server-groups``
  API and GET ``/os-server-groups/{server_group_id}`` API.
* The ``policies`` and ``metadata`` fields have been removed
  from the response body of POST, GET ``/os-server-groups`` API
  and GET ``/os-server-groups/{server_group_id}`` API.

Part of blueprint: complex-anti-affinity-policies

Change-Id: I6911e97bd7f8df92511e90518dba21c127e106a5
2018-07-13 10:43:42 +08:00
jichenjc b8ff742bd7 check query param for server groups function
Add additional schema check for server groups query function,
as we need backward compatible those changes, here we don't do real
check and later a microversion need to be done to do the real check.

Part of blueprint json-schema-validation-for-query-param

Change-Id: I625af5a8fe09a9772079e893aa707b961c666d2a
2017-11-29 01:50:16 +08:00
ghanshyam 16032ceeca Explicitly define enum type as string in schema
Many attribute in the request schema are defined with
allowed enum values. But schema does not specify those
enum as string type.

enum in json schema is defined in such a way that it
allows any type not just string so defining each enum type
as string explicitly makes schema more readable and consistent
with other API schema.

Note- this does not change any behavior or does not fix any issue.
This is just for consistency with other schema definition and readability.

Change-Id: I4f6fe5e418c624e0dcbcfb3b6bca64ab3e5c96fe
2017-04-21 03:09:28 +00:00
Matt Riedemann 0a3f5dca2c api-ref: cleanup os-server-groups 'policies' parameter description
The 'policies' parameter for the os-server-groups API is an array
for legacy reasons, but the schema validation allows only a single
item and it's from the enumerated list, and exactly one must be
specified when creating a server group.

This patch cleans up the policies parameter description to avoid
confusion over the number of items that can be specified or their
form, and it also provides a description of each available policy.

Since the jsonschema for policies is a bit confusing too, this
patch adds a comment in the schema code to avoid future confusion
over how the validation works.

Change-Id: I3ab2880ed6e8bb2cdf476c197719b83d768d44d0
Closes-Bug: #1652943
2016-12-28 10:06:40 -05:00
Balazs Gibizer 1c30edc5b2 api: add soft-affinity policies for server groups
Allows soft-affinity and soft-anti-affinity to be used as a policy
for the server group api extension. Add soft policies
to the JSONSchema, which validates server group definitions.
Bump API microversion to 2.15.

Implements: blueprint soft-affinity-for-server-group
Change-Id: I376bdba7df1344d269aa126f4896610baf2e16a2
2016-01-07 10:43:57 +01:00
He Jie Xu 3e032fd45b Remove 'v3' directory for v2.1 json-schemas
This is step 4 of the remove v3 process. It moves the v2.1
json-schemas out of v3 directory, and also corrects all the
references.

Change-Id: Ibf88c38df951ed755b7431846cca7496f861c1dd
Partial-Bug: #1462901
2015-08-13 09:58:48 +08:00