From: PatrikBuhr Date: Wed, 15 Mar 2023 13:46:05 +0000 (+0100) Subject: Minor changes X-Git-Tag: 1.0.0~34 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=f0801599bb1c4b6a95dafe78492a1e5e833a7449;p=nonrtric%2Fplt%2Franpm.git Minor changes pm_producer-service -> pm-producer-service Tidying up, removal of non used paramters. Signed-off-by: PatrikBuhr Issue-ID: NONRTRIC-853 Change-Id: I41dfb69cd4624e17b1152df360b67906ebffeb29 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..80763d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Documentation +.idea/ +.tox +docs/_build/ +.DS_STORE +.swagger* +docs/offeredapis/swagger/README.md + +# Eclipse +.checkstyle +.classpath +target/ +.sts4-cache +.project +.settings +.pydevproject +infer-out/ +/target/ + +.vscode +.factorypath + +coverage.* diff --git a/datafilecollector/.gitignore b/datafilecollector/.gitignore deleted file mode 100644 index 9ec364a..0000000 --- a/datafilecollector/.gitignore +++ /dev/null @@ -1,54 +0,0 @@ -# Compiled class file -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -# Intellij IDE -.idea -*.iml - -# Eclipse IDE -.project -.classpath -.settings -bin - -# Maven -target -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -.mvn/wrapper/maven-wrapper.jar - -# CheckStyle files -.checkstyle - -opt/ - -# Visual Studio Code -.factorypath diff --git a/datafilecollector/config/application.yaml b/datafilecollector/config/application.yaml index 5b00a74..7861618 100644 --- a/datafilecollector/config/application.yaml +++ b/datafilecollector/config/application.yaml @@ -26,8 +26,7 @@ logging: file: name: /var/log/ONAP/application.log app: - filepath: config/datafile_endpoints_test.json - collected-files-path: "/tmp/onap_datafile/" + collected-files-path: "/tmp/oran_datafile/" # Numer of worker threads. Increased number may increase throughput, but will require more executing resources. number-of-worker-treads: 200 # KAFKA boostrap servers. diff --git a/datafilecollector/src/main/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfig.java b/datafilecollector/src/main/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfig.java index f25d6fd..37faf70 100644 --- a/datafilecollector/src/main/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfig.java +++ b/datafilecollector/src/main/java/org/onap/dcaegen2/collectors/datafile/configuration/AppConfig.java @@ -40,9 +40,6 @@ public class AppConfig { @Value("#{systemEnvironment}") Properties systemEnvironment; - @Value("${app.filepath}") - String filepath; - @Value("${app.kafka.bootstrap-servers:}") private String kafkaBootStrapServers; diff --git a/pmproducer/Dockerfile b/pmproducer/Dockerfile index dd6d31c..0eebe91 100644 --- a/pmproducer/Dockerfile +++ b/pmproducer/Dockerfile @@ -26,26 +26,26 @@ EXPOSE 8084 8435 ARG JAR -WORKDIR /opt/app/pm_producer-service -RUN mkdir -p /var/log/pm_producer-service -RUN mkdir -p /opt/app/pm_producer-service/etc/cert/ -RUN mkdir -p /var/pm_producer-service +WORKDIR /opt/app/pm-producer-service +RUN mkdir -p /var/log/pm-producer-service +RUN mkdir -p /opt/app/pm-producer-service/etc/cert/ +RUN mkdir -p /var/pm-producer-service -ADD /config/application.yaml /opt/app/pm_producer-service/config/application.yaml -ADD /config/application_configuration.json /opt/app/pm_producer-service/data/application_configuration.json_example -ADD /config/keystore.jks /opt/app/pm_producer-service/etc/cert/keystore.jks -ADD /config/truststore.jks /opt/app/pm_producer-service/etc/cert/truststore.jks +ADD /config/application.yaml /opt/app/pm-producer-service/config/application.yaml +ADD /config/application_configuration.json /opt/app/pm-producer-service/data/application_configuration.json_example +ADD /config/keystore.jks /opt/app/pm-producer-service/etc/cert/keystore.jks +ADD /config/truststore.jks /opt/app/pm-producer-service/etc/cert/truststore.jks ARG user=nonrtric ARG group=nonrtric RUN groupadd $user && \ useradd -r -g $group $user -RUN chown -R $user:$group /opt/app/pm_producer-service -RUN chown -R $user:$group /var/log/pm_producer-service -RUN chown -R $user:$group /var/pm_producer-service +RUN chown -R $user:$group /opt/app/pm-producer-service +RUN chown -R $user:$group /var/log/pm-producer-service +RUN chown -R $user:$group /var/pm-producer-service USER ${user} -ADD target/${JAR} /opt/app/pm_producer-service/pm_producer.jar -CMD ["java", "-jar", "/opt/app/pm_producer-service/pm_producer.jar"] +ADD target/${JAR} /opt/app/pm-producer-service/pmproducer.jar +CMD ["java", "-jar", "/opt/app/pm-producer-service/pmproducer.jar"] diff --git a/pmproducer/api/api.json b/pmproducer/api/api.json new file mode 100644 index 0000000..95ff8fd --- /dev/null +++ b/pmproducer/api/api.json @@ -0,0 +1,553 @@ +{ + "components": {"schemas": { + "producer_info_job_request": { + "description": "The body of the Information Producer callbacks for Information Job creation and deletion", + "type": "object", + "required": ["info_job_identity"], + "properties": { + "owner": { + "description": "The owner of the job", + "type": "string" + }, + "last_updated": { + "description": "The time when the job was last updated or created (ISO-8601)", + "type": "string" + }, + "info_job_identity": { + "description": "Identity of the Information Job", + "type": "string" + }, + "info_job_data": { + "description": "Json for the job data", + "type": "object" + }, + "info_type_identity": { + "description": "Type identity for the job", + "type": "string" + } + } + }, + "error_information": { + "description": "Problem as defined in https://tools.ietf.org/html/rfc7807", + "type": "object", + "properties": { + "detail": { + "description": " A human-readable explanation specific to this occurrence of the problem.", + "type": "string", + "example": "Policy type not found" + }, + "status": { + "format": "int32", + "description": "The HTTP status code generated by the origin server for this occurrence of the problem. ", + "type": "integer", + "example": 503 + } + } + }, + "consumer_job": { + "description": "Information for an Information Job", + "type": "object", + "required": [ + "info_type_id", + "job_definition", + "job_owner", + "job_result_uri" + ], + "properties": { + "info_type_id": { + "description": "Information type Idenitifier of the subscription job", + "type": "string" + }, + "job_result_uri": { + "description": "The target URI of the subscribed information", + "type": "string" + }, + "job_owner": { + "description": "Identity of the owner of the job", + "type": "string" + }, + "job_definition": { + "description": "Information type specific job data", + "type": "object" + }, + "status_notification_uri": { + "description": "The target of Information subscription job status notifications", + "type": "string" + } + } + }, + "void": { + "description": "Void/empty", + "type": "object" + }, + "job_statistics": { + "description": "Statistics information for one job", + "type": "object", + "required": [ + "jobId", + "noOfReceivedBytes", + "noOfReceivedObjects", + "noOfSentBytes", + "noOfSentObjects", + "typeId" + ], + "properties": { + "noOfSentObjects": { + "format": "int64", + "type": "integer" + }, + "jobId": {"type": "string"}, + "outputTopic": {"type": "string"}, + "noOfSentBytes": { + "format": "int64", + "type": "integer" + }, + "clientId": {"type": "string"}, + "groupId": {"type": "string"}, + "noOfReceivedBytes": { + "format": "int64", + "type": "integer" + }, + "typeId": {"type": "string"}, + "inputTopic": {"type": "string"}, + "noOfReceivedObjects": { + "format": "int64", + "type": "integer" + } + } + }, + "statistics_info": { + "description": "Statistics information", + "type": "object", + "properties": {"jobStatistics": { + "description": "Statistics per job", + "type": "array", + "items": {"$ref": "#/components/schemas/job_statistics"} + }} + }, + "producer_registration_info": { + "description": "Information for an Information Producer", + "type": "object", + "required": [ + "info_job_callback_url", + "info_producer_supervision_callback_url", + "supported_info_types" + ], + "properties": { + "info_producer_supervision_callback_url": { + "description": "callback for producer supervision", + "type": "string" + }, + "supported_info_types": { + "description": "Supported Information Type IDs", + "type": "array", + "items": { + "description": "Supported Information Type IDs", + "type": "string" + } + }, + "info_job_callback_url": { + "description": "callback for Information Job", + "type": "string" + } + } + }, + "Link": { + "type": "object", + "properties": { + "templated": {"type": "boolean"}, + "href": {"type": "string"} + } + }, + "producer_info_type_info": { + "description": "Information for an Information Type", + "type": "object", + "required": [ + "info_job_data_schema", + "info_type_information" + ], + "properties": { + "info_type_information": { + "description": "Type specific information for the information type", + "type": "object" + }, + "info_job_data_schema": { + "description": "Json schema for the job data", + "type": "object" + } + } + } + }}, + "openapi": "3.0.1", + "paths": { + "/actuator/threaddump": {"get": { + "summary": "Actuator web endpoint 'threaddump'", + "operationId": "threaddump", + "responses": {"200": { + "description": "OK", + "content": { + "text/plain;charset=UTF-8": {"schema": {"type": "object"}}, + "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}}, + "application/json": {"schema": {"type": "object"}}, + "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}} + } + }}, + "tags": ["Actuator"] + }}, + "/actuator/info": {"get": { + "summary": "Actuator web endpoint 'info'", + "operationId": "info", + "responses": {"200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}}, + "application/json": {"schema": {"type": "object"}}, + "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}} + } + }}, + "tags": ["Actuator"] + }}, + "/data-producer/v1/info-types/{infoTypeId}": {"put": { + "requestBody": { + "content": {"application/json": {"schema": {"$ref": "#/components/schemas/producer_info_type_info"}}}, + "required": true + }, + "operationId": "putInfoType", + "responses": {"200": { + "description": "OK", + "content": {"application/json": {"schema": {"type": "object"}}} + }}, + "parameters": [{ + "schema": {"type": "string"}, + "in": "path", + "name": "infoTypeId", + "required": true + }], + "tags": ["Information Coordinator Service Simulator (exists only in test)"] + }}, + "/statistics": {"get": { + "summary": "Returns statistics", + "operationId": "getStatistics", + "responses": {"200": { + "description": "OK", + "content": {"application/json": {"schema": {"$ref": "#/components/schemas/statistics_info"}}} + }}, + "tags": ["Producer job control API"] + }}, + "/generic_dataproducer/health_check": {"get": { + "summary": "Producer supervision", + "description": "The endpoint is provided by the Information Producer and is used for supervision of the producer.", + "operationId": "producerSupervision", + "responses": {"200": { + "description": "The producer is OK", + "content": {"application/json": {"schema": {"type": "string"}}} + }}, + "tags": ["Producer job control API"] + }}, + "/generic_dataproducer/info_job": { + "post": { + "summary": "Callback for Information Job creation/modification", + "requestBody": { + "content": {"application/json": {"schema": {"type": "string"}}}, + "required": true + }, + "description": "The call is invoked to activate or to modify a data subscription. The endpoint is provided by the Information Producer.", + "operationId": "jobCreatedCallback", + "responses": { + "200": { + "description": "OK", + "content": {"application/json": {"schema": {"$ref": "#/components/schemas/void"}}} + }, + "400": { + "description": "Other error in the request", + "content": {"application/json": {"schema": {"$ref": "#/components/schemas/error_information"}}} + }, + "404": { + "description": "Information type is not found", + "content": {"application/json": {"schema": {"$ref": "#/components/schemas/error_information"}}} + } + }, + "tags": ["Producer job control API"] + }, + "get": { + "summary": "Get all jobs", + "description": "Returns all info jobs, can be used for trouble shooting", + "operationId": "getJobs", + "responses": {"200": { + "description": "Information jobs", + "content": {"application/json": {"schema": { + "type": "array", + "items": {"$ref": "#/components/schemas/producer_info_job_request"} + }}} + }}, + "tags": ["Producer job control API"] + } + }, + "/actuator/loggers": {"get": { + "summary": "Actuator web endpoint 'loggers'", + "operationId": "loggers", + "responses": {"200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}}, + "application/json": {"schema": {"type": "object"}}, + "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}} + } + }}, + "tags": ["Actuator"] + }}, + "/actuator/health/**": {"get": { + "summary": "Actuator web endpoint 'health-path'", + "operationId": "health-path", + "responses": {"200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}}, + "application/json": {"schema": {"type": "object"}}, + "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}} + } + }}, + "tags": ["Actuator"] + }}, + "/actuator/shutdown": {"post": { + "summary": "Actuator web endpoint 'shutdown'", + "operationId": "shutdown", + "responses": {"200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}}, + "application/json": {"schema": {"type": "object"}}, + "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}} + } + }}, + "tags": ["Actuator"] + }}, + "/data-producer/v1/info-producers/{infoProducerId}": { + "get": { + "operationId": "getInfoProducer", + "responses": {"200": { + "description": "OK", + "content": {"application/json": {"schema": {"type": "object"}}} + }}, + "parameters": [{ + "schema": {"type": "string"}, + "in": "path", + "name": "infoProducerId", + "required": true + }], + "tags": ["Information Coordinator Service Simulator (exists only in test)"] + }, + "put": { + "requestBody": { + "content": {"application/json": {"schema": {"$ref": "#/components/schemas/producer_registration_info"}}}, + "required": true + }, + "operationId": "putInfoProducer", + "responses": {"200": { + "description": "OK", + "content": {"application/json": {"schema": {"type": "object"}}} + }}, + "parameters": [{ + "schema": {"type": "string"}, + "in": "path", + "name": "infoProducerId", + "required": true + }], + "tags": ["Information Coordinator Service Simulator (exists only in test)"] + } + }, + "/actuator/metrics/{requiredMetricName}": {"get": { + "summary": "Actuator web endpoint 'metrics-requiredMetricName'", + "operationId": "metrics-requiredMetricName", + "responses": {"200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}}, + "application/json": {"schema": {"type": "object"}}, + "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}} + } + }}, + "parameters": [{ + "schema": {"type": "string"}, + "in": "path", + "name": "requiredMetricName", + "required": true + }], + "tags": ["Actuator"] + }}, + "/generic_dataproducer/info_job/{infoJobId}": {"delete": { + "summary": "Callback for Information Job deletion", + "description": "The call is invoked to terminate a data subscription. The endpoint is provided by the Information Producer.", + "operationId": "jobDeletedCallback", + "responses": {"200": { + "description": "OK", + "content": {"application/json": {"schema": {"$ref": "#/components/schemas/void"}}} + }}, + "parameters": [{ + "schema": {"type": "string"}, + "in": "path", + "name": "infoJobId", + "required": true + }], + "tags": ["Producer job control API"] + }}, + "/actuator": {"get": { + "summary": "Actuator root web endpoint", + "operationId": "links", + "responses": {"200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": {"schema": { + "additionalProperties": { + "additionalProperties": {"$ref": "#/components/schemas/Link"}, + "type": "object" + }, + "type": "object" + }}, + "application/json": {"schema": { + "additionalProperties": { + "additionalProperties": {"$ref": "#/components/schemas/Link"}, + "type": "object" + }, + "type": "object" + }}, + "application/vnd.spring-boot.actuator.v2+json": {"schema": { + "additionalProperties": { + "additionalProperties": {"$ref": "#/components/schemas/Link"}, + "type": "object" + }, + "type": "object" + }} + } + }}, + "tags": ["Actuator"] + }}, + "/actuator/logfile": {"get": { + "summary": "Actuator web endpoint 'logfile'", + "operationId": "logfile", + "responses": {"200": { + "description": "OK", + "content": {"text/plain;charset=UTF-8": {"schema": {"type": "object"}}} + }}, + "tags": ["Actuator"] + }}, + "/data-consumer/v1/info-jobs/{infoJobId}": {"put": { + "requestBody": { + "content": {"application/json": {"schema": {"$ref": "#/components/schemas/consumer_job"}}}, + "required": true + }, + "operationId": "putIndividualInfoJob", + "responses": {"200": { + "description": "OK", + "content": {"application/json": {"schema": {"type": "object"}}} + }}, + "parameters": [{ + "schema": {"type": "string"}, + "in": "path", + "name": "infoJobId", + "required": true + }], + "tags": ["Information Coordinator Service Simulator (exists only in test)"] + }}, + "/actuator/loggers/{name}": { + "post": { + "summary": "Actuator web endpoint 'loggers-name'", + "requestBody": {"content": {"application/json": {"schema": { + "type": "string", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "FATAL", + "OFF" + ] + }}}}, + "operationId": "loggers-name_2", + "responses": {"200": { + "description": "OK", + "content": {"*/*": {"schema": {"type": "object"}}} + }}, + "parameters": [{ + "schema": {"type": "string"}, + "in": "path", + "name": "name", + "required": true + }], + "tags": ["Actuator"] + }, + "get": { + "summary": "Actuator web endpoint 'loggers-name'", + "operationId": "loggers-name", + "responses": {"200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}}, + "application/json": {"schema": {"type": "object"}}, + "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}} + } + }}, + "parameters": [{ + "schema": {"type": "string"}, + "in": "path", + "name": "name", + "required": true + }], + "tags": ["Actuator"] + } + }, + "/actuator/health": {"get": { + "summary": "Actuator web endpoint 'health'", + "operationId": "health", + "responses": {"200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}}, + "application/json": {"schema": {"type": "object"}}, + "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}} + } + }}, + "tags": ["Actuator"] + }}, + "/actuator/metrics": {"get": { + "summary": "Actuator web endpoint 'metrics'", + "operationId": "metrics", + "responses": {"200": { + "description": "OK", + "content": { + "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}}, + "application/json": {"schema": {"type": "object"}}, + "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}} + } + }}, + "tags": ["Actuator"] + }}, + "/actuator/heapdump": {"get": { + "summary": "Actuator web endpoint 'heapdump'", + "operationId": "heapdump", + "responses": {"200": { + "description": "OK", + "content": {"application/octet-stream": {"schema": {"type": "object"}}} + }}, + "tags": ["Actuator"] + }} + }, + "info": { + "license": { + "name": "Copyright (C) 2023 Nordix Foundation. Licensed under the Apache License.", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + }, + "description": "Reads data from DMaaP and Kafka and posts it further to information consumers", + "title": "Generic Dmaap and Kafka Information Producer", + "version": "1.0" + }, + "tags": [{ + "name": "Actuator", + "description": "Monitor and interact", + "externalDocs": { + "description": "Spring Boot Actuator Web API Documentation", + "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/" + } + }] +} \ No newline at end of file diff --git a/pmproducer/api/api.yaml b/pmproducer/api/api.yaml new file mode 100644 index 0000000..d3437e5 --- /dev/null +++ b/pmproducer/api/api.yaml @@ -0,0 +1,644 @@ +openapi: 3.0.1 +info: + title: Generic Dmaap and Kafka Information Producer + description: Reads data from DMaaP and Kafka and posts it further to information + consumers + license: + name: Copyright (C) 2023 Nordix Foundation. Licensed under the Apache License. + url: http://www.apache.org/licenses/LICENSE-2.0 + version: "1.0" +servers: +- url: / +tags: +- name: Actuator + description: Monitor and interact + externalDocs: + description: Spring Boot Actuator Web API Documentation + url: https://docs.spring.io/spring-boot/docs/current/actuator-api/html/ +paths: + /actuator/threaddump: + get: + tags: + - Actuator + summary: Actuator web endpoint 'threaddump' + operationId: threaddump + responses: + 200: + description: OK + content: + text/plain;charset=UTF-8: + schema: + type: object + application/vnd.spring-boot.actuator.v3+json: + schema: + type: object + application/json: + schema: + type: object + application/vnd.spring-boot.actuator.v2+json: + schema: + type: object + /actuator/info: + get: + tags: + - Actuator + summary: Actuator web endpoint 'info' + operationId: info + responses: + 200: + description: OK + content: + application/vnd.spring-boot.actuator.v3+json: + schema: + type: object + application/json: + schema: + type: object + application/vnd.spring-boot.actuator.v2+json: + schema: + type: object + /data-producer/v1/info-types/{infoTypeId}: + put: + tags: + - Information Coordinator Service Simulator (exists only in test) + operationId: putInfoType + parameters: + - name: infoTypeId + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/producer_info_type_info' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + /statistics: + get: + tags: + - Producer job control API + summary: Returns statistics + operationId: getStatistics + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/statistics_info' + /generic_dataproducer/health_check: + get: + tags: + - Producer job control API + summary: Producer supervision + description: The endpoint is provided by the Information Producer and is used + for supervision of the producer. + operationId: producerSupervision + responses: + 200: + description: The producer is OK + content: + application/json: + schema: + type: string + /generic_dataproducer/info_job: + get: + tags: + - Producer job control API + summary: Get all jobs + description: Returns all info jobs, can be used for trouble shooting + operationId: getJobs + responses: + 200: + description: Information jobs + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/producer_info_job_request' + post: + tags: + - Producer job control API + summary: Callback for Information Job creation/modification + description: The call is invoked to activate or to modify a data subscription. + The endpoint is provided by the Information Producer. + operationId: jobCreatedCallback + requestBody: + content: + application/json: + schema: + type: string + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/void' + 400: + description: Other error in the request + content: + application/json: + schema: + $ref: '#/components/schemas/error_information' + 404: + description: Information type is not found + content: + application/json: + schema: + $ref: '#/components/schemas/error_information' + /actuator/loggers: + get: + tags: + - Actuator + summary: Actuator web endpoint 'loggers' + operationId: loggers + responses: + 200: + description: OK + content: + application/vnd.spring-boot.actuator.v3+json: + schema: + type: object + application/json: + schema: + type: object + application/vnd.spring-boot.actuator.v2+json: + schema: + type: object + /actuator/health/**: + get: + tags: + - Actuator + summary: Actuator web endpoint 'health-path' + operationId: health-path + responses: + 200: + description: OK + content: + application/vnd.spring-boot.actuator.v3+json: + schema: + type: object + application/json: + schema: + type: object + application/vnd.spring-boot.actuator.v2+json: + schema: + type: object + /actuator/shutdown: + post: + tags: + - Actuator + summary: Actuator web endpoint 'shutdown' + operationId: shutdown + responses: + 200: + description: OK + content: + application/vnd.spring-boot.actuator.v3+json: + schema: + type: object + application/json: + schema: + type: object + application/vnd.spring-boot.actuator.v2+json: + schema: + type: object + /data-producer/v1/info-producers/{infoProducerId}: + get: + tags: + - Information Coordinator Service Simulator (exists only in test) + operationId: getInfoProducer + parameters: + - name: infoProducerId + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + put: + tags: + - Information Coordinator Service Simulator (exists only in test) + operationId: putInfoProducer + parameters: + - name: infoProducerId + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/producer_registration_info' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + /actuator/metrics/{requiredMetricName}: + get: + tags: + - Actuator + summary: Actuator web endpoint 'metrics-requiredMetricName' + operationId: metrics-requiredMetricName + parameters: + - name: requiredMetricName + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + 200: + description: OK + content: + application/vnd.spring-boot.actuator.v3+json: + schema: + type: object + application/json: + schema: + type: object + application/vnd.spring-boot.actuator.v2+json: + schema: + type: object + /generic_dataproducer/info_job/{infoJobId}: + delete: + tags: + - Producer job control API + summary: Callback for Information Job deletion + description: The call is invoked to terminate a data subscription. The endpoint + is provided by the Information Producer. + operationId: jobDeletedCallback + parameters: + - name: infoJobId + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/void' + /actuator: + get: + tags: + - Actuator + summary: Actuator root web endpoint + operationId: links + responses: + 200: + description: OK + content: + application/vnd.spring-boot.actuator.v3+json: + schema: + type: object + additionalProperties: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + application/json: + schema: + type: object + additionalProperties: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + application/vnd.spring-boot.actuator.v2+json: + schema: + type: object + additionalProperties: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + /actuator/logfile: + get: + tags: + - Actuator + summary: Actuator web endpoint 'logfile' + operationId: logfile + responses: + 200: + description: OK + content: + text/plain;charset=UTF-8: + schema: + type: object + /data-consumer/v1/info-jobs/{infoJobId}: + put: + tags: + - Information Coordinator Service Simulator (exists only in test) + operationId: putIndividualInfoJob + parameters: + - name: infoJobId + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/consumer_job' + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + /actuator/loggers/{name}: + get: + tags: + - Actuator + summary: Actuator web endpoint 'loggers-name' + operationId: loggers-name + parameters: + - name: name + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + 200: + description: OK + content: + application/vnd.spring-boot.actuator.v3+json: + schema: + type: object + application/json: + schema: + type: object + application/vnd.spring-boot.actuator.v2+json: + schema: + type: object + post: + tags: + - Actuator + summary: Actuator web endpoint 'loggers-name' + operationId: loggers-name_2 + parameters: + - name: name + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + enum: + - TRACE + - DEBUG + - INFO + - WARN + - ERROR + - FATAL + - OFF + responses: + 200: + description: OK + content: + '*/*': + schema: + type: object + /actuator/health: + get: + tags: + - Actuator + summary: Actuator web endpoint 'health' + operationId: health + responses: + 200: + description: OK + content: + application/vnd.spring-boot.actuator.v3+json: + schema: + type: object + application/json: + schema: + type: object + application/vnd.spring-boot.actuator.v2+json: + schema: + type: object + /actuator/metrics: + get: + tags: + - Actuator + summary: Actuator web endpoint 'metrics' + operationId: metrics + responses: + 200: + description: OK + content: + application/vnd.spring-boot.actuator.v3+json: + schema: + type: object + application/json: + schema: + type: object + application/vnd.spring-boot.actuator.v2+json: + schema: + type: object + /actuator/heapdump: + get: + tags: + - Actuator + summary: Actuator web endpoint 'heapdump' + operationId: heapdump + responses: + 200: + description: OK + content: + application/octet-stream: + schema: + type: object +components: + schemas: + producer_info_job_request: + required: + - info_job_identity + type: object + properties: + owner: + type: string + description: The owner of the job + last_updated: + type: string + description: The time when the job was last updated or created (ISO-8601) + info_job_identity: + type: string + description: Identity of the Information Job + info_job_data: + type: object + description: Json for the job data + info_type_identity: + type: string + description: Type identity for the job + description: The body of the Information Producer callbacks for Information + Job creation and deletion + error_information: + type: object + properties: + detail: + type: string + description: ' A human-readable explanation specific to this occurrence + of the problem.' + example: Policy type not found + status: + type: integer + description: 'The HTTP status code generated by the origin server for this + occurrence of the problem. ' + format: int32 + example: 503 + description: Problem as defined in https://tools.ietf.org/html/rfc7807 + consumer_job: + required: + - info_type_id + - job_definition + - job_owner + - job_result_uri + type: object + properties: + info_type_id: + type: string + description: Information type Idenitifier of the subscription job + job_result_uri: + type: string + description: The target URI of the subscribed information + job_owner: + type: string + description: Identity of the owner of the job + job_definition: + type: object + description: Information type specific job data + status_notification_uri: + type: string + description: The target of Information subscription job status notifications + description: Information for an Information Job + void: + type: object + description: Void/empty + job_statistics: + required: + - jobId + - noOfReceivedBytes + - noOfReceivedObjects + - noOfSentBytes + - noOfSentObjects + - typeId + type: object + properties: + noOfSentObjects: + type: integer + format: int64 + jobId: + type: string + outputTopic: + type: string + noOfSentBytes: + type: integer + format: int64 + clientId: + type: string + groupId: + type: string + noOfReceivedBytes: + type: integer + format: int64 + typeId: + type: string + inputTopic: + type: string + noOfReceivedObjects: + type: integer + format: int64 + description: Statistics information for one job + statistics_info: + type: object + properties: + jobStatistics: + type: array + description: Statistics per job + items: + $ref: '#/components/schemas/job_statistics' + description: Statistics information + producer_registration_info: + required: + - info_job_callback_url + - info_producer_supervision_callback_url + - supported_info_types + type: object + properties: + info_producer_supervision_callback_url: + type: string + description: callback for producer supervision + supported_info_types: + type: array + description: Supported Information Type IDs + items: + type: string + description: Supported Information Type IDs + info_job_callback_url: + type: string + description: callback for Information Job + description: Information for an Information Producer + Link: + type: object + properties: + templated: + type: boolean + href: + type: string + producer_info_type_info: + required: + - info_job_data_schema + - info_type_information + type: object + properties: + info_type_information: + type: object + description: Type specific information for the information type + info_job_data_schema: + type: object + description: Json schema for the job data + description: Information for an Information Type diff --git a/pmproducer/config/application.yaml b/pmproducer/config/application.yaml index b0fd88a..d084bc4 100644 --- a/pmproducer/config/application.yaml +++ b/pmproducer/config/application.yaml @@ -49,7 +49,7 @@ logging: file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %logger{20} - %msg%n" file: - name: /var/log/pm_producer-service/application.log + name: /var/log/pm-producer-service/application.log server: # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework. # See springboot documentation. @@ -58,7 +58,7 @@ server: ssl: key-store-type: JKS key-store-password: policy_agent - key-store: /opt/app/pm_producer-service/etc/cert/keystore.jks + key-store: /opt/app/pm-producer-service/etc/cert/keystore.jks key-password: policy_agent key-alias: policy_agent shutdown: "graceful" @@ -69,18 +69,15 @@ app: # Note that the same keystore as for the server is used. trust-store-used: false trust-store-password: policy_agent - trust-store: /opt/app/pm_producer-service/etc/cert/truststore.jks + trust-store: /opt/app/pm-producer-service/etc/cert/truststore.jks # Configuration of usage of HTTP Proxy for the southbound accesses. # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s http.proxy-host: http.proxy-port: 0 ics-base-url: https://localhost:8434 - # Location of the component configuration file. The file will only be used if the Consul database is not used; - # configuration from the Consul will override the file. - configuration-filepath: /opt/app/pm_producer-service/data/application_configuration.json - dmaap-base-url: http://dradmin:dradmin@localhost:2222 + # The url used to adress this component. This is used as a callback url sent to other components. - pm_producer-base-url: https://localhost:8435 + pm-producer-base-url: https://localhost:8435 # KAFKA boostrap servers. This is only needed if there are Information Types that uses a kafkaInputTopic # several redundant boostrap servers can be specified, separated by a comma ','. kafka: diff --git a/pmproducer/src/main/java/org/oran/pmproducer/Application.java b/pmproducer/src/main/java/org/oran/pmproducer/Application.java index 14cb353..e92bd47 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/Application.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/Application.java @@ -20,18 +20,15 @@ package org.oran.pmproducer; -import java.io.File; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.scheduling.annotation.EnableScheduling; -import org.springframework.scheduling.annotation.Scheduled; @SpringBootApplication @EnableConfigurationProperties @@ -40,9 +37,6 @@ public class Application { private static final Logger logger = LoggerFactory.getLogger(Application.class); - @Value("${app.configuration-filepath}") - private String localConfigurationFilePath; - private long configFileLastModification = 0; private static ConfigurableApplicationContext applicationContext; @@ -58,16 +52,6 @@ public class Application { }); } - @Scheduled(fixedRate = 10 * 1000) - public void checkConfigFileChanges() { - long timestamp = new File(localConfigurationFilePath).lastModified(); - if (configFileLastModification != 0 && timestamp != configFileLastModification) { - logger.info("Restarting due to change in the file {}", localConfigurationFilePath); - restartApplication(); - } - configFileLastModification = timestamp; - } - private static void restartApplication() { if (applicationContext == null) { logger.info("Cannot restart in unittest"); diff --git a/pmproducer/src/main/java/org/oran/pmproducer/configuration/ApplicationConfig.java b/pmproducer/src/main/java/org/oran/pmproducer/configuration/ApplicationConfig.java index 2048b42..18fcd8f 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/configuration/ApplicationConfig.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/configuration/ApplicationConfig.java @@ -85,13 +85,9 @@ public class ApplicationConfig { private String icsBaseUrl; @Getter - @Value("${app.pm_producer-base-url}") + @Value("${app.pm-producer-base-url}") private String selfUrl; - @Getter - @Value("${app.dmaap-base-url}") - private String dmaapBaseUrl; - @Getter @Value("${app.kafka.bootstrap-servers:}") private String kafkaBootStrapServers; diff --git a/pmproducer/src/test/java/org/oran/pmproducer/ApplicationTest.java b/pmproducer/src/test/java/org/oran/pmproducer/ApplicationTest.java index 49b8ea2..8cba2ca 100644 --- a/pmproducer/src/test/java/org/oran/pmproducer/ApplicationTest.java +++ b/pmproducer/src/test/java/org/oran/pmproducer/ApplicationTest.java @@ -146,11 +146,6 @@ class ApplicationTest { return thisProcessUrl(); } - @Override - public String getDmaapBaseUrl() { - return thisProcessUrl(); - } - @Override public String getSelfUrl() { return thisProcessUrl(); diff --git a/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithIcs.java b/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithIcs.java index e7875e2..8ce5547 100644 --- a/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithIcs.java +++ b/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithIcs.java @@ -83,11 +83,6 @@ class IntegrationWithIcs { return "https://localhost:8434"; } - @Override - public String getDmaapBaseUrl() { - return thisProcessUrl(); - } - @Override public String getSelfUrl() { return thisProcessUrl(); diff --git a/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithKafka.java b/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithKafka.java index 5410485..39363f8 100644 --- a/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithKafka.java +++ b/pmproducer/src/test/java/org/oran/pmproducer/IntegrationWithKafka.java @@ -124,11 +124,6 @@ class IntegrationWithKafka { return thisProcessUrl(); } - @Override - public String getDmaapBaseUrl() { - return thisProcessUrl(); - } - @Override public String getSelfUrl() { return thisProcessUrl();