2016-04-12 09:03:46 -04:00
|
|
|
.. -*- rst -*-
|
|
|
|
|
|
|
|
====================================================
|
|
|
|
Create external events (os-server-external-events)
|
|
|
|
====================================================
|
|
|
|
|
2016-05-11 14:47:13 -04:00
|
|
|
.. warning::
|
|
|
|
This is an ``admin`` level service API only designed to be used by
|
|
|
|
other OpenStack services. The point of this API is to coordinate
|
2019-03-22 16:03:56 +01:00
|
|
|
between Nova and Neutron, Nova and Cinder, Nova and Ironic (and potentially
|
|
|
|
future services) on activities they both need to be involved in,
|
2017-09-15 06:19:49 +08:00
|
|
|
such as network hotplugging.
|
2016-05-11 14:47:13 -04:00
|
|
|
|
2019-03-22 16:03:56 +01:00
|
|
|
Unless you are writing Neutron, Cinder or Ironic code you **should not**
|
2017-09-15 06:19:49 +08:00
|
|
|
be using this API.
|
2016-05-11 14:47:13 -04:00
|
|
|
|
2016-04-12 09:03:46 -04:00
|
|
|
Creates one or more external events. The API dispatches each event to a
|
|
|
|
server instance.
|
|
|
|
|
|
|
|
Run Events
|
|
|
|
==========
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: POST /os-server-external-events
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-05-11 14:47:13 -04:00
|
|
|
Creates one or more external events, which the API dispatches to the
|
|
|
|
host a server is assigned to. If the server is not currently assigned
|
|
|
|
to a host the event will not be delivered.
|
|
|
|
|
|
|
|
You will receive back the list of events that you submitted, with an
|
|
|
|
updated ``code`` and ``status`` indicating their level of success.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-05-11 14:47:13 -04:00
|
|
|
Normal response codes: 200, 207
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-05-11 14:47:13 -04:00
|
|
|
A 200 will be returned if all events succeeded, 207 will be returned
|
Nix os-server-external-events 404 condition
The POST /os-server-external-events API had the following confusing
behavior:
With multiple events in the payload, if *some* (but not all) were
dropped, the HTTP response was 207, with per-event 4xx error codes in
the payload. But if *all* of the events were dropped, the overall HTTP
response was 404 with no payload. Thus, especially for consumers sending
only one event at a time, it was impossible to distinguish e.g. "you
tried to send an event for a nonexistent instance" from "the instance
you specified hasn't landed on a host yet".
This fix gets rid of that sweeping 404 condition, so if *any* subset of
the events are dropped (including *all* of them), the HTTP response will
always be 207, and the payload will always contain granular per-event
error codes.
This effectively means the API can no longer return 404, ever.
Closes-Bug: #1855752
Change-Id: Ibad1b51e2cf50d00102295039b6e82bc00bec058
2019-12-09 09:58:53 -06:00
|
|
|
if any events could not be processed. The ``code`` attribute for the
|
2016-05-11 14:47:13 -04:00
|
|
|
event will explain further what went wrong.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
Nix os-server-external-events 404 condition
The POST /os-server-external-events API had the following confusing
behavior:
With multiple events in the payload, if *some* (but not all) were
dropped, the HTTP response was 207, with per-event 4xx error codes in
the payload. But if *all* of the events were dropped, the overall HTTP
response was 404 with no payload. Thus, especially for consumers sending
only one event at a time, it was impossible to distinguish e.g. "you
tried to send an event for a nonexistent instance" from "the instance
you specified hasn't landed on a host yet".
This fix gets rid of that sweeping 404 condition, so if *any* subset of
the events are dropped (including *all* of them), the HTTP response will
always be 207, and the payload will always contain granular per-event
error codes.
This effectively means the API can no longer return 404, ever.
Closes-Bug: #1855752
Change-Id: Ibad1b51e2cf50d00102295039b6e82bc00bec058
2019-12-09 09:58:53 -06:00
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403)
|
|
|
|
|
|
|
|
.. note:: Prior to the fix for `bug 1855752`_, error response code 404 may be
|
|
|
|
erroneously returned when all events failed.
|
|
|
|
|
|
|
|
.. _bug 1855752: https://bugs.launchpad.net/nova/+bug/1855752
|
2016-05-11 14:47:13 -04:00
|
|
|
|
2016-04-12 09:03:46 -04:00
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
|
2016-04-12 09:03:46 -04:00
|
|
|
- events: events
|
2016-05-11 14:47:13 -04:00
|
|
|
- name: event_name
|
2016-04-12 09:03:46 -04:00
|
|
|
- server_uuid: server_uuid
|
2016-05-11 14:47:13 -04:00
|
|
|
- status: event_status
|
|
|
|
- tag: event_tag
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-05-11 14:47:13 -04:00
|
|
|
**Example Run Events**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-server-external-events/event-create-req.json
|
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- events: events
|
|
|
|
- code: code
|
2016-05-11 14:47:13 -04:00
|
|
|
- name: event_name
|
2016-04-12 09:03:46 -04:00
|
|
|
- server_uuid: server_uuid
|
2016-05-11 14:47:13 -04:00
|
|
|
- status: event_status
|
|
|
|
- tag: event_tag
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-05-11 14:47:13 -04:00
|
|
|
**Example Run Events**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-server-external-events/event-create-resp.json
|
|
|
|
:language: javascript
|