summaryrefslogtreecommitdiff
path: root/ironic/api/controllers/v1/utils.py
diff options
context:
space:
mode:
authorHarald Jensås <hjensas@redhat.com>2019-01-19 23:33:31 +0100
committerHarald Jensås <hjensas@redhat.com>2019-02-15 06:17:02 +0100
commit50205ca0724c9f03731e3441bc525b5c3650369f (patch)
treebec2803b8eb6c7aa080f01febb0612c6c3fd7685 /ironic/api/controllers/v1/utils.py
parente34941c3279907a013b2b6ae023a089e58c3ed11 (diff)
downloadironic-50205ca0724c9f03731e3441bc525b5c3650369f.tar.gz
API - Implement /events endpoint
Implements the POST /events endpoint. Allows external entities to send events to Ironic. The default policy for the new endpoint is "rule:is_admin". Initial support for 'network' events properties implemented but the EventsController will simply log a debug entry. Story: 1304673 Task: 28988 Change-Id: I2cfebf2d0bedd35a33db7af60eaec0e5083fe16f
Diffstat (limited to 'ironic/api/controllers/v1/utils.py')
-rw-r--r--ironic/api/controllers/v1/utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ironic/api/controllers/v1/utils.py b/ironic/api/controllers/v1/utils.py
index f2c7a5ec9..9846179a2 100644
--- a/ironic/api/controllers/v1/utils.py
+++ b/ironic/api/controllers/v1/utils.py
@@ -421,6 +421,7 @@ VERSIONED_FIELDS = {
'owner': versions.MINOR_50_NODE_OWNER,
'description': versions.MINOR_51_NODE_DESCRIPTION,
'allocation_uuid': versions.MINOR_52_ALLOCATION,
+ 'events': versions.MINOR_54_EVENTS,
}
for field in V31_FIELDS:
@@ -1022,3 +1023,11 @@ def allow_port_is_smartnic():
return ((pecan.request.version.minor
>= versions.MINOR_53_PORT_SMARTNIC)
and objects.Port.supports_is_smartnic())
+
+
+def allow_expose_events():
+ """Check if accessing events endpoint is allowed.
+
+ Version 1.54 of the API added the events endpoint.
+ """
+ return pecan.request.version.minor >= versions.MINOR_54_EVENTS