Added SO-OOF/HAS API document
[optf/osdf.git] / docs / apis / OOF_HAS_R2_Interface.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
2 .. http://creativecommons.org/licenses/by/4.0\r
3 \r
4 OOF-HAS Beijing Interfaces\r
5 ==========================\r
6 \r
7 OOF-HAS APIs\r
8 ============\r
9 \r
10 Create/Update a homing optimization service instance\r
11 ++++++++++++++++++++++++++++++++++++++++++++++++++++\r
12 \r
13 +--------------------+-------------------------------------+\r
14 |Interface Definition|Description                          |\r
15 +====================+=====================================+\r
16 |URI                 |{serverRoot}/oof/has/v2              |\r
17 +--------------------+-------------------------------------+\r
18 |Operation Type      |POST                                 |\r
19 +--------------------+-------------------------------------+\r
20 |Content-Type        |application/json                     |\r
21 +--------------------+-------------------------------------+\r
22 \r
23 \r
24 Request Headers:\r
25 \r
26 +----------------+-----------+-------------------------------------------------------------------------------------------+\r
27 | Header Name    | Qualifier | Description                                                                               |\r
28 +================+===========+===========================================================================================+\r
29 | Accept         | N         | Determines the format of the body of the response. Valid value is “application/json”      |\r
30 +----------------+-----------+-------------------------------------------------------------------------------------------+\r
31 | Authorization  | Y         | Supplies Basic Authentication credentials for the request. If the Authorization header is |\r
32 |                |           | missing, then an HTTP 400 Invalid Request response is returned. If the string supplied is |\r
33 |                |           | invalid, then an HTTP 401 Unauthorized response is returned.                              |\r
34 +----------------+-----------+-------------------------------------------------------------------------------------------+\r
35 | Content-Type   | Y         | Determines the format of the request content. Only application/json is supported.         |\r
36 +----------------+-----------+-------------------------------------------------------------------------------------------+\r
37 | Content-Length | N         | Number of bytes in the body of the request. Note that content length is limited to 1 MB.  |\r
38 +----------------+-----------+-------------------------------------------------------------------------------------------+\r
39 \r
40 \r
41 Request Body:\r
42 \r
43 +---------------+-----------+-------------+----------------------+---------------+------------------------------------------+\r
44 | Attribute     | Qualifier | Cardinality | Content              | Domain Values | Description                              |\r
45 +===============+===========+=============+======================+===============+==========================================+\r
46 | requestInfo   | M         | 1           | RequestInfo Object   | -             | The content of the RequestInfo object.   |\r
47 +---------------+-----------+-------------+----------------------+---------------+------------------------------------------+\r
48 | placementInfo | M         | 1           | PlacementInfo Object | -             | The Content of the PlacementInfo object. |\r
49 +---------------+-----------+-------------+----------------------+---------------+------------------------------------------+\r
50 | licenseInfo   | M         | 1           | LicenseInfo Object   | -             | The Content of the LicenseInfo object.   |\r
51 +---------------+-----------+-------------+----------------------+---------------+------------------------------------------+\r
52 | serviceInfo   | M         | 1           | ServiceInfo Object   | -             | The Content of the ServiceInfo object.   |\r
53 +---------------+-----------+-------------+----------------------+---------------+------------------------------------------+\r
54 \r
55 \r
56 RequestInfo Object:\r
57 \r
58 +---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+\r
59 | Attribute     | Qualifier | Cardinality | Content         | Domain Values | Description                                                           |\r
60 +===============+===========+=============+=================+===============+=======================================================================+\r
61 | transactionId | M         | 1           | UUID/String     | -             | A unique ID to track an ONAP transaction.                             |\r
62 +---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+\r
63 | requestId     | M         | 1           | UUID/String     | -             | A unique ID to track multiple requests associated with a transaction. |\r
64 +---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+\r
65 | callbackUrl   | M         | 1           | URL             | -             | The end point of a callback service where recommendations are posted. |\r
66 +---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+\r
67 | sourceId      | M         | 1           | String          | -             | The unique ID of a client making an optimization call.                |\r
68 +---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+\r
69 | requestType   | M         | 1           | String          | create,       | The type of a request                                                 |\r
70 |               |           |             |                 | update,       |                                                                       |\r
71 |               |           |             |                 | delete        |                                                                       |\r
72 +---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+\r
73 | numSolutions  | O         | 1           | Integer         | -             | Expected number of solutions.                                         |\r
74 +---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+\r
75 | optimizers    | M         | 1..N        | List of Strings | placement     | A list of optimization services.                                      |\r
76 +---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+\r
77 | timeout       | M         | 1           | Integer         | -             | A tolerance window (in min) for expecting solutions.                  |\r
78 +---------------+-----------+-------------+-----------------+---------------+-----------------------------------------------------------------------+\r
79 \r
80 \r
81 PlacementInfo Object:\r
82 \r
83 +-------------------+-----------+-------------+--------------------------------+---------------+---------------------------------------------------+\r
84 | Attribute         | Qualifier | Cardinality | Content                        | Domain Values | Description                                       |\r
85 +===================+===========+=============+================================+===============+===================================================+\r
86 | requestParameters | M         | 1           | JSON BLOB                      | -             | A service ordering information.                   |\r
87 +-------------------+-----------+-------------+--------------------------------+---------------+---------------------------------------------------+\r
88 | placementDemands  | M         | 1..N        | List of PlacementDemand Object | -             | The resource information for a placement service. |\r
89 +-------------------+-----------+-------------+--------------------------------+---------------+---------------------------------------------------+\r
90 \r
91 \r
92 PlacementDemand Object:\r
93 \r
94 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
95 | Attribute          | Qualifier | Cardinality | Content              | Domain Values | Description                                                     |\r
96 +====================+===========+=============+======================+===============+=================================================================+\r
97 | resourceModuleName | M         | 1           | String               | -             | A resource name as defined in a service model.                  |\r
98 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
99 | serviceResourceId  | M         | 1           | String               | -             | A unique resource Id with a local scope between client and OOF. |\r
100 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
101 | tenantId           | O         | 1           | String               | -             | A tenant Id as defined in the ordering system.                  |\r
102 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
103 | resourceModelInfo  | M         | 1           | ModelMetaData Object | -             | Resource model information as defined in SDC.                   |\r
104 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
105 | existingCandidates | O         | 1           | Candidates Object    | -             | The existing placement information of a resource.               |\r
106 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
107 | excludedCandidates | O         | 1           | Candidates Object    | -             | Candidates that need to be excluded from solutions.             |\r
108 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
109 | requiredCandidates | O         | 1           | Candidates Object    | -             | Candidates that must be included in solutions.                  |\r
110 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
111 \r
112 \r
113 ModelMetaData Object:\r
114 \r
115 +------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+\r
116 | Attribute              | Qualifier | Cardinality | Content | Domain Values | Description                                               |\r
117 +========================+===========+=============+=========+===============+===========================================================+\r
118 | modelInvariantId       | M         | 1           | String  | -             | A model invariant Id as defined in a service model.       |\r
119 +------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+\r
120 | modelVersionId         | M         | 1           | String  | -             | A unique model Id as defined in a service model.          |\r
121 +------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+\r
122 | modelName              | O         | 1           | String  | -             | A model name as defined in a service model.               |\r
123 +------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+\r
124 | modelType              | O         | 1           | String  | -             | A model type as defined in a service model.               |\r
125 +------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+\r
126 | modelVersion           | O         | 1           | String  | -             | A model version as defined in a service model.            |\r
127 +------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+\r
128 | modelCustomizationName | O         | 1           | String  | -             | A model customization name as defined in a service model. |\r
129 +------------------------+-----------+-------------+---------+---------------+-----------------------------------------------------------+\r
130 \r
131 \r
132 Candidates Object:\r
133 \r
134 +----------------+-----------+-------------+-----------------+----------------------+--------------------------+\r
135 | Attribute      | Qualifier | Cardinality | Content         | Domain Values        | Description              |\r
136 +================+===========+=============+=================+======================+==========================+\r
137 | identifierType | M         | 1           | String          | service_instance_id, | The type of a candidate. |\r
138 |                |           |             |                 | vnf_name,            |                          |\r
139 |                |           |             |                 | cloud_region_id      |                          |\r
140 +----------------+-----------+-------------+-----------------+----------------------+--------------------------+\r
141 | identifiers    | M         | 1..N        | List of Strings | -                    | A list of identifiers.   |\r
142 +----------------+-----------+-------------+-----------------+----------------------+--------------------------+\r
143 \r
144 \r
145 ServiceInfo Object:\r
146 \r
147 +-------------------+-----------+-------------+----------------------+---------------+--------------------------------------------------+\r
148 | Attribute         | Qualifier | Cardinality | Content              | Domain Values | Description                                      |\r
149 +===================+===========+=============+======================+===============+==================================================+\r
150 | serviceInstanceId | M         | 1           | String               | -             | A service instance id associated with a request. |\r
151 +-------------------+-----------+-------------+----------------------+---------------+--------------------------------------------------+\r
152 | serviceModelInfo  | M         | 1           | ModelMetaData Object | -             | A list of identifiers.                           |\r
153 +-------------------+-----------+-------------+----------------------+---------------+--------------------------------------------------+\r
154 \r
155 \r
156 LicenseInfo Object:\r
157 \r
158 +----------------+-----------+-------------+-------------------------------+---------------+--------------------------------------------+\r
159 | Attribute      | Qualifier | Cardinality | Content                       | Domain Values | Description                                |\r
160 +================+===========+=============+===============================+===============+============================================+\r
161 | licenseDemands | M         | 1           | List of LicenseDemands Object | -             | A list of resources for license selection. |\r
162 +----------------+-----------+-------------+-------------------------------+---------------+--------------------------------------------+\r
163 \r
164 \r
165 LicenseDemands Object:\r
166 \r
167 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
168 | Attribute          | Qualifier | Cardinality | Content              | Domain Values | Description                                                     |\r
169 +====================+===========+=============+======================+===============+=================================================================+\r
170 | resourceModuleName | M         | 1           | String               | -             | A resource name as defined in a service model.                  |\r
171 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
172 | serviceResourceId  | M         | 1           | String               | -             | A unique resource Id with a local scope between client and OOF. |\r
173 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
174 | resourceModelInfo  | M         | 1           | ModelMetaData Object | -             | Resource model information as defined in a service model.       |\r
175 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
176 | existingLicenses   | O         | 1           | LicenseModel Object  | -             | Existing license information assigned to a resource.            |\r
177 +--------------------+-----------+-------------+----------------------+---------------+-----------------------------------------------------------------+\r
178 \r
179 \r
180 LicenseModel Object:\r
181 \r
182 +---------------------+-----------+-------------+-----------------+---------------+----------------------------------------------------+\r
183 | Attribute           | Qualifier | Cardinality | Content         | Domain Values | Description                                        |\r
184 +=====================+===========+=============+=================+===============+====================================================+\r
185 | entitlementPoolUUID | M         | 1..N        | List of Strings | -             | Entitlement pool UUIDs associated with a resoruce. |\r
186 +---------------------+-----------+-------------+-----------------+---------------+----------------------------------------------------+\r
187 | licenseKeyGroupUUID | M         | 1..N        | List of Strings | -             | License key groups associated with a resource      |\r
188 +---------------------+-----------+-------------+-----------------+---------------+----------------------------------------------------+\r
189 \r
190 \r
191 Synchronous Response Body:\r
192 \r
193 +---------------+-----------+-------------+-------------+------------------+------------------------------------------------------------------------+\r
194 | Attribute     | Qualifier | Cardinality | Content     | Domain Values    | Description                                                            |\r
195 +===============+===========+=============+=============+==================+========================================================================+\r
196 | requestId     | M         | 1           | UUID/String | -                | A unique Id for an ONAP transaction.                                   |\r
197 +---------------+-----------+-------------+-------------+------------------+------------------------------------------------------------------------+\r
198 | transactionId | M         | 1           | UUID/String | -                | A unique ID to tranck multiple requests associated with a transaction. |\r
199 +---------------+-----------+-------------+-------------+------------------+------------------------------------------------------------------------+\r
200 | statusMessage | O         | 1           | String      | -                | Reasoning if a requestStatus is failure.                               |\r
201 +---------------+-----------+-------------+-------------+------------------+------------------------------------------------------------------------+\r
202 | requestStatus | M         | 1           | String      | success, failure | The status of a request.                                               |\r
203 +---------------+-----------+-------------+-------------+------------------+------------------------------------------------------------------------+\r
204 \r
205 \r
206 Asyncronous Response Body:\r
207 \r
208 +---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+\r
209 | Attribute     | Qualifier | Cardinality | Content         | Domain Values | Description                                                            |\r
210 +===============+===========+=============+=================+===============+========================================================================+\r
211 | requestId     | M         | 1           | UUID/String     | -             | A unique Id for an ONAP transaction.                                   |\r
212 +---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+\r
213 | transactionId | M         | 1           | UUID/String     | -             | A unique ID to tranck multiple requests associated with a transaction. |\r
214 +---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+\r
215 | statusMessage | O         | 1           | String          | -             | Reasoning if requestStatus is failure.                                 |\r
216 +---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+\r
217 | requestStatus | M         | 1           | String          | success,      | The status of a request.                                               |\r
218 |               |           |             |                 | failure,      |                                                                        |\r
219 |               |           |             |                 | pending      |                                                                         |\r
220 +---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+\r
221 | solutions     | M         | 1           | Solution Object | -             | Solutions related to a request.                                        |\r
222 +---------------+-----------+-------------+-----------------+---------------+------------------------------------------------------------------------+\r
223 \r
224 \r
225 Solutions Object:\r
226 \r
227 +--------------------+-----------+-------------+--------------------------------------+---------------+--------------------------------+\r
228 | Attribute          | Qualifier | Cardinality | Content                              | Domain Values | Description                    |\r
229 +====================+===========+=============+======================================+===============+================================+\r
230 | placementSolutions | M         | 1..N        | List of ComprehensiveSolution Object | -             | A list of placement solutions. |\r
231 +--------------------+-----------+-------------+--------------------------------------+---------------+--------------------------------+\r
232 | licenseSolutions   | M         | 1           | List of LicenseSolution Object       | -             | A list of license solutions    |\r
233 +--------------------+-----------+-------------+--------------------------------------+---------------+--------------------------------+\r
234 \r
235 \r
236 \r
237 ComprehensiveSolution Object:\r
238 \r
239 +-----------+-----------+-------------+----------------------------------+---------------+--------------------------------+\r
240 | Attribute | Qualifier | Cardinality | Content                          | Domain Values | Description                    |\r
241 +===========+===========+=============+==================================+===============+================================+\r
242 | -         | M         | 1..N        | List of PlacementSolution Object | -             | A list of placement solutions. |\r
243 +-----------+-----------+-------------+----------------------------------+---------------+--------------------------------+\r
244 \r
245 \r
246 PlacementSolution Object:\r
247 \r
248 +--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+\r
249 | Attribute          | Qualifier | Cardinality | Content                | Domain Values       | Description                                             |\r
250 +====================+===========+=============+========================+=====================+=========================================================+\r
251 | resourceModuleName | M         | 1           | String                 | -                   | The name of a resource as defined in the service model. |\r
252 +--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+\r
253 | serviceResourceId  | M         | 1           | String                 | -                   | A resource Id as defined in a service model.            |\r
254 +--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+\r
255 | identifierType     | M         | 1           | String                 | service_instance_id | The type of a candidate.                                |\r
256 +--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+\r
257 | identifier         | M         | 1           | String                 | -                   | The id of a candidate.                                  |\r
258 +--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+\r
259 | assignmentInfo     | O         | 1..N        | List of AssignmentInfo | -                   | Additional information related to a candidate.          |\r
260 |                    |           |             | object                 |                     |                                                         |\r
261 +--------------------+-----------+-------------+------------------------+---------------------+---------------------------------------------------------+\r
262 \r
263 \r
264 AssignmentInfo Object:\r
265 \r
266 +-----------+-----------+-------------+---------+---------------+---------------------+\r
267 | Attribute | Qualifier | Cardinality | Content | Domain Values | Description         |\r
268 +===========+===========+=============+=========+===============+=====================+\r
269 | key       | M         | 1           | String  | -             | An attribute name.  |\r
270 +-----------+-----------+-------------+---------+---------------+---------------------+\r
271 | value     | M         | 1           | String  | -             | An attribute value. |\r
272 +-----------+-----------+-------------+---------+---------------+---------------------+\r
273 \r
274 \r
275 LicenseSolutions Object:\r
276 \r
277 +------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+\r
278 | Attribute                    | Qualifier | Cardinality | Content        | Domain Values | Description                              |\r
279 +==============================+===========+=============+================+===============+==========================================+\r
280 | resourceModuleName           | M         | 1           | String         | -             | A resource name as defined in a service. |\r
281 +------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+\r
282 | serviceResourceId            | M         | 1           | String         | -             | A resource Id as defined in a service.   |\r
283 +------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+\r
284 | entitlementPoolUUID          | M         | 1..N        | List of String | -             | A list of entitlementPoolUUIDs.          |\r
285 +------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+\r
286 | licenseKeyGroupUUID          | M         | 1..N        | List of String | -             | A list of licenseKeyGroupUUID.           |\r
287 +------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+\r
288 | entitlementPoolInvariantUUID | M         | 1..N        | List of String | -             | A list of entitlementPoolInvariantUUID . |\r
289 +------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+\r
290 | licenseKeyGroupInvariantUUID | M         | 1..N        | List of String | -             | A list of licenseKeyGroupInvariantUUID . |\r
291 +------------------------------+-----------+-------------+----------------+---------------+------------------------------------------+\r
292 \r
293 \r
294 HTTP Response Code\r
295 ++++++++++++++++++\r
296 \r
297 +-----------+-----------------------+---------------------------------------------------------------+\r
298 | HTTP Code | Response Phrase       | Description                                                   |\r
299 +===========+=======================+===============================================================+\r
300 | 201       | Created               | An optimization solution is found.                            |\r
301 +-----------+-----------------------+---------------------------------------------------------------+\r
302 | 202       | Accepted              | An optimization reequest is accepted.                         |\r
303 +-----------+-----------------------+---------------------------------------------------------------+\r
304 | 400       | Bad request           | Bad request.                                                  |\r
305 +-----------+-----------------------+---------------------------------------------------------------+\r
306 | 401       | Unauthorized          | Request body is not compliant with the API definition.        |\r
307 +-----------+-----------------------+---------------------------------------------------------------+\r
308 | 404       | Not found             | The server cannot find the requested URI.                     |\r
309 +-----------+-----------------------+---------------------------------------------------------------+\r
310 | 405       | Method not found      | The requested method is not supported by a server.            |\r
311 +-----------+-----------------------+---------------------------------------------------------------+\r
312 | 500       | Internal server error | The server encountered an internal server error or timed out. |\r
313 +-----------+-----------------------+---------------------------------------------------------------+\r
314 \r
315 \r
316 \r