# Eclipse
.checkstyle
+.classpath
+target/
.sts4-cache
.project
.settings
.pydevproject
infer-out/
-.vscode
\ No newline at end of file
+.vscode
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>docs</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- </buildSpec>
- <natures>
- </natures>
-</projectDescription>
:depth: 3
:local:
-The Non-RT RIC consists of two parts, described in the sections below:
+The Non-RT RIC consists of three parts, described in the sections below:
* The Policy Agent
* The SDNC A1 Controller
+ * The rAPP Catalogue
Policy Agent
See the README.md file in the nonrtric/sdnc-a1-controller repo for info about how to use it.
+rAPP Catalogue
+==============
+
+The Non RT-RIC Service Catalogue provides a way for services to register themselves for other services to discover.
+
+See `RAC API <./rac-api.html>`_ for how to use the API.
+
+.. |swagger-icon| image:: ./images/swagger.png
+ :width: 40px
+
+.. |yaml-icon| image:: ./images/yaml_logo.png
+ :width: 40px
+
+
+.. csv-table::
+ :header: "API name", "|swagger-icon|", "|yaml-icon|"
+ :widths: 10,5, 5
+
+ "RAC API", ":download:`link <../r-app-catalogue/api/rac-api.json>`", ":download:`link <../r-app-catalogue/api/rac-api.yaml>`"
+
Complementary tools
===================
linkcheck_ignore = [
'http://localhost.*',
'http://127.0.0.1.*',
- 'https://gerrit.o-ran-sc.org.*'
+ 'https://gerrit.o-ran-sc.org.*',
+ './rac-api.html' #Generated file that doesn't exist at link check.
]
+extensions = ['sphinxcontrib.redoc', 'sphinx.ext.intersphinx',]
+
+redoc = [
+ {
+ 'name': 'RAC API',
+ 'page': 'rac-api',
+ 'spec': '../r-app-catalogue/api/rac-api.json',
+ 'embed': True,
+ }
+ ]
+
+redoc_uri = 'https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js'
+
#intershpinx mapping with other projects
intersphinx_mapping = {}
-sphinx
-sphinx-rtd-theme
-sphinxcontrib-httpdomain
-recommonmark
-lfdocs-conf
+tox
+Sphinx>=2,<4
+doc8
+docutils
+setuptools
+six
+sphinx_rtd_theme>=0.4.3
+sphinxcontrib-needs>=0.2.3
+sphinxcontrib-swaggerdoc
+sphinx_bootstrap_theme
+sphinxcontrib-redoc
+lfdocs-conf
\ No newline at end of file
<module>policy-agent</module>
<module>sdnc-a1-controller</module>
<module>enrichment-coordinator-service</module>
+ <module>r-app-catalogue</module>
</modules>
<build>
<plugins>
--- /dev/null
+.swagger-codegen-ignore
+.swagger-codegen/
+api/README.md
--- /dev/null
+#
+# ============LICENSE_START=======================================================
+# Copyright (C) 2020 Nordix Foundation.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+#
+FROM openjdk:11-jre-slim
+
+ARG JAR
+
+WORKDIR /opt/app/r-app-catalogue
+RUN mkdir -p /var/log/r-app-catalogue
+
+EXPOSE 8081 8433
+
+ADD /config/application.yaml /opt/app/r-app-catalogue/config/application.yaml
+ADD target/${JAR} /opt/app/r-app-catalogue/r-app-catalogue.jar
+
+
+RUN chmod -R 777 /opt/app/r-app-catalogue/config/
+
+CMD ["java", "-jar", "/opt/app/r-app-catalogue/r-app-catalogue.jar"]
+
+
+
+
--- /dev/null
+# O-RAN-SC Non-RT RIC rAPP Catalogue
+
+The O-RAN Non-RT RIC rApp Catalogue provides an OpenApi 3.0 REST API for services to register themselves and discover
+other services.
+
+**NOTE!** The definition of the REST API is done in the `api/rac-api.json` file. The yaml version of the file is
+generated during compilation.
+
+The application is a SpringBoot application generated using the openapitools openapi-generator-maven-plugin.
+
+To start the application run:
+`mvn spring-boot:run`
+
+## License
+
+Copyright (C) 2020 Nordix Foundation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
--- /dev/null
+{
+ "openapi": "3.0.0",
+ "info": {
+ "title": "rAPP Catalogue API",
+ "description": "The Non RT-RIC Service Catalogue provides a way for services to register themselves for other services to discover.",
+ "version": "1.0.0"
+ },
+ "paths": {
+ "/services": {
+ "get": {
+ "summary": "Service names",
+ "deprecated": false,
+ "operationId": "getServiceNamesUsingGET",
+ "responses": {
+ "200": {
+ "description": "Service names",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "example": [
+ "DroneIdentifier",
+ "Collector"
+ ]
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Not used"
+ }
+ },
+ "tags": [
+ "rAPP Catalogue API"
+ ]
+ }
+ },
+ "/services/{serviceName}": {
+ "get": {
+ "summary": "Individual Service",
+ "deprecated": false,
+ "operationId": "getIndividualServiceUsingGET",
+ "responses": {
+ "200": {
+ "description": "EI Job",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/service"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Service is not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/error_information"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "in": "path",
+ "name": "serviceName",
+ "description": "serviceName",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "example": "DroneIdentifier"
+ }
+ ],
+ "tags": [
+ "rAPP Catalogue API"
+ ]
+ },
+ "put": {
+ "summary": "Create or update a Service",
+ "deprecated": false,
+ "operationId": "putIndividualServiceUsingPUT",
+ "responses": {
+ "200": {
+ "description": "Service updated"
+ },
+ "201": {
+ "description": "Service created"
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Provided service is not correct",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/error_information"
+ },
+ "example": {
+ "detail": "Service is missing required property version",
+ "status": 404
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "serviceName",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "example": "DroneIdentifier"
+ }
+ ],
+ "requestBody": {
+ "description": "Service to create/update",
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/service"
+ }
+ }
+ }
+ },
+ "tags": [
+ "rAPP Catalogue API"
+ ]
+ },
+ "delete": {
+ "summary": "Remove a Service from the catalogue",
+ "deprecated": false,
+ "operationId": "deleteIndividualServiceUsingDELETE",
+ "responses": {
+ "200": {
+ "description": "Not used"
+ },
+ "204": {
+ "description": "Job deleted"
+ },
+ "401": {
+ "description": "Unauthorized"
+ },
+ "403": {
+ "description": "Forbidden"
+ },
+ "404": {
+ "description": "Service is not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/error_information"
+ }
+ }
+ }
+ }
+ },
+ "parameters": [
+ {
+ "name": "serviceName",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "example": "DroneIdentifier"
+ }
+ ],
+ "tags": [
+ "rAPP Catalogue API"
+ ]
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "service": {
+ "description": "A Service",
+ "type": "object",
+ "title": "service",
+ "required": [
+ "version"
+ ],
+ "properties": {
+ "version": {
+ "description": "Version of the Service",
+ "type": "string",
+ "example": "1.0.0"
+ },
+ "display_name": {
+ "description": "Display name for the Service",
+ "type": "string",
+ "example": "Drone Identifier"
+ },
+ "description": {
+ "description": "Description of the Service",
+ "type": "string",
+ "example": "Detects if a UE is a drone"
+ }
+ }
+ },
+ "error_information": {
+ "description": "Problem as defined in https://tools.ietf.org/html/rfc7807",
+ "type": "object",
+ "title": "error_information",
+ "properties": {
+ "detail": {
+ "description": "A human-readable explanation specific to this occurrence of the problem.",
+ "type": "string",
+ "example": "Service not found"
+ },
+ "status": {
+ "format": "int32",
+ "description": "The HTTP status code generated by the origin server for this occurrence of the problem.",
+ "type": "integer",
+ "example": 404
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+openapi: 3.0.0
+info:
+ title: rAPP Catalogue API
+ description: The Non RT-RIC Service Catalogue provides a way for services to register
+ themselves for other services to discover.
+ version: 1.0.0
+servers:
+- url: /
+paths:
+ /services:
+ get:
+ tags:
+ - rAPP Catalogue API
+ summary: Service names
+ operationId: getServiceNamesUsingGET
+ responses:
+ 200:
+ description: Service names
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ type: string
+ example:
+ - DroneIdentifier
+ - Collector
+ 401:
+ description: Unauthorized
+ 403:
+ description: Forbidden
+ 404:
+ description: Not used
+ deprecated: false
+ /services/{serviceName}:
+ get:
+ tags:
+ - rAPP Catalogue API
+ summary: Individual Service
+ operationId: getIndividualServiceUsingGET
+ parameters:
+ - name: serviceName
+ in: path
+ description: serviceName
+ required: true
+ style: simple
+ explode: false
+ schema:
+ type: string
+ example: DroneIdentifier
+ responses:
+ 200:
+ description: EI Job
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/service'
+ 401:
+ description: Unauthorized
+ 403:
+ description: Forbidden
+ 404:
+ description: Service is not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/error_information'
+ deprecated: false
+ put:
+ tags:
+ - rAPP Catalogue API
+ summary: Create or update a Service
+ operationId: putIndividualServiceUsingPUT
+ parameters:
+ - name: serviceName
+ in: path
+ required: true
+ style: simple
+ explode: false
+ schema:
+ type: string
+ example: DroneIdentifier
+ requestBody:
+ description: Service to create/update
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/service'
+ required: true
+ responses:
+ 200:
+ description: Service updated
+ 201:
+ description: Service created
+ 401:
+ description: Unauthorized
+ 403:
+ description: Forbidden
+ 404:
+ description: Provided service is not correct
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/error_information'
+ example:
+ detail: Service is missing required property version
+ status: 404
+ deprecated: false
+ delete:
+ tags:
+ - rAPP Catalogue API
+ summary: Remove a Service from the catalogue
+ operationId: deleteIndividualServiceUsingDELETE
+ parameters:
+ - name: serviceName
+ in: path
+ required: true
+ style: simple
+ explode: false
+ schema:
+ type: string
+ example: DroneIdentifier
+ responses:
+ 200:
+ description: Not used
+ 204:
+ description: Job deleted
+ 401:
+ description: Unauthorized
+ 403:
+ description: Forbidden
+ 404:
+ description: Service is not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/error_information'
+ deprecated: false
+components:
+ schemas:
+ service:
+ title: service
+ required:
+ - version
+ type: object
+ properties:
+ version:
+ type: string
+ description: Version of the Service
+ example: 1.0.0
+ display_name:
+ type: string
+ description: Display name for the Service
+ example: Drone Identifier
+ description:
+ type: string
+ description: Description of the Service
+ example: Detects if a UE is a drone
+ description: A Service
+ error_information:
+ title: error_information
+ type: object
+ properties:
+ detail:
+ type: string
+ description: A human-readable explanation specific to this occurrence of
+ the problem.
+ example: Service not found
+ status:
+ type: integer
+ description: The HTTP status code generated by the origin server for this
+ occurrence of the problem.
+ format: int32
+ example: 404
+ description: Problem as defined in https://tools.ietf.org/html/rfc7807
--- /dev/null
+spring:
+ profiles:
+ active: prod
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+* ========================LICENSE_START=================================\r
+* O-RAN-SC\r
+* %%\r
+* Copyright (C) 2020 Nordix Foundation\r
+* %%\r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+* ========================LICENSE_END===================================\r
+-->\r
+<project xmlns="http://maven.apache.org/POM/4.0.0"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+ <modelVersion>4.0.0</modelVersion>\r
+\r
+ <parent>\r
+ <groupId>org.springframework.boot</groupId>\r
+ <artifactId>spring-boot-starter-parent</artifactId>\r
+ <version>2.3.4.RELEASE</version>\r
+ <relativePath />\r
+ </parent>\r
+ <groupId>org.o-ran-sc.nonrtric</groupId>\r
+ <artifactId>r-app-catalogue</artifactId>\r
+ <version>1.0.0-SNAPSHOT</version>\r
+ <licenses>\r
+ <license>\r
+ <name>The Apache Software License, Version 2.0</name>\r
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>\r
+ </license>\r
+ </licenses>\r
+ <properties>\r
+ <java.version>11</java.version>\r
+ <swagger-annotations.version>1.5.22</swagger-annotations.version>\r
+ <springfox.version>2.9.2</springfox.version>\r
+ <jackson-databind-nullable.version>0.2.1</jackson-databind-nullable.version>\r
+ <openapi-generator-maven-plugin.version>4.3.1</openapi-generator-maven-plugin.version>\r
+ <swagger-codegen-maven-plugin.version>3.0.11</swagger-codegen-maven-plugin.version>\r
+ <docker-maven-plugin.version>0.30.0</docker-maven-plugin.version>\r
+ </properties>\r
+\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>io.swagger</groupId>\r
+ <artifactId>swagger-annotations</artifactId>\r
+ <version>${swagger-annotations.version}</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>com.fasterxml.jackson.core</groupId>\r
+ <artifactId>jackson-annotations</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.springframework</groupId>\r
+ <artifactId>spring-beans</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.springframework.boot</groupId>\r
+ <artifactId>spring-boot-autoconfigure</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.springframework</groupId>\r
+ <artifactId>spring-web</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.springframework.boot</groupId>\r
+ <artifactId>spring-boot</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.springframework</groupId>\r
+ <artifactId>spring-webmvc</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.springframework</groupId>\r
+ <artifactId>spring-context</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>io.springfox</groupId>\r
+ <artifactId>springfox-swagger2</artifactId>\r
+ <version>${springfox.version}</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>io.springfox</groupId>\r
+ <artifactId>springfox-core</artifactId>\r
+ <version>${springfox.version}</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>io.springfox</groupId>\r
+ <artifactId>springfox-spring-web</artifactId>\r
+ <version>${springfox.version}</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>io.springfox</groupId>\r
+ <artifactId>springfox-spi</artifactId>\r
+ <version>${springfox.version}</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.assertj</groupId>\r
+ <artifactId>assertj-core</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.apache.tomcat.embed</groupId>\r
+ <artifactId>tomcat-embed-core</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.openapitools</groupId>\r
+ <artifactId>jackson-databind-nullable</artifactId>\r
+ <version>${jackson-databind-nullable.version}</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>javax.validation</groupId>\r
+ <artifactId>validation-api</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>com.fasterxml.jackson.core</groupId>\r
+ <artifactId>jackson-databind</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.yaml</groupId>\r
+ <artifactId>snakeyaml</artifactId>\r
+ <scope>runtime</scope>\r
+ </dependency>\r
+ <!-- TEST -->\r
+ <dependency>\r
+ <groupId>org.springframework</groupId>\r
+ <artifactId>spring-test</artifactId>\r
+ <scope>test</scope>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.junit.jupiter</groupId>\r
+ <artifactId>junit-jupiter-api</artifactId>\r
+ <scope>test</scope>\r
+ </dependency>\r
+ </dependencies>\r
+\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <groupId>org.openapitools</groupId>\r
+ <artifactId>openapi-generator-maven-plugin</artifactId>\r
+ <version>${openapi-generator-maven-plugin.version}</version>\r
+ <executions>\r
+ <execution>\r
+ <goals>\r
+ <goal>generate</goal>\r
+ </goals>\r
+ <configuration>\r
+ <inputSpec>${project.basedir}/api/rac-api.json</inputSpec>\r
+ <generatorName>spring</generatorName>\r
+ <apiPackage>org.oransc.rappcatalogue.api</apiPackage>\r
+ <modelPackage>org.oransc.rappcatalogue.model</modelPackage>\r
+ <configOptions>\r
+ <delegatePattern>true</delegatePattern>\r
+ </configOptions>\r
+ </configuration>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+ <plugin>\r
+ <groupId>io.swagger.codegen.v3</groupId>\r
+ <artifactId>swagger-codegen-maven-plugin</artifactId>\r
+ <version>${swagger-codegen-maven-plugin.version}</version>\r
+ <executions>\r
+ <execution>\r
+ <goals>\r
+ <goal>generate</goal>\r
+ </goals>\r
+ <configuration>\r
+ <inputSpec>${project.basedir}/api/rac-api.json</inputSpec>\r
+ <language>openapi-yaml</language>\r
+ <output>${project.basedir}/api/</output>\r
+ <configOptions>\r
+ <outputFile>rac-api.yaml</outputFile>\r
+ </configOptions>\r
+ </configuration>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+ <plugin>\r
+ <groupId>io.fabric8</groupId>\r
+ <artifactId>docker-maven-plugin</artifactId>\r
+ <version>${docker-maven-plugin.version}</version>\r
+ <inherited>false</inherited>\r
+ <executions>\r
+ <execution>\r
+ <id>generate-r-app-catalogue-image</id>\r
+ <phase>package</phase>\r
+ <goals>\r
+ <goal>build</goal>\r
+ </goals>\r
+ <configuration>\r
+ <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>\r
+ <images>\r
+ <image>\r
+ <name>o-ran-sc/nonrtric-r-app-catalogue:${project.version}</name>\r
+ <build>\r
+ <cleanup>try</cleanup>\r
+ <contextDir>${basedir}</contextDir>\r
+ <dockerFile>Dockerfile</dockerFile>\r
+ <args>\r
+ <JAR>${project.build.finalName}.jar</JAR>\r
+ </args>\r
+ <tags>\r
+ <tag>${project.version}</tag>\r
+ </tags>\r
+ </build>\r
+ </image>\r
+ </images>\r
+ </configuration>\r
+ </execution>\r
+ <execution>\r
+ <id>push-r-app-catalogue-image</id>\r
+ <goals>\r
+ <goal>build</goal>\r
+ <goal>push</goal>\r
+ </goals>\r
+ <configuration>\r
+ <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>\r
+ <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>\r
+ <images>\r
+ <image>\r
+ <name>o-ran-sc/nonrtric-r-app-catalogue:${project.version}</name>\r
+ <build>\r
+ <contextDir>${basedir}</contextDir>\r
+ <dockerFile>Dockerfile</dockerFile>\r
+ <args>\r
+ <JAR>${project.build.finalName}.jar</JAR>\r
+ </args>\r
+ <tags>\r
+ <tag>${project.version}</tag>\r
+ <tag>latest</tag>\r
+ </tags>\r
+ </build>\r
+ </image>\r
+ </images>\r
+ </configuration>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+ </plugins>\r
+ </build>\r
+</project>
\ No newline at end of file
--- /dev/null
+package org.oransc.rappcatalogue.api;\r
+\r
+import java.util.Arrays;\r
+import java.util.List;\r
+\r
+import org.springframework.http.HttpStatus;\r
+import org.springframework.http.ResponseEntity;\r
+\r
+@org.springframework.stereotype.Service\r
+public class ServicesApiDelegateImpl implements ServicesApiDelegate {\r
+\r
+ @Override\r
+ public ResponseEntity<Void> deleteIndividualServiceUsingDELETE(String serviceName) {\r
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);\r
+ }\r
+\r
+ // @Override\r
+ // public ResponseEntity<Service> getIndividualServiceUsingGET(String serviceName) {\r
+ // return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);\r
+\r
+ // }\r
+\r
+ @Override\r
+ public ResponseEntity<List<String>> getServiceNamesUsingGET() {\r
+ List<String> services = Arrays.asList("a", "b");\r
+ return ResponseEntity.ok(services);\r
+ }\r
+\r
+ // @Override\r
+ // public ResponseEntity<Void> putIndividualServiceUsingPUT(String serviceName, Service service) {\r
+ // return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);\r
+\r
+ // }\r
+}\r
--- /dev/null
+package org.oransc.rappcatalogue.api;\r
+\r
+import static org.assertj.core.api.Assertions.assertThat;\r
+\r
+import java.util.Arrays;\r
+import java.util.List;\r
+\r
+import org.junit.jupiter.api.Test;\r
+import org.junit.jupiter.api.extension.ExtendWith;\r
+import org.springframework.http.HttpStatus;\r
+import org.springframework.http.ResponseEntity;\r
+import org.springframework.test.context.junit.jupiter.SpringExtension;\r
+\r
+@ExtendWith(SpringExtension.class)\r
+class ServicesApiDelegateImplTest {\r
+\r
+ @Test\r
+ void putValidService_shouldBeOk() {\r
+ ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl();\r
+\r
+ ResponseEntity<List<String>> response = delegateUnderTest.getServiceNamesUsingGET();\r
+ }\r
+\r
+ @Test\r
+ void getServices_shouldProvideArrayOfServices() throws Exception {\r
+ ServicesApiDelegateImpl delegateUnderTest = new ServicesApiDelegateImpl();\r
+\r
+ ResponseEntity<List<String>> response = delegateUnderTest.getServiceNamesUsingGET();\r
+\r
+ assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);\r
+ assertThat(response.getBody()).isEqualTo(Arrays.asList("a", "b"));\r
+ }\r
+}\r
[testenv:docs]
basepython = python3
-deps =
- sphinx
- sphinx-rtd-theme
- sphinxcontrib-httpdomain
- recommonmark
- lfdocs-conf
+deps = -r{toxinidir}/docs/requirements-docs.txt
commands =
- sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
+ sphinx-build -W -b html -n -d {envtmpdir}/docs/doctrees ./docs/ {toxinidir}/docs/_build/html
echo "Generated docs available in {toxinidir}/docs/_build/html"
whitelist_externals = echo
[testenv:docs-linkcheck]
basepython = python3
-deps = sphinx
- sphinx-rtd-theme
- sphinxcontrib-httpdomain
- recommonmark
- lfdocs-conf
+deps = -r{toxinidir}/docs/requirements-docs.txt
commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck