blob: ea888017474544d7e40896e289f78e41d3dc5813 [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>`
JakobKriegeaa1ac92020-12-08 19:15:36 +010026
JakobKrieg76bf2a52020-12-09 09:09:46 +010027You can find a postman collection including sample requests for all endpoints here:
JakobKriegeaa1ac92020-12-08 19:15:36 +010028:download:`bp-processor.postman_collection.json <media/bp-processor.postman_collection.json>`.
29Please keep the Postman Collection up-to-date for new endpoints.
JakobKriegb1da7d92020-11-18 15:53:30 +010030
31General Setup
32--------------
33
34All endpoints are accessable under ``http://{{host}}:{{port}}/api/v1/``. Host and port depends on your CDS BP processor
35deployment.
36
37
38List all endpoints
39-------------------
40
41Lists all available endpoints from blueprints processor API.
42
43
44Request
45~~~~~~~~~~
46
47GET ``http://{{host}}:{{port}}/actuator/mappings``
48....................................................
49
50Lists all endpoints from blueprints processor.
51
52.. code-block:: curl
53 :caption: **request**
54
55 curl --location --request GET 'http://localhost:8081/actuator/mappings' \
56 --header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw=='
57
58
59Success Response
60~~~~~~~~~~~~~~~~~
61
62HTTP Status 202 OK
63
64.. code-block:: json
65 :caption: **sample response body**
66
67 {
68 "contexts": {
69 "application": {
70 "mappings": {
71 "dispatcherHandlers": {
72 "webHandler": [
73
74 ...
75
76 {
77 "predicate": "{GET /api/v1/blueprint-model, produces [application/json]}",
78 "handler": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController#allBlueprintModel()",
79 "details": {
80 "handlerMethod": {
81 "className": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController",
82 "name": "allBlueprintModel",
83 "descriptor": "()Ljava/util/List;"
84 },
85 "handlerFunction": null,
86 "requestMappingConditions": {
87 "consumes": [],
88 "headers": [],
89 "methods": [
90 "GET"
91 ],
92 "params": [],
93 "patterns": [
94 "/api/v1/blueprint-model"
95 ],
96 "produces": [
97 {
98 "mediaType": "application/json",
99 "negated": false
100 }
101 ]
102 }
103 }
104 },
105 {
106 "predicate": "{GET /api/v1/blueprint-model/meta-data/{keyword}, produces [application/json]}",
107 "handler": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController#allBlueprintModelMetaData(String, Continuation)",
108 "details": {
109 "handlerMethod": {
110 "className": "org.onap.ccsdk.cds.blueprintsprocessor.designer.api.BlueprintModelController",
111 "name": "allBlueprintModelMetaData",
112 "descriptor": "(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;"
113 },
114 "handlerFunction": null,
115 "requestMappingConditions": {
116 "consumes": [],
117 "headers": [],
118 "methods": [
119 "GET"
120 ],
121 "params": [],
122 "patterns": [
123 "/api/v1/blueprint-model/meta-data/{keyword}"
124 ],
125 "produces": [
126 {
127 "mediaType": "application/json",
128 "negated": false
129 }
130 ]
131 }
132 }
133 }
134
135 ...
136
137 ]
138 }
139 },
140 "parentId": null
141 }
142 }
143 }
144
JakobKriegb1da7d92020-11-18 15:53:30 +0100145
JakobKriegeaa1ac92020-12-08 19:15:36 +0100146API Reference
147--------------
JakobKriegb1da7d92020-11-18 15:53:30 +0100148
JakobKriegeaa1ac92020-12-08 19:15:36 +0100149.. warning::
150 In the used Sphinx plugin `sphinxcontrib-swaggerdoc` some information of the swagger file is not
151 rendered completely, e.g. the request body. Use your favorite Swagger Editor and paste the swagger file
152 to get a complete view of the API reference, e.g. on https://editor.swagger.io/.
JakobKrieg86c0b5d2020-11-19 14:59:44 +0100153
JakobKriegeaa1ac92020-12-08 19:15:36 +0100154.. swaggerv2doc:: media/cds-bp-processor-api-swagger.json