From: Henrik Andersson Date: Wed, 16 Dec 2020 12:28:46 +0000 (+0000) Subject: Merge "Improved specification of images and tags" X-Git-Tag: 2.2.0~97 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=e1eebe59d712b5439b2813d69944a870be1e93ad;hp=89b64ab194785ec389c8353e4b90e3e7edd08662;p=nonrtric.git Merge "Improved specification of images and tags" --- diff --git a/.gitignore b/.gitignore index 26c6731d..02f4f986 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ .tox docs/_build/ .DS_STORE +.swagger* +docs/offeredapis/swagger/README.md # Eclipse .checkstyle diff --git a/.releases/container-release-nonrtric-enrichment-coordinator-service.yaml b/.releases/container-release-nonrtric-enrichment-coordinator-service.yaml new file mode 100644 index 00000000..d68088c6 --- /dev/null +++ b/.releases/container-release-nonrtric-enrichment-coordinator-service.yaml @@ -0,0 +1,10 @@ +--- +distribution_type: container +container_release_tag: 1.0.0 +container_pull_registry: nexus3.o-ran-sc.org:10004 +container_push_registry: nexus3.o-ran-sc.org:10002 +project: nonrtric +ref: 90ce16238dd6970153e1c0fbddb15e32c68c504f +containers: + - name: nonrtric-enrichment-coordinator-service + version: 1.0.0 \ No newline at end of file diff --git a/.releases/container-release-nonrtric-policy-agent.yaml b/.releases/container-release-nonrtric-policy-agent.yaml index 41be2870..a80747dc 100644 --- a/.releases/container-release-nonrtric-policy-agent.yaml +++ b/.releases/container-release-nonrtric-policy-agent.yaml @@ -1,10 +1,10 @@ --- distribution_type: container -container_release_tag: 2.0.0 +container_release_tag: 2.1.0 container_pull_registry: nexus3.o-ran-sc.org:10004 container_push_registry: nexus3.o-ran-sc.org:10002 project: nonrtric -ref: 2466f9d370214b578efedd1d3e38b1de17e6ca1c +ref: 90ce16238dd6970153e1c0fbddb15e32c68c504f containers: - name: nonrtric-policy-agent - version: 2.0.0 \ No newline at end of file + version: 2.1.0 \ No newline at end of file diff --git a/.releases/container-release-nonrtric-r-app-catalogue-controller.yaml b/.releases/container-release-nonrtric-r-app-catalogue-controller.yaml new file mode 100644 index 00000000..796493b0 --- /dev/null +++ b/.releases/container-release-nonrtric-r-app-catalogue-controller.yaml @@ -0,0 +1,10 @@ +--- +distribution_type: container +container_release_tag: 1.0.0 +container_pull_registry: nexus3.o-ran-sc.org:10004 +container_push_registry: nexus3.o-ran-sc.org:10002 +project: nonrtric +ref: 90ce16238dd6970153e1c0fbddb15e32c68c504f +containers: + - name: nonrtric-r-app-catalogue + version: 1.0.0 diff --git a/.releases/maven-release-nonrtric-enrichment-coordinator-service.yaml b/.releases/maven-release-nonrtric-enrichment-coordinator-service.yaml new file mode 100644 index 00000000..09a49c03 --- /dev/null +++ b/.releases/maven-release-nonrtric-enrichment-coordinator-service.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: maven +version: 1.0.0 +project: enrichment-coordinator-service +log_dir: nonrtric-enrichment-coordinator-service-maven-stage-master/6/ \ No newline at end of file diff --git a/.releases/maven-release-nonrtric-policy-agent.yaml b/.releases/maven-release-nonrtric-policy-agent.yaml index bce35357..ea1c1349 100644 --- a/.releases/maven-release-nonrtric-policy-agent.yaml +++ b/.releases/maven-release-nonrtric-policy-agent.yaml @@ -1,5 +1,5 @@ --- distribution_type: maven -version: 2.0.0 +version: 2.1.0 project: nonrtric-policy-agent -log_dir: nonrtric-policy-agent-maven-stage-master/19/ \ No newline at end of file +log_dir: nonrtric-policy-agent-maven-stage-master/188/ \ No newline at end of file diff --git a/.releases/maven-release-nonrtric-r-app-catalogue.yaml b/.releases/maven-release-nonrtric-r-app-catalogue.yaml new file mode 100644 index 00000000..dbf9e507 --- /dev/null +++ b/.releases/maven-release-nonrtric-r-app-catalogue.yaml @@ -0,0 +1,5 @@ +--- +distribution_type: maven +version: 1.0.0 +project: nonrtric-r-app-catalogue +log_dir: nonrtric-r-app-catalogue-maven-stage-master/2/ diff --git a/docker-compose/data/prepareEcsData.sh b/docker-compose/data/prepareEcsData.sh index f949f4cf..76b5a052 100755 --- a/docker-compose/data/prepareEcsData.sh +++ b/docker-compose/data/prepareEcsData.sh @@ -69,15 +69,15 @@ echo -e "\n" # Create EiJob echo "Create EiJob Of A Certain Type type1:" -curl -X PUT -skw " %{http_code}" $httpx://localhost:$ecs_port/A1-EI/v1/eitypes/type1/eijobs/job1 -H Content-Type:application/json --data-binary @testdata/ECS/EiJob.json +curl -X PUT -skw " %{http_code}" $httpx://localhost:$ecs_port/A1-EI/v1/eijobs/job1 -H Content-Type:application/json --data-binary @testdata/ECS/EiJob.json echo -e "\n" -# Get EiJobs Of A Certain Type type1 -echo "Get EiJobs Of A Certain Type type1:" -curl -X GET -skw " %{http_code}" $httpx://localhost:$ecs_port/A1-EI/v1/eitypes/type1/eijobs -H Content-Type:application/json | jq +# Get EiJobs +echo "Get EiJobs:" +curl -X GET -skw " %{http_code}" $httpx://localhost:$ecs_port/A1-EI/v1/eijobs -H Content-Type:application/json | jq echo -e "\n" # Get Individual EiJob: echo "Get Individual EiJob:" -curl -X GET -skw " %{http_code}" $httpx://localhost:$ecs_port/A1-EI/v1/eitypes/type1/eijobs/job1 -H Content-Type:application/json | jq +curl -X GET -skw " %{http_code}" $httpx://localhost:$ecs_port/A1-EI/v1/eijobs/job1 -H Content-Type:application/json | jq echo -e "\n" \ No newline at end of file diff --git a/docker-compose/data/testdata/ECS/EiJob.json b/docker-compose/data/testdata/ECS/EiJob.json index 30edb2cb..003c70f9 100644 --- a/docker-compose/data/testdata/ECS/EiJob.json +++ b/docker-compose/data/testdata/ECS/EiJob.json @@ -1,5 +1,11 @@ { - "jobOwner": "1", - "jobParameters": {}, - "targetUri": "http://example.com" - } \ No newline at end of file + "eiTypeId": "type1", + "jobResultUri": "https://ricsim_g3_1:8185/datadelivery", + "jobOwner": "ricsim_g3_1", + "jobStatusNotificationUri": "http://producer:80/", + "jobDefinition": { + "jobparam1": "value1_job1", + "jobparam2": "value2_job1", + "jobparam3": "value3_job1" + } +} \ No newline at end of file diff --git a/docker-compose/data/testdata/ECS/EiProducer.json b/docker-compose/data/testdata/ECS/EiProducer.json index ebb4ad42..bb9a1b3c 100644 --- a/docker-compose/data/testdata/ECS/EiProducer.json +++ b/docker-compose/data/testdata/ECS/EiProducer.json @@ -1,9 +1,13 @@ { - "ei_job_creation_callback_url": "http://example.com", - "ei_job_deletion_callback_url": "http://example.com", - "ei_producer_supervision_callback_url": "http://example.com", "supported_ei_types": [{ - "ei_job_data_schema": {}, - "ei_type_identity": "type1" - }] + "ei_type_identity": "type1", + "ei_job_data_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "STD_Type1_1.0.0", + "description": "EI-Type 1", + "type": "object" + } + }], + "ei_job_callback_url": "http://producer:80/", + "ei_producer_supervision_callback_url": "http://producer:80/" } \ No newline at end of file diff --git a/docker-compose/ecs/docker-compose.yml b/docker-compose/ecs/docker-compose.yml index f38d2244..8b64e253 100644 --- a/docker-compose/ecs/docker-compose.yml +++ b/docker-compose/ecs/docker-compose.yml @@ -22,7 +22,7 @@ networks: services: ecs: - image: nexus3.o-ran-sc.org:10003/o-ran-sc/nonrtric-enrichment-coordinator-service:1.0.0-SNAPSHOT + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-enrichment-coordinator-service:1.1.0 container_name: ecs networks: default: @@ -33,7 +33,7 @@ services: - 8434:8434 policy-control-panel: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.2.0 container_name: policy-control-panel networks: - default @@ -41,3 +41,11 @@ services: - 8080:8080 - 8082:8082 + producer: + image: eexit/mirror-http-server + container_name: producer + networks: + - default + ports: + - 8088:80 + diff --git a/docker-compose/nosdnc/docker-compose.yml b/docker-compose/nosdnc/docker-compose.yml index c812d97e..c57cd29e 100644 --- a/docker-compose/nosdnc/docker-compose.yml +++ b/docker-compose/nosdnc/docker-compose.yml @@ -22,7 +22,7 @@ networks: services: policy-agent: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent:2.1.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent:2.2.0 container_name: policy-agent networks: default: @@ -40,7 +40,7 @@ services: # - ./config/application-policyagent.yaml:/opt/app/policy-agent/config/application.yaml:ro a1-sim-OSC: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.1.0 container_name: a1-sim-OSC networks: - default @@ -53,7 +53,7 @@ services: - ALLOW_HTTP=true a1-sim-STD: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.1.0 container_name: a1-sim-STD networks: - default @@ -66,7 +66,7 @@ services: - ALLOW_HTTP=true policy-control-panel: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.2.0 container_name: policy-control-panel networks: - default diff --git a/docker-compose/rapp/docker-compose.yml b/docker-compose/rapp/docker-compose.yml index 1e4763af..3265408a 100644 --- a/docker-compose/rapp/docker-compose.yml +++ b/docker-compose/rapp/docker-compose.yml @@ -22,7 +22,7 @@ networks: services: r-app: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-r-app-catalogue:1.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-r-app-catalogue:1.1.0 container_name: r-app networks: default: diff --git a/docker-compose/sdnc/docker-compose.yml b/docker-compose/sdnc/docker-compose.yml index 96675489..9796ecee 100644 --- a/docker-compose/sdnc/docker-compose.yml +++ b/docker-compose/sdnc/docker-compose.yml @@ -22,7 +22,7 @@ networks: services: policy-agent: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent:2.1.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent:2.2.0 container_name: policy-agent networks: default: @@ -40,7 +40,7 @@ services: # - ./config/application-policyagent.yaml:/opt/app/policy-agent/config/application.yaml:ro a1-sim-OSC: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.1.0 container_name: a1-sim-OSC networks: - default @@ -53,7 +53,7 @@ services: - ALLOW_HTTP=true a1-sim-STD: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.1.0 container_name: a1-sim-STD networks: - default @@ -66,7 +66,7 @@ services: - ALLOW_HTTP=true policy-control-panel: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.2.0 container_name: policy-control-panel networks: - default diff --git a/docker-compose/withDmaap_nosdnc/docker-compose.yml b/docker-compose/withDmaap_nosdnc/docker-compose.yml index 492660ee..f2026b0d 100644 --- a/docker-compose/withDmaap_nosdnc/docker-compose.yml +++ b/docker-compose/withDmaap_nosdnc/docker-compose.yml @@ -22,7 +22,7 @@ networks: services: policy-agent: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent:2.1.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent:2.2.0 container_name: policy-agent networks: default: @@ -41,7 +41,7 @@ services: # - ./pms/application-policyagent.yaml:/opt/app/policy-agent/config/application.yaml:ro a1-sim-OSC: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.1.0 container_name: a1-sim-OSC networks: - default @@ -54,7 +54,7 @@ services: - ALLOW_HTTP=true a1-sim-STD: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.1.0 container_name: a1-sim-STD networks: - default @@ -67,7 +67,7 @@ services: - ALLOW_HTTP=true policy-control-panel: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.0.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.2.0 container_name: policy-control-panel networks: - default diff --git a/docs/api-docs.rst b/docs/api-docs.rst index ed0cc79a..9e438f67 100644 --- a/docs/api-docs.rst +++ b/docs/api-docs.rst @@ -18,15 +18,15 @@ API-Docs This is the API-docs of Non-RT RIC. The Non-RT RIC consists of three parts, described in the sections below: - * The Policy Agent + * The A1 Policy Management Service * The Enrichment Coordinator Service * The rAPP Catalogue -Policy Agent -============ +A1 Policy Management Service +============================ -For information about the The Policy Agent that is implemented in ONAP, see `readthedocs`_ and `wiki`_. +For information about the A1 Policy Management Service that is implemented in ONAP, see `readthedocs`_ and `wiki`_. .. _readthedocs: https://docs.onap.org/projects/onap-ccsdk-oran/en/latest/index.html .. _wiki: https://wiki.onap.org/pages/viewpage.action?pageId=84644984 @@ -37,10 +37,10 @@ Enrichment Coordinator Service See `ECS API <./ecs-api.html>`_ for how to use the API. .. csv-table:: - :header: "API name", "|swagger-icon|" - :widths: 10,5 + :header: "API name", "|swagger-icon|", "|yaml-icon|" + :widths: 10,5,5 - "ECS API", ":download:`link <./offeredapis/swagger/ecs-api.json>`" + "ECS API", ":download:`link <../enrichment-coordinator-service/api/ecs-api.json>`", ":download:`link <../enrichment-coordinator-service/api/ecs-api.yaml>`" rAPP Catalogue diff --git a/docs/conf.py b/docs/conf.py index 09eeb378..85721c6a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ redoc = [ { 'name': 'ECS API', 'page': 'ecs-api', - 'spec': './offeredapis/swagger/ecs-api.json', + 'spec': '../enrichment-coordinator-service/api/ecs-api.json', 'embed': True, } ] diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst index 576cf2de..5358fe3c 100644 --- a/docs/developer-guide.rst +++ b/docs/developer-guide.rst @@ -7,8 +7,8 @@ Developer Guide This document provides a quickstart for developers of the Non-RT RIC. -Policy Agent ------------- +A1 Policy Management Service +---------------------------- The Policy Management is implemented in ONAP. For documentation see `readthedocs`_ and `wiki`_. diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 1970ffad..b09dcfb5 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -14,51 +14,54 @@ This document provides the release notes for the release of the different parts :local: -Version history Policy Agent -============================ - -+------------+----------+------------------+-------------------+ -| **Date** | **Ver.** | **Author** | **Comment** | -| | | | | -+------------+----------+------------------+-------------------+ -| 2020-02-03 | 1.0.0 | Henrik Andersson | First version | -| | | | Amber Maintenance | -| | | | Release | -+------------+----------+------------------+-------------------+ -| 2020-06-18 | 2.0.0 | Henrik Andersson | Bronze Release | -| | | | | -+------------+----------+------------------+-------------------+ -| 2020-07-29 | 2.0.1 | Henrik Andersson | Bronze Maintenance| -| | | | Release | -| | | | | -+------------+----------+------------------+-------------------+ +Version history A1 Policy Management Service +============================================ + ++------------+----------+------------------+--------------------+ +| **Date** | **Ver.** | **Author** | **Comment** | +| | | | | ++------------+----------+------------------+--------------------+ +| 2020-02-03 | 1.0.0 | Henrik Andersson | First version | +| | | | Amber Maintenance | +| | | | Release | ++------------+----------+------------------+--------------------+ +| 2020-06-18 | 2.0.0 | Henrik Andersson | Bronze Release | +| | | | | ++------------+----------+------------------+--------------------+ +| 2020-07-29 | 2.0.1 | Henrik Andersson | Bronze Maintenance | +| | | | Release | +| | | | | ++------------+----------+------------------+--------------------+ +| 2020-12-03 | 2.1.0 | Henrik Andersson | Cherry Release | +| | | | | ++------------+----------+------------------+--------------------+ Summary ------- -Improved stability. +Introduction of Enrichment Service Coordinator and rAPP Catalogue. Version history SDNC A1 Controller ================================== -+------------+----------+------------------+-------------------+ -| **Date** | **Ver.** | **Author** | **Comment** | -| | | | | -+------------+----------+------------------+-------------------+ -| 2019-11-12 | 1.7.3 | Maxime Bonneau | | -| | | | | -+------------+----------+------------------+-------------------+ -| 2020-02-04 | 1.7.4 | Henrik Andersson | Amber Maintenance | -| | | | Release | -+------------+----------+------------------+-------------------+ -| 2020-06-18 | 2.0.0 | Henrik Andersson | Bronze Release | -| | | | | -+------------+----------+------------------+-------------------+ -| 2020-07-29 | 2.0.1 | Henrik Andersson | Bronze Maintenance| -| | | | Release | -| | | | | -+------------+----------+------------------+-------------------+ ++------------+----------+------------------+--------------------+ +| **Date** | **Ver.** | **Author** | **Comment** | +| | | | | ++------------+----------+------------------+--------------------+ +| 2019-11-12 | 1.7.3 | Maxime Bonneau | | +| | | | | ++------------+----------+------------------+--------------------+ +| 2020-02-04 | 1.7.4 | Henrik Andersson | Amber Maintenance | +| | | | Release | ++------------+----------+------------------+--------------------+ +| 2020-06-18 | 2.0.0 | Henrik Andersson | Bronze Release | +| | | | | ++------------+----------+------------------+--------------------+ +| 2020-07-29 | 2.0.1 | Henrik Andersson | Bronze Maintenance | +| | | | Release | +| | | | | ++------------+----------+------------------+--------------------+ Release Data @@ -139,3 +142,23 @@ Bronze Maintenance | **Purpose of the delivery** | Introduce configuration of certificates | | | | +-----------------------------+---------------------------------------------------+ + +Cherry +------ ++-----------------------------+---------------------------------------------------+ +| **Project** | Non-RT RIC | +| | | ++-----------------------------+---------------------------------------------------+ +| **Repo/commit-ID** | nonrtric/90ce16238dd6970153e1c0fbddb15e32c68c504f | +| | | ++-----------------------------+---------------------------------------------------+ +| **Release designation** | Cherry | +| | | ++-----------------------------+---------------------------------------------------+ +| **Release date** | 2020-12-03 | +| | | ++-----------------------------+---------------------------------------------------+ +| **Purpose of the delivery** | Introduction of Enrichment Service Coordinator | +| | and rAPP Catalogue | +| | | ++-----------------------------+---------------------------------------------------+ diff --git a/docs/offeredapis/swagger/ecs-api.json b/enrichment-coordinator-service/api/ecs-api.json similarity index 99% rename from docs/offeredapis/swagger/ecs-api.json rename to enrichment-coordinator-service/api/ecs-api.json index 303a9253..79ab5d35 100644 --- a/docs/offeredapis/swagger/ecs-api.json +++ b/enrichment-coordinator-service/api/ecs-api.json @@ -508,7 +508,6 @@ "tags": ["A1-EI (enrichment information)"] }} }, - "host": "localhost:34053", "definitions": { "producer_ei_job_request": { "description": "The body of the EI producer callbacks for EI job creation and deletion", diff --git a/enrichment-coordinator-service/api/ecs-api.yaml b/enrichment-coordinator-service/api/ecs-api.yaml new file mode 100644 index 00000000..ac49e5a8 --- /dev/null +++ b/enrichment-coordinator-service/api/ecs-api.yaml @@ -0,0 +1,827 @@ +openapi: 3.0.1 +info: + title: Enrichment Data service + description: This page lists all the rest apis for the service. + version: "1.0" +servers: +- url: / +tags: +- name: A1-EI (enrichment information) + description: Consumer Controller +- name: Consumer Callbacks + description: Consumer Simulator Controller +- name: Enrichment Data Producer API + description: Producer Controller +- name: Producer Callbacks + description: Producer Simulator Controller +- name: Service status + description: Status Controller +paths: + /producer_simulator/ei_job: + post: + tags: + - Producer Callbacks + summary: Callback for EI job creation + operationId: jobCreatedCallbackUsingPOST + requestBody: + description: request + content: + application/json: + schema: + $ref: '#/components/schemas/producer_ei_job_request' + required: true + responses: + 200: + description: OK + content: {} + 201: + description: Created + content: {} + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Not Found + content: {} + deprecated: false + /A1-EI/v1/eitypes/{eiTypeId}: + get: + tags: + - A1-EI (enrichment information) + summary: Individual EI type + operationId: getEiTypeUsingGET + parameters: + - name: eiTypeId + in: path + description: eiTypeId + required: true + schema: + type: string + responses: + 200: + description: EI type + content: + application/json: + schema: + $ref: '#/components/schemas/EiTypeObject' + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Enrichment Information type is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false + /consumer_simulator/eijobs/{eiJobId}/status: + post: + tags: + - Consumer Callbacks + summary: Callback for EI job status + operationId: jobStatusCallbackUsingPOST + parameters: + - name: eiJobId + in: path + description: eiJobId + required: true + schema: + type: string + requestBody: + description: status + content: + application/json: + schema: + $ref: '#/components/schemas/EiJobStatusObject' + required: true + responses: + 200: + description: OK + content: {} + 201: + description: Created + content: {} + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Not Found + content: {} + deprecated: false + /ei-producer/v1/eitypes: + get: + tags: + - Enrichment Data Producer API + summary: EI type identifiers + operationId: getEiTypeIdentifiersUsingGET_1 + responses: + 200: + description: EI type identifiers + content: + application/json: + schema: + type: array + items: + type: string + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Not Found + content: {} + deprecated: false + /A1-EI/v1/eitypes: + get: + tags: + - A1-EI (enrichment information) + summary: EI type identifiers + operationId: getEiTypeIdentifiersUsingGET + responses: + 200: + description: EI type identifiers + content: + application/json: + schema: + type: array + items: + type: string + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Not Found + content: {} + deprecated: false + /ei-producer/v1/eiproducers/{eiProducerId}/status: + get: + tags: + - Enrichment Data Producer API + summary: EI producer status + operationId: getEiProducerStatusUsingGET + parameters: + - name: eiProducerId + in: path + description: eiProducerId + required: true + schema: + type: string + responses: + 200: + description: EI jobs + content: + application/json: + schema: + $ref: '#/components/schemas/producer_status' + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Enrichment Information producer is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false + /producer_simulator/ei_job/{eiJobId}: + delete: + tags: + - Producer Callbacks + summary: Callback for EI job deletion + operationId: jobDeletedCallbackUsingDELETE + parameters: + - name: eiJobId + in: path + description: eiJobId + required: true + schema: + type: string + responses: + 200: + description: OK + content: {} + 204: + description: No Content + content: {} + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + deprecated: false + /ei-producer/v1/eiproducers: + get: + tags: + - Enrichment Data Producer API + summary: EI producer identifiers + operationId: getEiProducerIdentifiersUsingGET + responses: + 200: + description: EI producer identifiers + content: + application/json: + schema: + type: array + items: + type: string + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Not Found + content: {} + deprecated: false + /ei-producer/v1/eitypes/{eiTypeId}: + get: + tags: + - Enrichment Data Producer API + summary: Individual EI type + operationId: getEiTypeUsingGET_1 + parameters: + - name: eiTypeId + in: path + description: eiTypeId + required: true + schema: + type: string + responses: + 200: + description: EI type + content: + application/json: + schema: + $ref: '#/components/schemas/producer_ei_type_info' + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Enrichment Information type is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false + /status: + get: + tags: + - Service status + summary: Returns status and statistics of this service + operationId: getStatusUsingGET + responses: + 200: + description: Service is living + content: + application/json: + schema: + $ref: '#/components/schemas/status_info' + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Not Found + content: {} + deprecated: false + /A1-EI/v1/eijobs/{eiJobId}: + get: + tags: + - A1-EI (enrichment information) + summary: Individual EI job + operationId: getIndividualEiJobUsingGET + parameters: + - name: eiJobId + in: path + description: eiJobId + required: true + schema: + type: string + responses: + 200: + description: EI job + content: + application/json: + schema: + $ref: '#/components/schemas/EiJobObject' + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Enrichment Information job is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false + put: + tags: + - A1-EI (enrichment information) + summary: Individual EI job + operationId: putIndividualEiJobUsingPUT + parameters: + - name: eiJobId + in: path + description: eiJobId + required: true + schema: + type: string + requestBody: + description: eiJobObject + content: + application/json: + schema: + $ref: '#/components/schemas/EiJobObject' + required: true + responses: + 200: + description: Job updated + content: {} + 201: + description: Job created + content: {} + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Enrichment Information type is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false + delete: + tags: + - A1-EI (enrichment information) + summary: Individual EI job + operationId: deleteIndividualEiJobUsingDELETE + parameters: + - name: eiJobId + in: path + description: eiJobId + required: true + schema: + type: string + responses: + 200: + description: Not used + content: {} + 204: + description: Job deleted + content: {} + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Enrichment Information job is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false + /ei-producer/v1/eiproducers/{eiProducerId}: + get: + tags: + - Enrichment Data Producer API + summary: Individual EI producer + operationId: getEiProducerUsingGET + parameters: + - name: eiProducerId + in: path + description: eiProducerId + required: true + schema: + type: string + responses: + 200: + description: EI jobs + content: + application/json: + schema: + $ref: '#/components/schemas/producer_registration_info' + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Enrichment Information producer is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false + put: + tags: + - Enrichment Data Producer API + summary: Individual EI producer + operationId: putEiProducerUsingPUT + parameters: + - name: eiProducerId + in: path + description: eiProducerId + required: true + schema: + type: string + requestBody: + description: registrationInfo + content: + application/json: + schema: + $ref: '#/components/schemas/producer_registration_info' + required: true + responses: + 200: + description: Producer updated + content: {} + 201: + description: Producer created + content: {} + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Not Found + content: {} + deprecated: false + delete: + tags: + - Enrichment Data Producer API + summary: Individual EI producer + operationId: deleteEiProducerUsingDELETE + parameters: + - name: eiProducerId + in: path + description: eiProducerId + required: true + schema: + type: string + responses: + 200: + description: Not used + content: {} + 204: + description: Producer deleted + content: {} + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Producer is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false + /producer_simulator/health_check: + get: + tags: + - Producer Callbacks + summary: Producer supervision + operationId: producerSupervisionUsingGET + responses: + 200: + description: OK + content: + application/json: + schema: + type: string + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Not Found + content: {} + deprecated: false + /ei-producer/v1/eiproducers/{eiProducerId}/eijobs: + get: + tags: + - Enrichment Data Producer API + summary: EI job definitions + description: EI job definitions for one EI producer + operationId: getEiProducerJobsUsingGET + parameters: + - name: eiProducerId + in: path + description: eiProducerId + required: true + schema: + type: string + responses: + 200: + description: EI jobs + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/producer_ei_job_request' + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Enrichment Information producer is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false + /A1-EI/v1/eijobs: + get: + tags: + - A1-EI (enrichment information) + summary: EI job identifiers + description: query for EI job identifiers + operationId: getEiJobIdsUsingGET + parameters: + - name: eiTypeId + in: query + description: selects EI jobs of matching EI type + allowEmptyValue: false + schema: + type: string + - name: owner + in: query + description: selects EI jobs for one EI job owner + allowEmptyValue: false + schema: + type: string + responses: + 200: + description: EI job identifiers + content: + application/json: + schema: + type: array + items: + type: string + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Enrichment Information type is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false + /A1-EI/v1/eijobs/{eiJobId}/status: + get: + tags: + - A1-EI (enrichment information) + summary: EI job status + operationId: getEiJobStatusUsingGET + parameters: + - name: eiJobId + in: path + description: eiJobId + required: true + schema: + type: string + responses: + 200: + description: EI job status + content: + application/json: + schema: + $ref: '#/components/schemas/EiJobStatusObject' + 401: + description: Unauthorized + content: {} + 403: + description: Forbidden + content: {} + 404: + description: Enrichment Information job is not found + content: + application/json: + schema: + $ref: '#/components/schemas/ProblemDetails' + deprecated: false +components: + schemas: + producer_ei_job_request: + title: producer_ei_job_request + required: + - ei_job_identity + type: object + properties: + owner: + type: string + description: The owner of the job + ei_job_identity: + type: string + description: Idenitity of the EI job + ei_job_data: + type: object + properties: {} + description: Json for the job data + target_uri: + type: string + description: URI for the target of the EI + ei_type_identity: + type: string + description: Type idenitity for the job + description: The body of the EI producer callbacks for EI job creation and deletion + EiTypeObject: + title: EiTypeObject + type: object + description: Information for an EI type + producer_ei_type_registration_info: + title: producer_ei_type_registration_info + required: + - ei_type_identity + type: object + properties: + ei_type_identity: + type: string + description: EI type identity + ei_job_data_schema: + type: object + properties: {} + description: Json schema for the job data + description: Information for an EI type + status_info: + title: status_info + type: object + properties: + no_of_producers: + type: integer + description: Number of EI producers + format: int32 + no_of_jobs: + type: integer + description: Number of EI jobs + format: int32 + no_of_types: + type: integer + description: Number of EI types + format: int32 + status: + type: string + description: status text + Mono«ResponseEntity«object»»: + title: Mono«ResponseEntity«object»» + type: object + producer_ei_type_info: + title: producer_ei_type_info + type: object + properties: + ei_producer_ids: + type: array + description: Registered producers + items: + type: string + ei_job_data_schema: + type: object + properties: {} + description: Json schema for the job data + description: Information for an EI type + producer_registration_info: + title: producer_registration_info + required: + - ei_job_callback_url + - ei_producer_supervision_callback_url + - supported_ei_types + type: object + properties: + supported_ei_types: + type: array + description: Supported EI types + items: + $ref: '#/components/schemas/producer_ei_type_registration_info' + ei_producer_supervision_callback_url: + type: string + description: callback for producer supervision + ei_job_callback_url: + type: string + description: callback for EI job + description: Information for an EI producer + producer_status: + title: producer_status + required: + - operational_state + type: object + properties: + operational_state: + type: string + description: |- + Operational state, values: + ENABLED: TBD + DISABLED: TBD. + enum: + - ENABLED + - DISABLED + description: Status for an EI Producer + ProblemDetails: + title: ProblemDetails + type: object + properties: + detail: + type: string + description: A human-readable explanation specific to this occurrence of + the problem. + example: EI job 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: 404 + description: A problem detail to carry details in a HTTP response according + to RFC 7807 + Void: + title: Void + type: object + description: Void/empty + EiJobStatusObject: + title: EiJobStatusObject + required: + - eiJobStatus + type: object + properties: + eiJobStatus: + type: string + description: |- + values: + ENABLED: the A1-EI producer is able to deliver EI result for the EI job + DISABLED: the A1-EI producer is unable to deliver EI result for the EI job + enum: + - ENABLED + - DISABLED + description: Status for an EI job + EiJobObject: + title: EiJobObject + required: + - eiTypeId + - jobDefinition + - jobOwner + - jobResultUri + type: object + properties: + eiTypeId: + type: string + description: EI type Idenitifier of the EI job + jobResultUri: + type: string + description: The target URI of the EI data + jobOwner: + type: string + description: Identity of the owner of the job + jobStatusNotificationUri: + type: string + description: The target of EI job status notifications + jobDefinition: + type: object + properties: {} + description: EI type specific job data + description: Information for an Enrichment Information Job diff --git a/enrichment-coordinator-service/config/application.yaml b/enrichment-coordinator-service/config/application.yaml index 850dc67f..5900d63d 100644 --- a/enrichment-coordinator-service/config/application.yaml +++ b/enrichment-coordinator-service/config/application.yaml @@ -9,9 +9,11 @@ management: endpoints: web: exposure: + # Enabling of springboot actuator features. See springboot documentation. include: "loggers,logfile,health,info,metrics,threaddump,heapdump" logging: + # Configuration of logging level: ROOT: ERROR org.springframework: ERROR @@ -21,6 +23,8 @@ logging: file: name: /var/log/enrichment-coordinator-service/application.log server: + # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework. + # See springboot documentation. port : 8434 http-port: 8083 ssl: @@ -30,10 +34,16 @@ server: key-password: policy_agent key-alias: policy_agent app: - filepath: /opt/app/enrichment-coordinator-service/data/application_configuration.json webclient: + # Configuration of the trust store used for the HTTP client (outgoing requests) + # The file location and the password for the truststore is only relevant if trust-store-used == true + # Note that the same keystore as for the server is used. trust-store-used: false trust-store-password: policy_agent trust-store: /opt/app/enrichment-coordinator-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 vardata-directory: /var/enrichment-coordinator-service diff --git a/enrichment-coordinator-service/pom.xml b/enrichment-coordinator-service/pom.xml index f7d6e5e6..2a653150 100644 --- a/enrichment-coordinator-service/pom.xml +++ b/enrichment-coordinator-service/pom.xml @@ -31,7 +31,7 @@ org.o-ran-sc.nonrtric enrichment-coordinator-service - 1.0.0-SNAPSHOT + 1.1.0-SNAPSHOT The Apache Software License, Version 2.0 @@ -56,6 +56,7 @@ 3.8.0 2.12.2 1.24.3 + 3.0.11 0.30.0 1.1.11 2.1.1 @@ -280,6 +281,27 @@ + + io.swagger.codegen.v3 + swagger-codegen-maven-plugin + ${swagger-codegen-maven-plugin.version} + + + test + + generate + + + ${project.basedir}/api/ecs-api.json + openapi-yaml + ${project.basedir}/api + + ecs-api.yaml + + + + + io.fabric8 docker-maven-plugin diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/clients/AsyncRestClient.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/clients/AsyncRestClient.java index 76da6246..f0f6c4b1 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/clients/AsyncRestClient.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/clients/AsyncRestClient.java @@ -28,6 +28,7 @@ import io.netty.handler.timeout.WriteTimeoutHandler; import java.lang.invoke.MethodHandles; import java.util.concurrent.atomic.AtomicInteger; +import org.oransc.enrichment.configuration.WebClientConfig.HttpProxyConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.MediaType; @@ -42,6 +43,7 @@ import org.springframework.web.reactive.function.client.WebClientResponseExcepti import reactor.core.publisher.Mono; import reactor.netty.http.client.HttpClient; import reactor.netty.resources.ConnectionProvider; +import reactor.netty.tcp.ProxyProvider.Proxy; import reactor.netty.tcp.TcpClient; /** @@ -54,19 +56,12 @@ public class AsyncRestClient { private final String baseUrl; private static final AtomicInteger sequenceNumber = new AtomicInteger(); private final SslContext sslContext; + private final HttpProxyConfig httpProxyConfig; - /** - * Note that only http (not https) will work when this constructor is used. - * - * @param baseUrl - */ - public AsyncRestClient(String baseUrl) { - this(baseUrl, null); - } - - public AsyncRestClient(String baseUrl, SslContext sslContext) { + public AsyncRestClient(String baseUrl, @Nullable SslContext sslContext, @Nullable HttpProxyConfig httpProxyConfig) { this.baseUrl = baseUrl; this.sslContext = sslContext; + this.httpProxyConfig = httpProxyConfig; } public Mono> postForEntity(String uri, @Nullable String body) { @@ -188,7 +183,7 @@ public class AsyncRestClient { logger.debug("{} HTTP error status = '{}', body '{}'", traceTag, exception.getStatusCode(), exception.getResponseBodyAsString()); } else { - logger.debug("{} HTTP error", traceTag, t); + logger.debug("{} HTTP error {}", traceTag, t.getMessage()); } } @@ -200,27 +195,31 @@ public class AsyncRestClient { } } - private TcpClient createTcpClientSecure(SslContext sslContext) { - return TcpClient.create(ConnectionProvider.newConnection()) // - .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10_000) // - .secure(c -> c.sslContext(sslContext)) // - .doOnConnected(connection -> { - connection.addHandlerLast(new ReadTimeoutHandler(30)); - connection.addHandlerLast(new WriteTimeoutHandler(30)); - }); + private boolean isHttpProxyConfigured() { + return httpProxyConfig != null && httpProxyConfig.httpProxyPort() > 0 + && !httpProxyConfig.httpProxyHost().isEmpty(); } - private TcpClient createTcpClientInsecure() { - return TcpClient.create(ConnectionProvider.newConnection()) // + private TcpClient createTcpClient() { + TcpClient client = TcpClient.create(ConnectionProvider.newConnection()) // .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10_000) // .doOnConnected(connection -> { connection.addHandlerLast(new ReadTimeoutHandler(30)); connection.addHandlerLast(new WriteTimeoutHandler(30)); }); + if (this.sslContext != null) { + client = client.secure(c -> c.sslContext(sslContext)); + } + if (isHttpProxyConfigured()) { + client = client.proxy(proxy -> proxy.type(Proxy.HTTP).host(httpProxyConfig.httpProxyHost()) + .port(httpProxyConfig.httpProxyPort())); + } + return client; } private WebClient createWebClient(String baseUrl, TcpClient tcpClient) { HttpClient httpClient = HttpClient.from(tcpClient); + ReactorClientHttpConnector connector = new ReactorClientHttpConnector(httpClient); ExchangeStrategies exchangeStrategies = ExchangeStrategies.builder() // .codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(-1)) // @@ -235,13 +234,8 @@ public class AsyncRestClient { private Mono getWebClient() { if (this.webClient == null) { try { - if (this.sslContext != null) { - TcpClient tcpClient = createTcpClientSecure(sslContext); - this.webClient = createWebClient(this.baseUrl, tcpClient); - } else { - TcpClient tcpClient = createTcpClientInsecure(); - this.webClient = createWebClient(this.baseUrl, tcpClient); - } + TcpClient tcpClient = createTcpClient(); + this.webClient = createWebClient(this.baseUrl, tcpClient); } catch (Exception e) { logger.error("Could not create WebClient {}", e.getMessage()); return Mono.error(e); diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/clients/AsyncRestClientFactory.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/clients/AsyncRestClientFactory.java index 07f23e9e..4865df56 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/clients/AsyncRestClientFactory.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/clients/AsyncRestClientFactory.java @@ -42,6 +42,7 @@ import java.util.stream.Collectors; import javax.net.ssl.KeyManagerFactory; import org.oransc.enrichment.configuration.WebClientConfig; +import org.oransc.enrichment.configuration.WebClientConfig.HttpProxyConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.util.ResourceUtils; @@ -53,25 +54,38 @@ public class AsyncRestClientFactory { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final SslContextFactory sslContextFactory; + private final HttpProxyConfig httpProxyConfig; public AsyncRestClientFactory(WebClientConfig clientConfig) { if (clientConfig != null) { this.sslContextFactory = new CachingSslContextFactory(clientConfig); + this.httpProxyConfig = clientConfig.httpProxyConfig(); } else { + logger.warn("No configuration for web client defined, HTTPS will not work"); this.sslContextFactory = null; + this.httpProxyConfig = null; } } - public AsyncRestClient createRestClient(String baseUrl) { + public AsyncRestClient createRestClientNoHttpProxy(String baseUrl) { + return createRestClient(baseUrl, false); + } + + public AsyncRestClient createRestClientUseHttpProxy(String baseUrl) { + return createRestClient(baseUrl, true); + } + + private AsyncRestClient createRestClient(String baseUrl, boolean useHttpProxy) { if (this.sslContextFactory != null) { try { - return new AsyncRestClient(baseUrl, this.sslContextFactory.createSslContext()); + return new AsyncRestClient(baseUrl, this.sslContextFactory.createSslContext(), + useHttpProxy ? httpProxyConfig : null); } catch (Exception e) { String exceptionString = e.toString(); logger.error("Could not init SSL context, reason: {}", exceptionString); } } - return new AsyncRestClient(baseUrl); + return new AsyncRestClient(baseUrl, null, httpProxyConfig); } private class SslContextFactory { @@ -175,5 +189,4 @@ public class AsyncRestClientFactory { } } - } diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/configuration/ApplicationConfig.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/configuration/ApplicationConfig.java index 89374649..fce9e224 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/configuration/ApplicationConfig.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/configuration/ApplicationConfig.java @@ -20,10 +20,9 @@ package org.oransc.enrichment.configuration; -import javax.validation.constraints.NotEmpty; - import lombok.Getter; +import org.oransc.enrichment.configuration.WebClientConfig.HttpProxyConfig; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -31,10 +30,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties @EnableConfigurationProperties @ConfigurationProperties() public class ApplicationConfig { - @NotEmpty - @Getter - @Value("${app.filepath}") - private String localConfigurationFilePath; @Getter @Value("${app.vardata-directory}") @@ -61,7 +56,17 @@ public class ApplicationConfig { @Value("${app.webclient.trust-store}") private String sslTrustStore = ""; + @Value("${app.webclient.http.proxy-host:\"\"}") + private String httpProxyHost = ""; + + @Value("${app.webclient.http.proxy-port:0}") + private int httpProxyPort = 0; + public WebClientConfig getWebClientConfig() { + HttpProxyConfig httpProxyConfig = ImmutableHttpProxyConfig.builder() // + .httpProxyHost(this.httpProxyHost) // + .httpProxyPort(this.httpProxyPort) // + .build(); return ImmutableWebClientConfig.builder() // .keyStoreType(this.sslKeyStoreType) // .keyStorePassword(this.sslKeyStorePassword) // @@ -70,6 +75,7 @@ public class ApplicationConfig { .isTrustStoreUsed(this.sslTrustStoreUsed) // .trustStore(this.sslTrustStore) // .trustStorePassword(this.sslTrustStorePassword) // + .httpProxyConfig(httpProxyConfig) // .build(); } diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/configuration/WebClientConfig.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/configuration/WebClientConfig.java index 61d0f5ad..0b682486 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/configuration/WebClientConfig.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/configuration/WebClientConfig.java @@ -42,4 +42,13 @@ public interface WebClientConfig { public String trustStore(); + @Value.Immutable + public interface HttpProxyConfig { + public String httpProxyHost(); + + public int httpProxyPort(); + } + + public HttpProxyConfig httpProxyConfig(); + } diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/consumer/ConsumerCallbacks.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/consumer/ConsumerCallbacks.java index 9087355e..c222cfab 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/consumer/ConsumerCallbacks.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/consumer/ConsumerCallbacks.java @@ -55,7 +55,7 @@ public class ConsumerCallbacks { @Autowired public ConsumerCallbacks(ApplicationConfig config, EiTypes eiTypes, EiJobs eiJobs) { AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(config.getWebClientConfig()); - this.restClient = restClientFactory.createRestClient(""); + this.restClient = restClientFactory.createRestClientUseHttpProxy(""); this.eiTypes = eiTypes; this.eiJobs = eiJobs; } diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/producer/ProducerCallbacks.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/producer/ProducerCallbacks.java index dc732e12..00d9c149 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/producer/ProducerCallbacks.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/producer/ProducerCallbacks.java @@ -60,7 +60,7 @@ public class ProducerCallbacks { @Autowired public ProducerCallbacks(ApplicationConfig config, EiTypes eiTypes) { AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(config.getWebClientConfig()); - this.restClient = restClientFactory.createRestClient(""); + this.restClient = restClientFactory.createRestClientNoHttpProxy(""); this.eiTypes = eiTypes; } diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/tasks/ProducerSupervision.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/tasks/ProducerSupervision.java index e2421665..b4c21d46 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/tasks/ProducerSupervision.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/tasks/ProducerSupervision.java @@ -57,7 +57,7 @@ public class ProducerSupervision { public ProducerSupervision(ApplicationConfig applicationConfig, EiProducers eiProducers, EiJobs eiJobs, EiTypes eiTypes, ConsumerCallbacks consumerCallbacks) { AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(applicationConfig.getWebClientConfig()); - this.restClient = restClientFactory.createRestClient(""); + this.restClient = restClientFactory.createRestClientNoHttpProxy(""); this.eiJobs = eiJobs; this.eiProducers = eiProducers; this.eiTypes = eiTypes; diff --git a/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java b/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java index c5ee82aa..b62a9653 100644 --- a/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java +++ b/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/ApplicationTest.java @@ -45,8 +45,10 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.oransc.enrichment.clients.AsyncRestClient; import org.oransc.enrichment.clients.AsyncRestClientFactory; import org.oransc.enrichment.configuration.ApplicationConfig; +import org.oransc.enrichment.configuration.ImmutableHttpProxyConfig; import org.oransc.enrichment.configuration.ImmutableWebClientConfig; import org.oransc.enrichment.configuration.WebClientConfig; +import org.oransc.enrichment.configuration.WebClientConfig.HttpProxyConfig; import org.oransc.enrichment.controller.ConsumerSimulatorController; import org.oransc.enrichment.controller.ProducerSimulatorController; import org.oransc.enrichment.controllers.consumer.ConsumerConsts; @@ -161,8 +163,10 @@ class ApplicationTest { ResponseEntity resp = restClient().getForEntity(url).block(); assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK); - String indented = (new JSONObject(resp.getBody())).toString(4); - try (PrintStream out = new PrintStream(new FileOutputStream("../docs/offeredapis/swagger/ecs-api.json"))) { + JSONObject jsonObj = new JSONObject(resp.getBody()); + jsonObj.remove("host"); + String indented = jsonObj.toString(4); + try (PrintStream out = new PrintStream(new FileOutputStream("api/ecs-api.json"))) { out.print(indented); } } @@ -711,6 +715,10 @@ class ApplicationTest { private AsyncRestClient restClient(boolean useTrustValidation) { WebClientConfig config = this.applicationConfig.getWebClientConfig(); + HttpProxyConfig httpProxyConfig = ImmutableHttpProxyConfig.builder() // + .httpProxyHost("") // + .httpProxyPort(0) // + .build(); config = ImmutableWebClientConfig.builder() // .keyStoreType(config.keyStoreType()) // .keyStorePassword(config.keyStorePassword()) // @@ -719,10 +727,10 @@ class ApplicationTest { .isTrustStoreUsed(useTrustValidation) // .trustStore(config.trustStore()) // .trustStorePassword(config.trustStorePassword()) // - .build(); + .httpProxyConfig(httpProxyConfig).build(); AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(config); - return restClientFactory.createRestClient(baseUrl()); + return restClientFactory.createRestClientNoHttpProxy(baseUrl()); } private AsyncRestClient restClient() { diff --git a/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/clients/AsyncRestClientTest.java b/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/clients/AsyncRestClientTest.java index f879c7be..364203a2 100644 --- a/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/clients/AsyncRestClientTest.java +++ b/enrichment-coordinator-service/src/test/java/org/oransc/enrichment/clients/AsyncRestClientTest.java @@ -58,7 +58,7 @@ class AsyncRestClientTest { InternalLoggerFactory.setDefaultFactory(JdkLoggerFactory.INSTANCE); Loggers.useJdkLoggers(); mockWebServer = new MockWebServer(); - clientUnderTest = new AsyncRestClient(mockWebServer.url(BASE_URL).toString()); + clientUnderTest = new AsyncRestClient(mockWebServer.url(BASE_URL).toString(), null, null); } @AfterAll diff --git a/policy-agent/README.md b/policy-agent/README.md index 490a94fa..d660df91 100644 --- a/policy-agent/README.md +++ b/policy-agent/README.md @@ -34,7 +34,7 @@ volumes: The target paths in the container should not be modified. Example docker run command for mounting new files (assuming they are located in the current directory): -docker run -p 8081:8081 -p 8433:8433 --name=policy-agent-container --network=nonrtric-docker-net --volume "$PWD/new_keystore.jks:/opt/app/policy-agent/etc/cert/keystore.jks" --volume "$PWD/new_truststore.jks:/opt/app/policy-agent/etc/cert/truststore.jks" --volume "$PWD/new_application.yaml:/opt/app/policy-agent/config/application.yaml" o-ran-sc/nonrtric-policy-agent:2.1.0-SNAPSHOT +docker run -p 8081:8081 -p 8433:8433 --name=policy-agent-container --network=nonrtric-docker-net --volume "$PWD/new_keystore.jks:/opt/app/policy-agent/etc/cert/keystore.jks" --volume "$PWD/new_truststore.jks:/opt/app/policy-agent/etc/cert/truststore.jks" --volume "$PWD/new_application.yaml:/opt/app/policy-agent/config/application.yaml" o-ran-sc/nonrtric-policy-agent:2.2.0-SNAPSHOT To Run Policy Agent in Local: diff --git a/policy-agent/pom.xml b/policy-agent/pom.xml index 41df80ef..d18c9f75 100644 --- a/policy-agent/pom.xml +++ b/policy-agent/pom.xml @@ -31,7 +31,7 @@ org.o-ran-sc.nonrtric policy-agent - 2.1.0-SNAPSHOT + 2.2.0-SNAPSHOT The Apache Software License, Version 2.0 diff --git a/pom.xml b/pom.xml index 92d50a61..d8717090 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.o-ran-sc nonrtric - 2.1.0-SNAPSHOT + 2.2.0-SNAPSHOT pom nonrtric diff --git a/r-app-catalogue/pom.xml b/r-app-catalogue/pom.xml index 110f2d0c..a2e05656 100644 --- a/r-app-catalogue/pom.xml +++ b/r-app-catalogue/pom.xml @@ -31,7 +31,7 @@ org.o-ran-sc.nonrtric r-app-catalogue - 1.0.0-SNAPSHOT + 1.1.0-SNAPSHOT The Apache Software License, Version 2.0