Uplift of PMS from ONAP
[nonrtric.git] / enrichment-coordinator-service / src / main / java / org / oransc / enrichment / 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.enrichment;
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.enrichment.controllers.StatusController;
29 import org.oransc.enrichment.controllers.consumer.ConsumerConsts;
30 import org.oransc.enrichment.controllers.producer.ProducerConsts;
31
32 /**
33  * Swagger configuration class that uses swagger documentation type and scans
34  * all the controllers. To access the swagger gui go to
35  * http://ip:port/swagger-ui.html
36  */
37
38 @OpenAPIDefinition( //
39     tags = {@Tag(name = ConsumerConsts.CONSUMER_API_NAME, description = ConsumerConsts.CONSUMER_API_DESCRIPTION),
40         @Tag(
41             name = ConsumerConsts.CONSUMER_API_CALLBACKS_NAME,
42             description = ConsumerConsts.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     info = @Info(
49         title = "Enrichment Information Service", //
50         version = "1.0", //
51         description = SwaggerConfig.DESCRIPTION, //
52         license = @License(
53             name = "Copyright (C) 2020 Nordix Foundation. Licensed under the Apache License.",
54             url = "http://www.apache.org/licenses/LICENSE-2.0")))
55 public class SwaggerConfig {
56     private SwaggerConfig() {
57     }
58
59     static final String API_TITLE = "Enrichment Data service";
60
61     static final String DESCRIPTION = "<h1>API documentation</h1>" //
62         + "<h2>General</h2>" //
63         + "<p>" //
64         + "  The service is mainly a broker between data producers and data consumers. A data producer has the ability to producer one or several type of data (EI type). One type of data can be produced by zero to many producers. <br /><br />A data consumer can have several active data subscriptions (EI job). One EI 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." //
65         + "</p>" //
66         + "<h2>APIs provided by the service</h2>" //
67         + "<h4>A1-EI</h4>" //
68         + "<p>" //
69         + "  This API is between Near-RT RIC, which is a data consumer, and the Non-RT RIC. " //
70         + "</p>" + "<h4>Data producer API</h4>" //
71         + "<p>"
72         + "  This API is between data producers and this service. It is divivided into two parts, where one is provided by this service (registration) and one part is provided by the data producer."
73         + "</p>" //
74         + "<h4>EI Service status</h4>" //
75         + "<p>" //
76         + "  This API provides a means to monitor the service." //
77         + "</p>";
78
79 }