5 When creating an edge, the CRUD service will validate:
6 * properties match the defined schema
7 * relationship is valid between the source and target
9 URL: https://<host>:9520/services/inventory/relationships/v11/tosca.relationships.HostedOn/
13 "source":"services/inventory/v11/vserver/0",
14 "target":"services/inventory/v11/pserver/7",
17 "prevent-delete": "IN",
18 "delete-other-v": "NONE",
19 "contains-other-v": "NONE"
26 "id":"215x5m-6hc-d6vp-oe08g",
27 "type":"tosca.relationships.HostedOn",
28 "url":"services/inventory/relationships/v11/has/215x5m-6hc-d6vp-oe08g",
29 "source":"services/inventory/v11/vserver/0",
30 "target":"services/inventory/v11/pserver/7",
33 "prevent-delete": "IN",
34 "delete-other-v": "NONE",
35 "contains-other-v": "NONE"
39 Code: 400 (BAD REQUEST)
40 Content: Error message describing the bad request failure.
41 Situation: Invalid Payload or schema error.
44 Content: Error message describing the Authorization failure.
45 Situation: Authorization failure.
47 Code: 415 (UNSUPPORTED MEDIA TYPE)
48 Situation: Unsupported content type .
50 Code: 500 (Internal Server Error)
51 Content: Error message describing the failure.
52 Situation: Any scenario not covered by the above error codes.
54 Optionally, an edge can be created by posting to an endpoint which doesn't include the edge type.
56 URL: https://<host>:9520/services/inventory/relationships/v11/
60 "type":"tosca.relationships.HostedOn",
61 "source":"services/inventory/v11/vserver/0",
62 "target":"services/inventory/v11/pserver/7",
65 "prevent-delete": "IN",
66 "delete-other-v": "NONE",
67 "contains-other-v": "NONE"
72 Content: Same as above
74 Code: 400 (BAD REQUEST)
75 Content: Error message describing the bad request failure.
76 Situation: Invalid Payload or schema error.
79 Content: Error message describing the Authorization failure.
80 Situation: Authorization failure.
82 Code: 415 (UNSUPPORTED MEDIA TYPE)
83 Situation: Unsupported content type .
85 Code: 500 (Internal Server Error)
86 Content: Error message describing the failure.
87 Situation: Any scenario not covered by the above error codes.
89 ### Create Edge With Auto-Population Of Edge Properties
90 An alternate endpoint exists for creating edges which follows all of the conventions of the above endpoints, with the addition that properties defined in the db edge rules produced by the A&AI will be automatically populated for the edge.
92 URL: https://<host>:9520/services/resources/relationships/tosca.relationships.HostedOn/
96 "source":"services/inventory/v11/vserver/0",
97 "target":"services/inventory/v11/pserver/7",
106 "id":"215x5m-6hc-d6vp-oe08g",
107 "type":"tosca.relationships.HostedOn",
108 "url":"services/inventory/relationships/v11/has/215x5m-6hc-d6vp-oe08g",
109 "source":"services/inventory/v11/vserver/0",
110 "target":"services/inventory/v11/pserver/7",
113 "prevent-delete": "IN",
114 "delete-other-v": "NONE",
115 "contains-other-v": "NONE"
119 Code: 400 (BAD REQUEST)
120 Content: Error message describing the bad request failure.
121 Situation: Invalid Payload or schema error.
123 Code: 403 (FORBIDDEN)
124 Content: Error message describing the Authorization failure.
125 Situation: Authorization failure.
127 Code: 415 (UNSUPPORTED MEDIA TYPE)
128 Situation: Unsupported content type .
130 Code: 500 (Internal Server Error)
131 Content: Error message describing the failure.
132 Situation: Any scenario not covered by the above error codes.
134 The same option to POST to an endpoint without specifying a type in the URL exists for this endpoint as well:
136 URL: https://<host>:9520/services/resources/relationships/
140 "type":"tosca.relationships.HostedOn",
141 "source":"services/inventory/v11/vserver/0",
142 "target":"services/inventory/v11/pserver/7",
145 "prevent-delete": "IN",
146 "delete-other-v": "NONE",
147 "contains-other-v": "NONE"
152 Content: Same as above
154 Code: 400 (BAD REQUEST)
155 Content: Error message describing the bad request failure.
156 Situation: Invalid Payload or schema error.
158 Code: 403 (FORBIDDEN)
159 Content: Error message describing the Authorization failure.
160 Situation: Authorization failure.
162 Code: 415 (UNSUPPORTED MEDIA TYPE)
163 Situation: Unsupported content type .
165 Code: 500 (Internal Server Error)
166 Content: Error message describing the failure.
167 Situation: Any scenario not covered by the above error codes.
171 URL: https://<host>:9520/services/inventory/relationships/v11/tosca.relationships.HostedOn/<id>
177 "id":"215x5m-6hc-d6vp-oe08g",
178 "type":"tosca.relationships.HostedOn",
179 "url":"services/inventory/relationships/tosca.relationships.HostedOn/has/215x5m-6hc-d6vp-oe08g",
180 "source":"services/inventory/v11/vserver/8400",
181 "target":"services/inventory/v11/pserver/40964272",
184 "prevent-delete": "IN",
185 "delete-other-v": "NONE",
186 "contains-other-v": "NONE"
190 Code: 404 (NOT FOUND)
191 Situation: Resource Not found
193 Code: 403 (FORBIDDEN)
194 Content: Error message describing the Authorization failure.
195 Situation: Authorization failure.
197 Code: 415 (UNSUPPORTED MEDIA TYPE)
198 Situation: Unsupported content type .
200 Code: 500 (Internal Server Error)
201 Content: Error message describing the failure.
202 Situation: Any scenario not covered by the above error codes.
206 URL: https://<host>:9520/services/inventory/relationships/v11/tosca.relationships.HostedOn
207 Optional Query Param: ?multiplicity=many
214 "id":"1crwnu-6hc-d6vp-oe08g",
215 "type":"tosca.relationships.HostedOn",
216 "url":"services/inventory/relationships/v11/tosca.relationships.HostedOn/1crwnu-6hc-d6vp-oe08g",
217 "source":"services/inventory/v11/vserver/8400",
218 "target":"services/inventory/v11/pserver/40964272"
221 "id":"215x5m-6hc-d6vp-oe08g",
222 "type":"tosca.relationships.HostedOn",
223 "url":"services/inventory/relationships/v11/tosca.relationships.HostedOn/215x5m-6hc-d6vp-oe08g",
224 "source":"services/inventory/v11/vserver/8400",
225 "target":"services/inventory/v11/pserver/40964272"
229 Code: 404 (NOT FOUND)
230 Situation: Resource Not found
232 Code: 403 (FORBIDDEN)
233 Content: Error message describing the Authorization failure.
234 Situation: Authorization failure.
236 Code: 415 (UNSUPPORTED MEDIA TYPE)
237 Situation: Unsupported content type .
239 Code: 500 (Internal Server Error)
240 Content: Error message describing the failure.
241 Situation: Any scenario not covered by the above error codes.
245 The PUT command is used to modify an existing edge. By default, the edge data is replaced by the content of the payload. However, the following parameter can be added to the header to perform a PATCH instead of a replace:
246 **X-HTTP-Method-Override=Patch**
248 URL: https://<host>:9520/services/inventory/relationships/v11/tosca.relationships.HostedOn/<id>
250 Body: (**Note that the source and target can not be modified)
254 "prevent-delete": "IN",
255 "delete-other-v": "NONE",
256 "contains-other-v": "NONE"
261 Content: Same as POST
263 Code: 400 (BAD REQUEST)
264 Content: Error message describing the bad request failure.
265 Situation: Invalid Payload or schema error.
267 Code: 403 (FORBIDDEN)
268 Content: Error message describing the Authorization failure.
269 Situation: Authorization failure.
271 Code: 415 (UNSUPPORTED MEDIA TYPE)
272 Situation: Unsupported content type .
274 Code: 500 (Internal Server Error)
275 Content: Error message describing the failure.
276 Situation: Any scenario not covered by the above error codes.
280 URL: https://<host>:9520/services/inventory/relationships/v11/tosca.relationships.HostedOn/<id>
281 Method: PATCH (Content-Type header set to application/merge-patch+json)
285 "prevent-delete":"OUT"
290 Content: Same as POST
292 Code: 400 (BAD REQUEST)
293 Content: Error message describing the bad request failure.
294 Situation: Invalid Payload or schema error.
296 Code: 403 (FORBIDDEN)
297 Content: Error message describing the Authorization failure.
298 Situation: Authorization failure.
300 Code: 415 (UNSUPPORTED MEDIA TYPE)
301 Situation: Unsupported content type .
303 Code: 500 (Internal Server Error)
304 Content: Error message describing the failure.
305 Situation: Any scenario not covered by the above error codes.
309 URL: https://<host>:9520/services/inventory/relationships/v11/tosca.relationships.HostedOn/<id>
314 Code: 404 (NOT FOUND)
315 Situation: Resource not found
317 Code: 403 (FORBIDDEN)
318 Content: Error message describing the Authorization failure.
319 Situation: Authorization failure.
321 Code: 415 (UNSUPPORTED MEDIA TYPE)
322 Situation: Unsupported content type .
324 Code: 500 (Internal Server Error)
325 Content: Error message describing the failure.
326 Situation: Any scenario not covered by the above error codes.