2 * ========================LICENSE_START=================================
5 * Copyright (C) 2019 Nordix Foundation
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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===================================
21 package org.oransc.enrichment;
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;
28 import org.oransc.enrichment.controllers.StatusController;
29 import org.oransc.enrichment.controllers.a1e.A1eConsts;
30 import org.oransc.enrichment.controllers.r1consumer.ConsumerConsts;
31 import org.oransc.enrichment.controllers.r1producer.ProducerConsts;
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
39 @OpenAPIDefinition( //
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),
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), //
51 title = SwaggerConfig.API_TITLE, //
53 description = SwaggerConfig.DESCRIPTION, //
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() {
61 static final String API_TITLE = "Data management and exposure";
63 static final String DESCRIPTION = "<h1>API documentation</h1>" //
64 + "<h2>General</h2>" //
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." //
68 + "<h2>APIs provided by the service</h2>" //
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." //
75 + "<h4>Data producer API</h4>" //
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:" //
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>" //
85 + "<h4>Data consumer API</h4>" //
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:" //
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>" //
95 + "<h4>Service status</h4>" //
97 + " This API provides a means to monitor the health of this service." //