Merge "Kafka now works in kube for calls outside its namespace"
[nonrtric.git] / information-coordinator-service / src / main / java / org / oransc / ics / SwaggerConfig.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 Nordix Foundation
6  * %%
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ========================LICENSE_END===================================
19  */
20
21 package org.oransc.ics;
22
23 import io.swagger.v3.oas.annotations.OpenAPIDefinition;
24 import io.swagger.v3.oas.annotations.info.Info;
25 import io.swagger.v3.oas.annotations.info.License;
26 import io.swagger.v3.oas.annotations.tags.Tag;
27
28 import org.oransc.ics.controllers.StatusController;
29 import org.oransc.ics.controllers.a1e.A1eConsts;
30 import org.oransc.ics.controllers.r1consumer.ConsumerConsts;
31 import org.oransc.ics.controllers.r1producer.ProducerConsts;
32
33 /**
34  * Swagger configuration class that uses swagger documentation type and scans
35  * all the controllers. To access the swagger gui go to
36  * http://ip:port/swagger-ui.html
37  */
38
39 @OpenAPIDefinition( //
40     tags = { //
41         @Tag(name = A1eConsts.CONSUMER_API_NAME, description = A1eConsts.CONSUMER_API_DESCRIPTION),
42         @Tag(name = A1eConsts.CONSUMER_API_CALLBACKS_NAME, description = A1eConsts.CONSUMER_API_CALLBACKS_DESCRIPTION),
43         @Tag(
44             name = ProducerConsts.PRODUCER_API_CALLBACKS_NAME,
45             description = ProducerConsts.PRODUCER_API_CALLBACKS_DESCRIPTION),
46         @Tag(name = ProducerConsts.PRODUCER_API_NAME, description = ProducerConsts.PRODUCER_API_DESCRIPTION), //
47         @Tag(name = StatusController.API_NAME, description = StatusController.API_DESCRIPTION), //
48         @Tag(name = ConsumerConsts.CONSUMER_API_NAME, description = ConsumerConsts.CONSUMER_API_DESCRIPTION), //
49     }, //
50     info = @Info(
51         title = SwaggerConfig.API_TITLE, //
52         version = "1.0", //
53         description = SwaggerConfig.DESCRIPTION, //
54         license = @License(
55             name = "Copyright (C) 2020 Nordix Foundation. Licensed under the Apache License.",
56             url = "http://www.apache.org/licenses/LICENSE-2.0")))
57 public class SwaggerConfig {
58     private SwaggerConfig() {
59     }
60
61     static final String API_TITLE = "Data management and exposure";
62
63     static final String DESCRIPTION = "<h1>API documentation</h1>" //
64         + "<h2>General</h2>" //
65         + "<p>" //
66         + "  The service is mainly a broker between data producers and data consumers. A data producer has the ability to produce one or several types of data (Information Type). One type of data can be produced by zero to many producers. <br /><br />A data consumer can have several active data subscriptions (Information Job). One Information Job consists of the type of data to produce and additional parameters for filtering of the data. These parameters are different for different data types." //
67         + "</p>" //
68         + "<h2>APIs provided by the service</h2>" //
69         + "<h4>A1-EI</h4>" //
70         + "<p>" //
71         + "  This API is between Near-RT RIC and the Non-RT RIC." //
72         + "  The Near-RT RIC is a data consumer, which creates Information Jobs to subscribe for data." //
73         + "  In this context, the information is referred to as 'Enrichment Information', EI." //
74         + "</p>" //
75         + "<h4>Data producer API</h4>" //
76         + "<p>" //
77         + "  This API is provided by the Non-RT RIC platform and is intended to be part of the O-RAN R1 interface." //
78         + "  The API is for use by different kinds of data producers and provides support for:" //
79         + "<ul>" //
80         + "<li>Registry of supported information types and which parameters needed to setup a subscription.</li>" //
81         + "<li>Registry of existing data producers.</li>" //
82         + "<li>Callback API provided by producers to setup subscriptions.</li>" //
83         + "</ul>" //
84         + "</p>" //
85         + "<h4>Data consumer API</h4>" //
86         + "<p>" //
87         + "  This API is provided by the Non-RT RIC platform and is intended to be part of the O-RAN R1 interface." //
88         + "  The API is for use by different kinds of data consumers and provides support for:" //
89         + "<ul>" //
90         + "<li>Querying of available types of data to consume.</li>" //
91         + "<li>Management of data subscription jobs</li>" //
92         + "<li>Optional callback API provided by consumers to get notification on added and removed information types.</li>" //
93         + "</ul>" //
94         + "</p>" //
95         + "<h4>Service status</h4>" //
96         + "<p>" //
97         + "  This API provides a means to monitor the health of this service." //
98         + "</p>";
99
100 }