Commit Graph

11 Commits

Author SHA1 Message Date
Surya Seetharaman 983abb05d7 API microversion 2.69: Handles Down Cells
This patch introduces a new API microversion which will be
used to alter the responses of ``GET /servers``, ``GET /servers/detail``,
``GET /servers/{server_id}`` and ``GET /os-services`` when a cell is
down to return minimal constructs with missing keys.

Implements blueprint handling-down-cell

Change-Id: Id9f12532897912b39093f63e9286540d9029edeb
2019-02-15 14:39:20 -05:00
Dan Peschman 2f7bf29d47 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
2017-07-18 15:39:57 -04:00
He Jie Xu 9f9802eebd Move the v2 api_sample functional tests
This patch move the all v2.1 api sample tests under
'functional/api_sample_tests'. Also move sample files under
'doc/api-samples'.

Co-Authored-By: Ed Leafe <ed@leafe.com>
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Partial-Bug: #1462901
Change-Id: I2b924f2ad7687a23a018a9b658e8acd9e04d7963
2015-08-18 15:25:41 +08:00
ghanshyam 3e1275c6fd Merge V2 and V2.1 services functional tests
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.
We can have one set of tests which can run for both v2 and v2.1.

This commit merges services functional tests.

In V2 services API has following extensions
- os-services
- os-extended-services-delete
- os-extended-services

In V2.1 above extensions have been merged together in services plugins

Change-Id: I498e80aef9c05b125d396f40fcb0e6ae4bef8da6
2015-05-12 11:09:40 +09:00
Davanum Srinivas 417704816e Nuke XML support from Nova REST API - Phase 1
In I5a580fc323c3809790b4a68a9f8f8129ecdc2cf0 we switched off XML support. In
this review we entirely remove all the testcases and supporting files.

Change-Id: I83827d438753fd3899053dd6e09bc77c997c7406
2015-01-05 12:46:04 -05:00
Yunhong Jiang df60f2cd33 Fix doc for service list
If a service is enabled, the "disabled_reason" field in response
for /v2/.{tenant_id}./os-services/detail is null, however, currently
it's specified as "" in the doc, thus may be confusing to users.

This patch change the template and doc, it should not cause issue to
existing applications.

Change-Id: Ia71ec4c97a355bcc1a7b63e6107db77f80a5d843
Close-bug: 1328382
2014-06-16 16:57:23 +00:00
Mark McLoughlin 68fe44121e Add specific regexp for timestamps in v2 xml
datetime objects are serialized into xml using simply str() and this
is a slightly different format from ISO8601 in that the date isn't
separated from the time using 'T'.

(However, note that the iso8601 library happily accepts this format)

Add a specific regexp for this format so we can test for it in the
places we know it is used. This also means we can remove the generic
%(timestamp)s regexp.

Note that unlike the isotime and strtime formats, whether this format
includes timezone or microsecond information depends on whether the
datetime object had those fields set. The isotime format always
includes a timezone but not microseconds, whereas the strtime format
never includes a timezone but always includes microseconds.

There are a small number of examples where this format is used in JSON
too - e.g. the instance usage audit log extension pre-serializes its
timestamps by doing:

        return dict(period_beginning=str(begin),
                    period_ending=str(end),

Using a name like 'xmltime' for the timestamp format used in cases
like this actually makes sense - it highlights that the format used
in this case is a weird mistake.

Full context here:

  http://lists.openstack.org/pipermail/openstack-dev/2014-April/033971.html

Change-Id: I70f839ac17273ed10078b833aeba308bd5e994e1
2014-05-11 16:28:50 -04:00
Andrea Rosa c741e862fd Give a way to save why a service has been disabled.
Implements blueprint record-reason-for-disabling-service

We added a field to the service table to log a reason when a service has
been disabled.
We added a new API extension called os-extended-services. The new extension
will extend the os-services extension adding:
- A method for disabling a service and specify a reason for that.

PUT /v2/{tenant_id}/os-services/disable-log-reason

When the os-extended-extension is loaded the call:

GET /V2/{tenant_id}/os-services
will return the list of services with reason information it that exists.

DocImpact
Change-Id: I87a4affc45160796ff11c7b03e591e6aba73d62a
2013-06-12 11:27:25 +10:00
Andrea Rosa 48b41e0b88 Fix typo in the XML serialization os-services API.
Partially implements blueprint nova-api-samples
fixes bug 1130609

The XML serializer for the update method in the os-services API extensions was
not serializing the "updated_at" field because of a typo in the code.
In this change we added api_samples for the XML output.

Change-Id: I9fff0677e9bad650b19e559b3ed6e9bc0ffe8c3c
2013-03-28 10:38:36 +00:00
Dan Prince 37c618da7c Make os-services API extensions consistent.
Updates the os-services API extension so that it is consistent
internally (index and update return similar formats), and so
that it works with the recent novaclient code which sends
the following request body format:

  {"binary": "nova-cert", "host": "nova1"}

Also, updates the response body format of the update call so that it
wraps things in an extra service dict which should make novaclient
happier here as well (and is consistent with other extensions too).

Fixes LP Bug #1147746.

Change-Id: I932160d64fdd3aaeb2ed90a092ecc7a36dcc9665
2013-03-14 15:34:49 -04:00
ivan-zhu 4348529188 Add API sample tests to Services extension
Partially implements blueprint nova-api-samples
Bug 1091755

Change-Id: I7a0e124871c248bbb7613bfcdf335fee29a887f2
2013-02-13 17:49:16 +08:00