CDS Api reference add index, template, first APIs
[ccsdk/cds.git] / docs / api-reference / bp-processor.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0
2 .. International License. http://creativecommons.org/licenses/by/4.0
3 .. Copyright (C) 2020 Deutsche Telekom AG.
4
5 Blueprint Processor API Reference
6 ==================================
7
8 Introduction
9 --------------
10
11 This section shows all resources and endpoints which CDS BP processor currently provides with sample requests/responses,
12 parameter description and other information. If there is a new API and you want do document it, you can use this template
13 :download:`rst <api-doc-template.rst>`.
14
15 Authentification
16 -----------------
17
18 Use Basic athentification with `ccsdkapps` as a username and password, in Header ``Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==``.
19
20 Download
21 ------------
22
23 You can find a postman collection including sample requests here: :download:`JSON <media/bp-processor.postman_collection.json>`
24
25 General Setup
26 --------------
27
28 All endpoints are accessable under ``http://{{host}}:{{port}}/api/v1/``. Host and port depends on your CDS BP processor
29 deployment.
30
31
32 List all endpoints
33 -------------------
34
35 Lists all available endpoints from blueprints processor API.
36
37
38 Request
39 ~~~~~~~~~~
40
41 GET ``http://{{host}}:{{port}}/actuator/mappings``
42 ....................................................
43
44 Lists all endpoints from blueprints processor.
45
46 .. code-block:: curl
47    :caption: **request**
48
49    curl --location --request GET 'http://localhost:8081/actuator/mappings' \
50    --header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw=='
51
52
53 Success Response
54 ~~~~~~~~~~~~~~~~~
55
56 HTTP Status 202 OK
57
58 .. code-block:: json
59    :caption: **sample response body**
60
61    {
62       "contexts": {
63          "application": {
64                "mappings": {
65                   "dispatcherHandlers": {
66                      "webHandler": [
67
68                            ...
69
70                            {
71                               "predicate": "{GET /api/v1/blueprint-model, produces [application/json]}",
72                               "handler": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController#allBlueprintModel()",
73                               "details": {
74                                  "handlerMethod": {
75                                        "className": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController",
76                                        "name": "allBlueprintModel",
77                                        "descriptor": "()Ljava/util/List;"
78                                  },
79                                  "handlerFunction": null,
80                                  "requestMappingConditions": {
81                                        "consumes": [],
82                                        "headers": [],
83                                        "methods": [
84                                           "GET"
85                                        ],
86                                        "params": [],
87                                        "patterns": [
88                                           "/api/v1/blueprint-model"
89                                        ],
90                                        "produces": [
91                                           {
92                                              "mediaType": "application/json",
93                                              "negated": false
94                                           }
95                                        ]
96                                  }
97                               }
98                            },
99                            {
100                               "predicate": "{GET /api/v1/blueprint-model/meta-data/{keyword}, produces [application/json]}",
101                               "handler": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController#allBlueprintModelMetaData(String, Continuation)",
102                               "details": {
103                                  "handlerMethod": {
104                                        "className": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController",
105                                        "name": "allBlueprintModelMetaData",
106                                        "descriptor": "(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;"
107                                  },
108                                  "handlerFunction": null,
109                                  "requestMappingConditions": {
110                                        "consumes": [],
111                                        "headers": [],
112                                        "methods": [
113                                           "GET"
114                                        ],
115                                        "params": [],
116                                        "patterns": [
117                                           "/api/v1/blueprint-model/meta-data/{keyword}"
118                                        ],
119                                        "produces": [
120                                           {
121                                              "mediaType": "application/json",
122                                              "negated": false
123                                           }
124                                        ]
125                                  }
126                               }
127                            }
128
129                            ...
130
131                      ]
132                   }
133                },
134                "parentId": null
135          }
136       }
137    }
138
139 Blueprint Model Catalog API
140 ----------------------------
141
142 Blueprint-model resource contains all Controller Blueprints Archive (CBA) packages which are available in CDS.
143 With blueprint-model API you can manage your CBAs.
144
145
146 List all blueprint models
147 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
148
149
150 GET ``/blueprint-model``
151 ..............................
152
153 Lists all blueprint models which are saved in CDS.
154
155 Request
156 ...........
157
158 .. code-block:: curl
159    :caption: **request**
160
161    curl --location --request GET 'http://{{ip_adress}}:{{port}}/api/v1/blueprint-model' \
162    --header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw=='
163
164 Produces
165 ...........
166
167 ``application/json``
168
169
170 Success Response
171 ......................
172
173 HTTP Status 200 OK
174
175 .. code-block:: json
176    :caption: **example response**
177
178    [
179     {
180         "blueprintModel": {
181             "id": "109e725d-5145-4f70-a2e7-ee6640e2fb5f",
182             "artifactUUId": null,
183             "artifactType": "SDNC_MODEL",
184             "artifactVersion": "1.0.0",
185             "artifactDescription": "",
186             "internalVersion": null,
187             "createdDate": "2020-11-09T19:00:20.000Z",
188             "artifactName": "vLB_CDS_RESTCONF",
189             "published": "Y",
190             "updatedBy": "DanielEmmarts>",
191             "tags": "vLB-CDS"
192         }
193     },
194     {
195         "blueprintModel": {
196             "id": "5cce3804-09eb-473d-b513-81f8547a7240",
197             "artifactUUId": null,
198             "artifactType": "SDNC_MODEL",
199             "artifactVersion": "1.0.0",
200             "artifactDescription": "",
201             "internalVersion": null,
202             "createdDate": "2020-11-09T19:00:20.000Z",
203             "artifactName": "vLB_CDS",
204             "published": "Y",
205             "updatedBy": "TomKennedy>",
206             "tags": "vLB_CDS"
207         }
208     }
209    ]
210
211 Technical Description
212 ...........................
213
214 Loads all Blueprint Models which are saved in the CDS database in table `BLUEPRINT_MODEL`. Unpublished and unproceeded
215 Blueprint Models are also included.
216 Called class/method: ``org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController#allBlueprintModel()``.