summaryrefslogtreecommitdiff
path: root/placement-api-ref/source/resource_provider.inc
blob: 8676ca239b1d451e35a33f14bee7df7bc6ae79c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
=================
Resource Provider
=================

See `Resource providers`_ for a description.
This group of API calls works with a single resource provider
identified by `uuid`. One resource provider can be listed, updated and
deleted.

Show resource provider
======================

.. rest_method:: GET /resource_providers/{uuid}

Return a representation of the resource provider identified by `{uuid}`.

Normal Response Codes: 200

Error response codes: itemNotFound(404)

Request
-------

.. rest_parameters:: parameters.yaml

  - uuid: resource_provider_uuid_path

Response
--------

.. rest_parameters:: parameters.yaml

  - generation: resource_provider_generation
  - uuid: resource_provider_uuid
  - links: resource_provider_links
  - name: resource_provider_name
  - parent_provider_uuid: resource_provider_parent_provider_uuid_required
  - root_provider_uuid: resource_provider_root_provider_uuid_required

Response Example
----------------

.. literalinclude:: ./samples/resource_providers/get-resource_provider.json
   :language: javascript

Update resource provider
========================

.. rest_method:: PUT /resource_providers/{uuid}

Update the name of the resource provider identified by `{uuid}`.

Normal Response Codes: 200

Error response codes: badRequest(400), itemNotFound(404), conflict(409)

A `409 Conflict` response code will be returned if another resource
provider exists with the provided name.

Request
-------

.. rest_parameters:: parameters.yaml

  - uuid: resource_provider_uuid_path
  - name: resource_provider_name
  - parent_provider_uuid: resource_provider_parent_provider_uuid

Request example
---------------

.. literalinclude:: ./samples/resource_providers/update-resource_provider-request.json
   :language: javascript

Response
--------

.. rest_parameters:: parameters.yaml

  - generation: resource_provider_generation
  - uuid: resource_provider_uuid
  - links: resource_provider_links
  - name: resource_provider_name
  - parent_provider_uuid: resource_provider_parent_provider_uuid_required
  - root_provider_uuid: resource_provider_root_provider_uuid_required

Response Example
----------------

.. literalinclude:: ./samples/resource_providers/update-resource_provider.json
   :language: javascript

Delete resource provider
========================

.. rest_method:: DELETE /resource_providers/{uuid}

Delete the resource provider identified by `{uuid}`.
This will also disassociate aggregates and delete inventories.

Normal Response Codes: 204

Error response codes: itemNotFound(404), conflict(409)

A `409 Conflict` response code will be returned if there exist
allocations records for any of the inventories that would be deleted
as a result of removing the resource provider.

Request
-------

.. rest_parameters:: parameters.yaml

  - uuid: resource_provider_uuid_path

Response
--------

No body content is returned on a successful DELETE.