summaryrefslogtreecommitdiff
path: root/api-ref/source
diff options
context:
space:
mode:
authorTzu-Mainn Chen <tzumainn@redhat.com>2019-11-21 21:27:36 +0000
committerTzu-Mainn Chen <tzumainn@redhat.com>2019-12-10 19:00:33 +0000
commit3fbb560af1e4d53e701c423311e4d01cb5b1f62a (patch)
tree34cbfbc05105f09efa2914e7ab1f714e66206d62 /api-ref/source
parent306aaccca6f47b986c725b02fba16c4a414eacbc (diff)
downloadironic-3fbb560af1e4d53e701c423311e4d01cb5b1f62a.tar.gz
Add owner to allocations and create relevant policies
Add an owner to allocations. Depending on policy, a non-admin can then create an allocation and have the owner set to their project. Allocation processing then respects the owner. Change-Id: I2965a4a601b9fa2c0212097da37b104a3e5514df Story: #2006506 Task: #37540
Diffstat (limited to 'api-ref/source')
-rw-r--r--api-ref/source/baremetal-api-v1-allocation.inc15
-rw-r--r--api-ref/source/parameters.yaml2
-rw-r--r--api-ref/source/samples/allocation-create-response.json1
-rw-r--r--api-ref/source/samples/allocation-show-response.json1
-rw-r--r--api-ref/source/samples/allocation-update-response.json1
-rw-r--r--api-ref/source/samples/allocations-list-response.json2
6 files changed, 21 insertions, 1 deletions
diff --git a/api-ref/source/baremetal-api-v1-allocation.inc b/api-ref/source/baremetal-api-v1-allocation.inc
index 040450d9c..808005dba 100644
--- a/api-ref/source/baremetal-api-v1-allocation.inc
+++ b/api-ref/source/baremetal-api-v1-allocation.inc
@@ -47,6 +47,9 @@ parameters must be missing or match the provided node.
.. versionadded:: 1.58
Added support for backfilling allocations.
+.. versionadded:: 1.60
+ Introduced the ``owner`` field.
+
Normal response codes: 201
Error response codes: 400, 401, 403, 409, 503
@@ -63,6 +66,7 @@ Request
- uuid: req_uuid
- extra: req_extra
- node: req_allocation_node
+ - owner: owner
Request Example
---------------
@@ -83,6 +87,7 @@ Response Parameters
- resource_class: allocation_resource_class
- state: allocation_state
- traits: allocation_traits
+ - owner: owner
- extra: extra
- created_at: created_at
- updated_at: updated_at
@@ -104,6 +109,9 @@ Lists all Allocations.
.. versionadded:: 1.52
Allocation API was introduced.
+.. versionadded:: 1.60
+ Introduced the ``owner`` field.
+
Normal response codes: 200
Error response codes: 400, 401, 403, 404
@@ -116,6 +124,7 @@ Request
- node: r_allocation_node
- resource_class: r_resource_class
- state: r_allocation_state
+ - owner: owner
- fields: fields
- limit: limit
- marker: marker
@@ -135,6 +144,7 @@ Response Parameters
- resource_class: allocation_resource_class
- state: allocation_state
- traits: allocation_traits
+ - owner: owner
- extra: extra
- created_at: created_at
- updated_at: updated_at
@@ -156,6 +166,9 @@ Shows details for an Allocation.
.. versionadded:: 1.52
Allocation API was introduced.
+.. versionadded:: 1.60
+ Introduced the ``owner`` field.
+
Normal response codes: 200
Error response codes: 400, 401, 403, 404
@@ -181,6 +194,7 @@ Response Parameters
- resource_class: allocation_resource_class
- state: allocation_state
- traits: allocation_traits
+ - owner: owner
- extra: extra
- created_at: created_at
- updated_at: updated_at
@@ -237,6 +251,7 @@ Response Parameters
- resource_class: allocation_resource_class
- state: allocation_state
- traits: allocation_traits
+ - owner: owner
- extra: extra
- created_at: created_at
- updated_at: updated_at
diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml
index 8707d111a..c2d15d54d 100644
--- a/api-ref/source/parameters.yaml
+++ b/api-ref/source/parameters.yaml
@@ -1048,7 +1048,7 @@ nodes:
type: array
owner:
description: |
- A string or UUID of the tenant who owns the baremetal node.
+ A string or UUID of the tenant who owns the object.
in: body
required: false
type: string
diff --git a/api-ref/source/samples/allocation-create-response.json b/api-ref/source/samples/allocation-create-response.json
index 8016ffc14..67357d7f5 100644
--- a/api-ref/source/samples/allocation-create-response.json
+++ b/api-ref/source/samples/allocation-create-response.json
@@ -15,6 +15,7 @@
],
"name": "allocation-1",
"node_uuid": null,
+ "owner": null,
"resource_class": "bm-large",
"state": "allocating",
"traits": [],
diff --git a/api-ref/source/samples/allocation-show-response.json b/api-ref/source/samples/allocation-show-response.json
index 62d13cc83..faf572e93 100644
--- a/api-ref/source/samples/allocation-show-response.json
+++ b/api-ref/source/samples/allocation-show-response.json
@@ -15,6 +15,7 @@
],
"name": "allocation-1",
"node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d",
+ "owner": null,
"resource_class": "bm-large",
"state": "active",
"traits": [],
diff --git a/api-ref/source/samples/allocation-update-response.json b/api-ref/source/samples/allocation-update-response.json
index 682e46d19..598699ce0 100644
--- a/api-ref/source/samples/allocation-update-response.json
+++ b/api-ref/source/samples/allocation-update-response.json
@@ -17,6 +17,7 @@
},
"last_error": null,
"created_at": "2019-06-04T07:46:25+00:00",
+ "owner": null,
"resource_class": "CUSTOM_GOLD",
"updated_at": "2019-06-06T03:28:19.496960+00:00",
"traits": [],
diff --git a/api-ref/source/samples/allocations-list-response.json b/api-ref/source/samples/allocations-list-response.json
index ff05159f0..992cdc1a3 100644
--- a/api-ref/source/samples/allocations-list-response.json
+++ b/api-ref/source/samples/allocations-list-response.json
@@ -17,6 +17,7 @@
],
"name": "allocation-1",
"node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d",
+ "owner": null,
"resource_class": "bm-large",
"state": "active",
"traits": [],
@@ -40,6 +41,7 @@
],
"name": "allocation-2",
"node_uuid": null,
+ "owner": null,
"resource_class": "bm-large",
"state": "error",
"traits": [