18b966e0493e4d72c6d313b6ca7cffc3dae23772
[externalapi/nbi.git] / docs / offeredapis / index.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2018 ORANGE
4
5
6 ============
7 nbi - northbound interface - External API for ONAP
8 ============
9 ***************
10 Introduction
11 ***************
12
13 NBI stands for NorthBound Interface. It brings to ONAP a set of API that can be used by external systems as BSS for example.
14 These API are based on **TMF API**.
15
16
17 ***************
18 Global NBI architecture for Beijing release
19 ***************
20
21 Following illustration provides a global view about nbi architecture,integration with other ONAP components and API resource/operation provided.
22
23 .. image:: images/ONAP_External_ID_Beijing.jpg
24    :width: 800px
25
26 ***************
27 API Version
28 ***************
29
30 APIs are described with a  state version with “v” following the API Name, e.g.:  nbi/api/v1/productOrder.
31 The schema associated with a REST API must have its version number aligned with that of the REST API.
32
33 The version number has major, minor and revision numbers. E.g. v1.0.0
34 The version number (without the revision number) is held in the URI.
35
36 The major version number is incremented for an incompatible change.
37 The minor version number is incremented for a compatible change.
38 For minor modifications of the API, version numbering must not be updated, provided the following  backward compatibility rules are respected:
39
40 - New elements in a data type must be optional (minOccurs=0)
41 - Changes in the cardinality of an attribute in a data type must be from mandatory to optional or from lower to greater
42 - New attributes defined in an element must be optional (absence of use=”required”).
43 - If new enumerated values are included, the former ones and its meaning must be kept.
44 - If new operations are added, the existing operations must be kept
45 - New parameters added to existing operations must be optional and existing parameters
46 must be kept
47
48 For major modifications of the API, not backward compatible and forcing client implementations to be changed, the version number must be updated.
49
50 ***************
51 API Table
52 ***************
53
54 .. |pdf-icon| image:: images/pdf.png
55               :width: 40px
56
57 .. |swagger-icon| image:: images/swagger.png
58                   :width: 40px
59
60
61 .. |swaggerUI-icon| image:: images/swaggerUI.png
62                     :width: 40px
63
64 .. |html-icon| image:: images/html.png
65                :width: 40px
66
67 .. |plantuml-icon| image:: images/uml.jpg
68                   :width: 40px
69
70 .. |postman-icon| image:: images/postman.png
71                   :width: 40px
72
73 .. csv-table::
74    :header: "API", "|swagger-icon|", "|html-icon|", "|plantuml-icon|", "|swagger-icon|", "|postman-icon|", "|pdf-icon|"
75    :widths: 10,5,5,5,5,5,5
76
77    " ", "json file", "html doc", "plantUML doc", "Swagger Editor", "Postman Collection", "pdf doc"
78    "serviceCatalog", ":download:`link <swaggers/serviceCatalog_1_0_0.json>`", ":download:`link <serviceCatalog/documentation.html>`", ":download:`link <serviceCatalog/apiServiceCatalog.plantuml>`", "`link <http://editor2.swagger.io/#/?import=http://onap.readthedocs.io/en/latest/_downloads/serviceCatalog_1_0_0.json>`_", "coming", "coming"
79    "serviceInventory", ":download:`link <swaggers/serviceInventory_1_0_0.json>`", ":download:`link <serviceInventory/documentation.html>`", ":download:`link <serviceInventory/apiServiceInventory.plantuml>`", "`link <http://editor2.swagger.io/#/?import=http://onap.readthedocs.io/en/latest/_downloads/serviceInventory_1_0_0.json>`_", "coming", "coming"
80    "serviceOrder", ":download:`link <swaggers/serviceInventory_1_0_0.json>`", ":download:`link <serviceOrder/documentation.html>`", ":download:`link <serviceOrder/apiServiceOrder.plantuml>`", "`link <http://editor2.swagger.io/#/?import=http://onap.readthedocs.io/en/latest/_downloads/serviceInventory_1_0_0.json>`_", ":download:`link <postman/ONAPBeijingServiceOrderDoc.postman_collection.json>`", "coming"
81
82
83 ***************
84 API Description
85 ***************
86
87 **serviceCatalog:**
88
89 From TMF633 serviceCatalog
90
91 API at a glance:
92 Only high level information are provided - swagger is documented.
93
94 Only serviceSpecification resource is provided.
95 Information are retrieved in SDC (and in Tosca file) - Only GET operation is provided - this API DID NOT UPDATE SDC
96
97 Only characteristics at service level will be retrieved in ONAP Tosca file. For example if an ONAP service is composed of VNF and the VF module, the serviceSpecification resource will only feature characteristic describe in the ONAP service tosca model and not attributes in the tosca files for VNF or VF module.
98
99 Only ‘basic’ service characteristics will be managed in this release. By ‘basic’ we mean string, boolean, integer parameter type and we do not manage ‘map’ or ‘list parameter type
100
101
102 GET serviceSpecification(list)
103
104 (example: GET /nbi/api/v1/serviceSpecification/?category=NetworkService&distributionStatus =DISTRIBUTED)
105
106 It is possible to retrieve a list of serviceSpecification (get by list).
107
108 Only attributes category and distributionStatus are available for serviceSpecification filtering. It is possible to select retrieved attributes using fields attribute.
109
110 if no serviceSpecification matches, an empty list is send back.
111
112 GET tservice Specification (id)
113
114 (example: GET /nbi/api/v1/serviceSpecification/{uuid})
115
116 It is use to retrieve one serviceSpecification - all available information are retieved (see swagger for description)
117
118
119 **serviceInventory:**
120
121 From TMF638 serviceInventory
122
123 API at a glance:
124 Only high level information are provided - swagger is documented.
125
126 This API retrieves service(s) in the AAI inventory. Only following attributes will be retrieve in service inventory: id, name and type (no state or startDate available )
127
128 GET Service Inventory (list):
129
130 (example: GET /nbi/api/v1/service/?relatedParty.id=Pontus
131 )
132
133 GET (by list) allows to request with following criteria (all optional) :
134
135 *   id (id of the service instance) - id of the service instance (inventory)
136 *   serviceSpecification.id - id of the service specification (catalog)
137 *   serviceSpecification.name - name of the service specification (catalog)
138 *   relatedParty.id - id of the (aai) customer - if not filled we use ‘generic’ customer
139
140 if no service matches, an empty list is send back.
141
142 1.      If a request is send without any parameter, we’ll retrieve the list of service-instance for the ‘generic’ customer
143 2.      If only customer parameter is filled (relatedParty.id + role= relatedParty’ONAPcustomer’) we’ll retrieve the list of service-instance for this customer
144 3.      If serviceSpecification.id or name is filled we’ll retrieve the list of Service instance (from this service specification) – We’ll use the customer id if provided (with Role=’ONAPcustomer) or generic if no customer id provided
145
146
147 GET Service Inventory (id):
148
149 (example: GET /nbi/api/v1/service/{uuid} but customerId & serviceSpecification.id must passed in requested parameters)
150
151
152 Because of AAI capability, additionally to the service id, customer id and [serviceSpecification.id or serviceSpecification.name] must be supplied. If the customer id is not supplied, External API will use ‘generic’ customer
153
154 **serviceOrder:**
155
156
157 From TMF641 serviceOrder
158
159 API at a glance:
160 Only high level information are provided - swagger is documented.
161
162 It is possible to use POST operation to create new serviceOrder in nbi and triggers service provisioning. GET operation is also available to retrieve one service order by providing id or a list of service order. For this release, only a subset of criteria is available:
163
164 •     externalId
165 •     state
166 •     description
167 •     orderDate.gt (orderDate must be greater – after -than)
168 •     orderDate.lt (orderDate must be lower-before - than)
169 •     fields – attribute used to filter retrieved attributes (if needed) and also for sorted SO
170 •     offset and limit are used for pagination purpose
171
172
173
174 ServiceOrder will manage only ‘add’ and ‘delete’ operation (no change).
175
176 prerequisites & assumptions :
177
178 •     Cloud & tenant information MUST BE defined in the external API property file
179 •     Management of ONAP customer for add service action:
180 With the current version of APIs used from SO and AAI we need to manage a ‘customer’. This customer concept is confusing with Customer BSS concept. We took the following rules to manage the ‘customer’ information:
181
182 •     It could be provided through a serviceOrder in the service Order a relatedParty with role ‘ONAPcustomer’ should be provided in the serviceOrder header (we will not consider in this release the party at item level); External API component will check if this customer exists and create it in AAI if not.
183 •     If no relatedParty are provided the service will be affected to ‘generic’ customer (dummy customer) – we assume this ‘generic’ customer always exists.
184
185 •     Additionally nbi will create in AAI the service-type if it did not exists for the customer
186
187 •     Integration is done at service-level: nbi will trigger only SO request at serviceInstance level -->  ONAP prerequisite: SO must be able to find a BPMN to process service fulfillment (integrate vnf, vnf activation in SDNC, VF module
188
189 •     State management: States are only managed by ServiceOrder component and could not be updated from north side via API. Accordingly to service order item fulfillment progress, order item state are updated. Order state is automatically updated based on item state.
190
191
192 ***************
193 Developer Guide
194 ***************
195
196 Technical information about NBI (dependancies, configuration, running & testing) could be found here: `DevDoc <../architecture/NBI_R1_Developer_Guide.rst>`_
197
198