Debian Codegraph @

api-ref/source/device_profile.inc

raw
1 .. -*- rst -*-
2 .. needs:body_verification
3
4 Device Profiles
5 +++++++++++++++
6
7 Lists, creates, shows details for, updates and deletes device profiles.
8
9 A `device_profile
10 <http://specs.openstack.org/openstack/cyborg-specs/specs/train/implemented/device-profiles.html>`_
11 is a named set of the user requirements for one or more
12 accelerators. It can be viewed as a flavor for devices. Broadly it includes
13 two things: the desired amounts of specific resource classes and the
14 requirements that the resource provider(s) must satisfy. While the resource
15 classes are the same as those known to Placement, some requirements would
16 correspond to Placement traits and others to properties that Cyborg alone
17 knows about.
18
19
20 List Device Profiles
21 --------------------
22
23 .. rest_method:: GET /v2/device_profiles
24
25 Lists UUIDs, names, groups and more information for all device profiles.
26
27 Normal response codes: 200
28
29 Error response codes: unauthorized(401), forbidden(403)
30
31 Response
32 ========
33 .. rest_parameters:: parameters.yaml
34
35 - device_profiles: device_profiles
36 - name: device_prof_name_resp
37 - uuid: device_profile_uuid_resp
38 - description: device_profile_description_resp
39 - groups: device_prof_groups_resp
40 - created_at: created
41 - updated_at: updated
42 - links: links
43
44 **Example response: list all device profiles**
45
46 .. literalinclude:: ../../doc/api_samples/device_profiles/device_profiles-list-resp.json
47 :language: javascript
48
49 Get One Device Profile
50 ----------------------
51
52 .. rest_method:: GET /v2/device_profiles/{device_profile_name_or_uuid}
53
54 Gets the UUID, name, groups for one device_profile with the specified name or UUID.
55
56 Normal response codes: 200
57
58 Error response codes: badRequest(400), unauthorized(401), forbidden(403)
59
60 Request
61 =======
62 .. rest_parameters:: parameters.yaml
63
64 - device_profile_uuid: device_profile_uuid_v_21
65 - device_profile_name_or_uuid: device_profile_name_or_uuid
66
67 Response
68 ========
69 .. rest_parameters:: parameters.yaml
70
71 - device_profile: device_profile
72 - name: device_prof_name_resp
73 - uuid: device_profile_uuid_resp
74 - description: device_profile_description_resp
75 - groups: device_prof_groups_resp
76 - created_at: created
77 - updated_at: updated
78 - links: links
79
80 **Example response: get details of a specific device profile(v2.2)**
81
82 .. literalinclude:: ../../doc/api_samples/device_profiles/v22/device_profiles-getone-resp.json
83 :language: javascript
84
85 Create Device Profile
86 ---------------------
87
88 .. rest_method:: POST /v2/device_profiles
89
90 Creates a device profile. The payload should have these fields:
91
92 Normal response codes: 201
93
94 Error response codes: badRequest(400), unauthorized(401), forbidden(403),
95 conflict(409)
96
97 Request
98 =======
99 .. rest_parameters:: parameters.yaml
100
101 - name: device_prof_name_req
102 - groups: device_prof_groups_req
103 - description: device_prof_description_req
104
105 Response
106 ========
107 .. rest_parameters:: parameters.yaml
108
109 - name: device_prof_name_resp
110 - uuid: device_profile_uuid_resp
111 - description: device_profile_description_resp
112 - groups: device_prof_groups_resp
113 - created_at: created
114 - updated_at: updated
115 - links: links
116
117 **Example post curl with resource/trait**
118
119 .. literalinclude:: ../../doc/api_samples/device_profiles/device_profiles-post-curl.json
120 :language: javascript
121
122 **Example post curl with a cyborg property when bitstream is required**
123
124 .. literalinclude:: ../../doc/api_samples/device_profiles/device_profiles-post-curl-with-bitstream.json
125 :language: javascript
126
127 **Example response: create a device profile**
128
129 .. literalinclude:: ../../doc/api_samples/device_profiles/device_profiles-create-resp.json
130 :language: javascript
131
132 Delete One Device Profile by uuid
133 ---------------------------------
134
135 .. rest_method:: DELETE /v2/device_profiles/{device_profile_uuid}
136
137 Delete a device profile. No query parameters required.
138
139 Delete Multiple Device Profiles by names
140 ----------------------------------------
141
142 .. rest_method:: DELETE /v2/device_profiles?value={device_profile_name1},{device_profile_name2}
143
144 In the URL, Device profiles to be deleted should be in comma-delimited list of
145 device profile names.
146
147 .. note::
148 Today we do not allow deletion of a device profile when it is in use by
149 VMs, because ARQs have a foreign key on device profile table. But we copy
150 the device profile groups into the ARQ, so this foreign key is not needed.
151 So we can improve in Ussuri.
152
153 Response
154 ========
155
156 Normal response codes: 204
157
158 There is no body content for the response of a successful DELETE query