blob: 31efc40fdede25b2ed40c84f4a8ffc8e10a174ba [file] [log] [blame]
JakobKriegb1da7d92020-11-18 15:53:30 +01001.. 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
5Blueprint Processor API Reference
6==================================
7
8Introduction
9--------------
10
JakobKriegeaa1ac92020-12-08 19:15:36 +010011This section shows all resources and endpoints which CDS BP processor currently provides through a swagger file
12which is automatically created during CDS build process by Swagger Maven Plugin. A corresponding Postman collection is
13also included. Endpoints can also be described using this template
14:download:`api-doc-template.rst <api-doc-template.rst>` but this is not the prefered way to describe the CDS API.
JakobKriegb1da7d92020-11-18 15:53:30 +010015
16Authentification
17-----------------
18
19Use Basic athentification with `ccsdkapps` as a username and password, in Header ``Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==``.
20
21Download
22------------
23
JakobKriegeaa1ac92020-12-08 19:15:36 +010024Here is the automatically created swagger file for CDS Blueprint Processor API:
25:download:`cds-bp-processor-api-swagger.json <media/cds-bp-processor-api-swagger.json>`
26:download:`cds-bp-processor-api-swagger.yaml <media/cds-bp-processor-api-swagger.yaml>`
27
28You can find a postman collection including sample requests for all endpoints here:
29:download:`bp-processor.postman_collection.json <media/bp-processor.postman_collection.json>`.
30Please keep the Postman Collection up-to-date for new endpoints.
JakobKriegb1da7d92020-11-18 15:53:30 +010031
32General Setup
33--------------
34
35All endpoints are accessable under ``http://{{host}}:{{port}}/api/v1/``. Host and port depends on your CDS BP processor
36deployment.
37
38
39List all endpoints
40-------------------
41
42Lists all available endpoints from blueprints processor API.
43
44
45Request
46~~~~~~~~~~
47
48GET ``http://{{host}}:{{port}}/actuator/mappings``
49....................................................
50
51Lists all endpoints from blueprints processor.
52
53.. code-block:: curl
54 :caption: **request**
55
56 curl --location --request GET 'http://localhost:8081/actuator/mappings' \
57 --header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw=='
58
59
60Success Response
61~~~~~~~~~~~~~~~~~
62
63HTTP Status 202 OK
64
65.. code-block:: json
66 :caption: **sample response body**
67
68 {
69 "contexts": {
70 "application": {
71 "mappings": {
72 "dispatcherHandlers": {
73 "webHandler": [
74
75 ...
76
77 {
78 "predicate": "{GET /api/v1/blueprint-model, produces [application/json]}",
79 "handler": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController#allBlueprintModel()",
80 "details": {
81 "handlerMethod": {
82 "className": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController",
83 "name": "allBlueprintModel",
84 "descriptor": "()Ljava/util/List;"
85 },
86 "handlerFunction": null,
87 "requestMappingConditions": {
88 "consumes": [],
89 "headers": [],
90 "methods": [
91 "GET"
92 ],
93 "params": [],
94 "patterns": [
95 "/api/v1/blueprint-model"
96 ],
97 "produces": [
98 {
99 "mediaType": "application/json",
100 "negated": false
101 }
102 ]
103 }
104 }
105 },
106 {
107 "predicate": "{GET /api/v1/blueprint-model/meta-data/{keyword}, produces [application/json]}",
108 "handler": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController#allBlueprintModelMetaData(String, Continuation)",
109 "details": {
110 "handlerMethod": {
111 "className": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController",
112 "name": "allBlueprintModelMetaData",
113 "descriptor": "(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;"
114 },
115 "handlerFunction": null,
116 "requestMappingConditions": {
117 "consumes": [],
118 "headers": [],
119 "methods": [
120 "GET"
121 ],
122 "params": [],
123 "patterns": [
124 "/api/v1/blueprint-model/meta-data/{keyword}"
125 ],
126 "produces": [
127 {
128 "mediaType": "application/json",
129 "negated": false
130 }
131 ]
132 }
133 }
134 }
135
136 ...
137
138 ]
139 }
140 },
141 "parentId": null
142 }
143 }
144 }
145
JakobKriegb1da7d92020-11-18 15:53:30 +0100146
JakobKriegeaa1ac92020-12-08 19:15:36 +0100147API Reference
148--------------
JakobKriegb1da7d92020-11-18 15:53:30 +0100149
JakobKriegeaa1ac92020-12-08 19:15:36 +0100150.. warning::
151 In the used Sphinx plugin `sphinxcontrib-swaggerdoc` some information of the swagger file is not
152 rendered completely, e.g. the request body. Use your favorite Swagger Editor and paste the swagger file
153 to get a complete view of the API reference, e.g. on https://editor.swagger.io/.
JakobKrieg86c0b5d2020-11-19 14:59:44 +0100154
JakobKriegeaa1ac92020-12-08 19:15:36 +0100155.. swaggerv2doc:: media/cds-bp-processor-api-swagger.json