From: Henrik Andersson Date: Thu, 19 Nov 2020 13:41:50 +0000 (+0000) Subject: Merge "Update documentation after move to ONAP" X-Git-Tag: 2.1.0~11 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=e8cc7ee89c17cb18c0802bd3a6afe8031217b2ab;hp=3ac4de0524650cea3d17f9ad5ff7e9cf5dffbe83;p=nonrtric.git Merge "Update documentation after move to ONAP" --- diff --git a/docs/api-docs.rst b/docs/api-docs.rst index 94169403..ed0cc79a 100644 --- a/docs/api-docs.rst +++ b/docs/api-docs.rst @@ -4,6 +4,12 @@ .. _api_docs: +.. |swagger-icon| image:: ./images/swagger.png + :width: 40px + +.. |yaml-icon| image:: ./images/yaml_logo.png + :width: 40px + ======== API-Docs @@ -11,39 +17,31 @@ API-Docs This is the API-docs of Non-RT RIC. -.. contents:: - :depth: 3 - :local: - The Non-RT RIC consists of three parts, described in the sections below: * The Policy Agent - * The SDNC A1 Controller + * The Enrichment Coordinator Service * The rAPP Catalogue Policy Agent ============ -The Policy Agent provides common functionality useful for R-Apps, for instance: - * A repository of available Near-RT RICs, their policy types and policy instances. - * An A1 connection to the Near-RT RICs. - -See :ref:`policy-agent-api` for how to use the API. +For information about the The Policy Agent that is implemented in ONAP, see `readthedocs`_ and `wiki`_. -See the README.md file in the nonrtric/policy-agent repo for info about how to use it. +.. _readthedocs: https://docs.onap.org/projects/onap-ccsdk-oran/en/latest/index.html +.. _wiki: https://wiki.onap.org/pages/viewpage.action?pageId=84644984 -API Functions -------------- -See the following document for the Policy Agent API: nonrtric/onap/oran/docs/offeredapis/swagger/pms-api.yaml +Enrichment Coordinator Service +============================== -SDNC A1 Controller -================== +See `ECS API <./ecs-api.html>`_ for how to use the API. -An ONAP SDNC Controller for the A1 interface. +.. csv-table:: + :header: "API name", "|swagger-icon|" + :widths: 10,5 -See :ref:`sdnc-a1-controller-api` for how to use the API. + "ECS API", ":download:`link <./offeredapis/swagger/ecs-api.json>`" -See the README.md file in the nonrtric/sdnc-a1-controller repo for info about how to use it. rAPP Catalogue ============== @@ -52,12 +50,6 @@ The Non RT-RIC Service Catalogue provides a way for services to register themsel See `RAC API <./rac-api.html>`_ for how to use the API. -.. |swagger-icon| image:: ./images/swagger.png - :width: 40px - -.. |yaml-icon| image:: ./images/yaml_logo.png - :width: 40px - .. csv-table:: :header: "API name", "|swagger-icon|", "|yaml-icon|" diff --git a/docs/conf.py b/docs/conf.py index a6ae7f96..09eeb378 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -8,7 +8,8 @@ linkcheck_ignore = [ 'http://localhost.*', 'http://127.0.0.1.*', 'https://gerrit.o-ran-sc.org.*', - './rac-api.html' #Generated file that doesn't exist at link check. + './rac-api.html', #Generated file that doesn't exist at link check. + './ecs-api.html' #Generated file that doesn't exist at link check. ] extensions = ['sphinxcontrib.redoc', 'sphinx.ext.intersphinx',] @@ -19,6 +20,12 @@ redoc = [ 'page': 'rac-api', 'spec': '../r-app-catalogue/api/rac-api.json', 'embed': True, + }, + { + 'name': 'ECS API', + 'page': 'ecs-api', + 'spec': './offeredapis/swagger/ecs-api.json', + 'embed': True, } ] diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst index 9aac33c2..576cf2de 100644 --- a/docs/developer-guide.rst +++ b/docs/developer-guide.rst @@ -7,123 +7,21 @@ Developer Guide This document provides a quickstart for developers of the Non-RT RIC. -SDNC A1 Controller -================== - -Prerequisites -------------- - -1. Java development kit (JDK), version 8 -2. Maven dependency-management tool, version 3.6 or later -3. Python, version 2 -4. Docker, version 19.03.1 or latest -5. Docker Compose, version 1.24.1 or latest - -Build and run -------------- -Go to the northbound directory and run this command :: - mvn clean install - -This will build the project and create artifcats in maven repo - -Go to oam/installation directory and run this command :: - mvn clean install -P docker - -This will create the docker images required for A1 controller. - -After this step check for the docker images created by the maven build with this command :: - docker images | grep a1-controller - -Go to oam/installation/src/main/yaml and run this command :: - docker-compose up -d a1-controller - -This will create the docker containers with the A1 controller image, you can check the status of the docker container using :: - docker-compose logs -f a1-controller - -The SDNC url to access the Northbound API, - http://localhost:8282/apidoc/explorer/index.html - -Credentials: admin/Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U - -Configuration of certs ----------------------- -The SDNC-A1 controller uses the default keystore and truststore that are built into the container. - -The paths and passwords for these stores are located in a properties file: - nonrtric/sdnc-a1-controller/oam/installation/src/main/properties/https-props.properties - -The default truststore includes the a1simulator cert as a trusted cert which is located here: - https://gerrit.o-ran-sc.org/r/gitweb?p=sim/a1-interface.git;a=tree;f=near-rt-ric-simulator/certificate;h=172c1e5aacd52d760e4416288dc5648a5817ce65;hb=HEAD - -The default keystore, truststore, and https-props.properties files can be overridden by mounting new files using the "volumes" field of docker-compose. Uncommment the following lines in docker-compose to do this, and provide paths to the new files: - -:: - -#volumes: -# - :/etc/ssl/certs/java/keystore.jks:ro -# - :/etc/ssl/certs/java/truststore.jks:ro -# - :/opt/onap/sdnc/data/properties/https-props.properties:ro - -The target paths in the container should not be modified. - -For example, assuming that the keystore, truststore, and https-props.properties files are located in the same directory as docker-compose: - -`volumes:` - `- ./new_keystore.jks:/etc/ssl/certs/java/keystore.jks:ro` - - `- ./new_truststore.jks:/etc/ssl/certs/java/truststore.jks:ro` - - `- ./new_https-props.properties:/opt/onap/sdnc/data/properties/https-props.properties:ro` - Policy Agent -============ - -The O-RAN Non-RT RIC Policy Agent provides a REST API for management of policices. It provides support for: - - * Supervision of clients (R-APPs) to eliminate stray policies in case of failure - * Consistency monitoring of the SMO view of policies and the actual situation in the RICs - * Consistency monitoring of RIC capabilities (policy types) - * Policy configuration. This includes: - - * One REST API towards all RICs in the network - * Query functions that can find all policies in a RIC, all policies owned by a service (R-APP), all policies of a type etc. - * Maps O1 resources (ManagedElement) as defined in O1 to the controlling RIC. - -| The Policy Agent can be accessed over the REST API or through the DMaaP Interface. The REST API is documented in the -| *nonrtric/onap/oran/docs/offeredapis/swagger/pms-api.yaml* file. Please refer to the README file of Policy Agent to know more about the API's. +------------ -Configuration of certs ----------------------- -The Policy Agent uses the default keystore and truststore that are built into the container. The paths and passwords for these stores are located in a yaml file: - nonrtric/policy-agent/config/application.yaml +The Policy Management is implemented in ONAP. For documentation see `readthedocs`_ and `wiki`_. -The default truststore includes a1simulator cert as a trusted cert which is located here: - https://gerrit.o-ran-sc.org/r/gitweb?p=sim/a1-interface.git;a=tree;f=near-rt-ric-simulator/certificate;h=172c1e5aacd52d760e4416288dc5648a5817ce65;hb=HEAD +.. _readthedocs: https://docs.onap.org/projects/onap-ccsdk-oran/en/latest/index.html +.. _wiki: https://wiki.onap.org/pages/viewpage.action?pageId=84644984 -The default truststore also includes a1controller cert as a trusted cert which is located here (keystore.jks file): - https://gerrit.o-ran-sc.org/r/gitweb?p=nonrtric.git;a=tree;f=sdnc-a1-controller/oam/installation/sdnc-a1/src/main/resources;h=17fdf6cecc7a866c5ce10a35672b742a9f0c4acf;hb=HEAD +rAPP Catalogue +-------------- -There is also Policy Agent's own cert in the default truststore for mocking purposes and unit-testing (ApplicationTest.java). - -The default keystore, truststore, and application.yaml files can be overridden by mounting new files using the "volumes" field of docker-compose or docker run command. - -Assuming that the keystore, truststore, and application.yaml files are located in the same directory as docker-compose, the volumes field should have these entries: - -`volumes:` - `- ./new_keystore.jks:/opt/app/policy-agent/etc/cert/keystore.jks:ro` - - `- ./new_truststore.jks:/opt/app/policy-agent/etc/cert/truststore.jks:ro` - - `- ./new_application.yaml:/opt/app/policy-agent/config/application.yaml:ro` - -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` +See the README.md file in the r-app-catalogue folder for how to run the component. End-to-end call -=============== +--------------- In order to make a complete end-to-end call, follow the instructions given in this `guide`_. diff --git a/docs/images/NonRtRicComponents.png b/docs/images/NonRtRicComponents.png deleted file mode 100644 index 335859bc..00000000 Binary files a/docs/images/NonRtRicComponents.png and /dev/null differ diff --git a/docs/index.rst b/docs/index.rst index 21469e74..a32323df 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,12 +9,9 @@ Non-RT RIC :maxdepth: 2 :caption: Contents: - ./api-docs.rst - ./policy-agent-api.rst - ./sdnc-a1-controller-api.rst - ./developer-guide.rst - ./installation-guide.rst ./overview.rst + ./developer-guide.rst + ./api-docs.rst ./use-cases.rst ./release-notes.rst diff --git a/docs/installation-guide.rst b/docs/installation-guide.rst deleted file mode 100644 index 1bcc3c42..00000000 --- a/docs/installation-guide.rst +++ /dev/null @@ -1,71 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 -.. Copyright (C) 2020 Nordix - -Installation Guide -================== - -.. contents:: - :depth: 3 - :local: - -Abstract --------- - -This document describes how to install the Non-RT RIC SDNC A1 Controller, its dependencies and required system resources. - -This work is in progress. Please visit :ref:`api_docs` for more information about the SDNC A1 Controller and the Policy Agent. - -.. _api-docs page: ./api-docs.html - -Installation ------------- - -Download the SDNC repo: - - git clone "https://gerrit.o-ran-sc.org/r/nonrtric" - -The SDNC A1 Controller could be found in this repo. - -Build SDNC project: - - Enter into the sdnc-a1-controller project, northbound and oam project will located there. - - cd sdnc-a1-controller - - Build northbound project with command: - - mvn clean install -Dmaven.test.skip=true - - Build oam project with command: - - mvn clean install -Dmaven.test.skip=true -P docker - - Enter into this directory: - - cd nonrtric/sdnc-a1-controller/oam/installation/src/main/yaml - - and run the command: - - MTU=1500 docker-compose up a1-controller - -Version history ---------------- - -+--------------------+--------------------+--------------------+--------------------+ -| **Date** | **Ver.** | **Author** | **Comment** | -| | | | | -+--------------------+--------------------+--------------------+--------------------+ -| 2019-11-12 | 0.1.0 | Maxime Bonneau | First draft | -| | | | | -+--------------------+--------------------+--------------------+--------------------+ -| 2020-03-24 | 0.1.1 | Maxime Bonneau | Second draft | -| | | | | -+--------------------+--------------------+--------------------+--------------------+ -| | 1.0 | | | -| | | | | -| | | | | -+--------------------+--------------------+--------------------+--------------------+ - - - diff --git a/enrichment-coordinator-service/docs/api.json b/docs/offeredapis/swagger/ecs-api.json similarity index 99% rename from enrichment-coordinator-service/docs/api.json rename to docs/offeredapis/swagger/ecs-api.json index a8df3c7c..740be9b1 100644 --- a/enrichment-coordinator-service/docs/api.json +++ b/docs/offeredapis/swagger/ecs-api.json @@ -508,7 +508,7 @@ "tags": ["A1-EI (enrichment information)"] }} }, - "host": "localhost:41549", + "host": "localhost:38411", "definitions": { "producer_ei_job_request": { "description": "The body of the EI producer callbacks for EI job creation and deletion", diff --git a/docs/overview.rst b/docs/overview.rst index 2c51dbae..7f4d5829 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -3,7 +3,7 @@ .. Copyright (C) 2020 Nordix Requirements for the Non-RT RIC project -========================================== +======================================= Find detailed description of what Non-RT RIC is on this `page`_. @@ -30,59 +30,3 @@ Moreover, there are functional requirements regarding the A1 interface: #. A1 interface shall support communication of enrichment information from Non-RT RIC to Near-RT RIC. #. A1 interface shall support feedback from Near-RT RIC for monitoring AI/ML model performance. #. A1 interface shall support the policy/intents feedback from Near-RT RIC to Non-RT RIC. - -A1 policy procedure -------------------- - -As for A-release, the methods are as follows: - -+---------------------+--------------------------+--------------------------+ -| A1 policy procedure | Single policy method | Multiple policies method | -+---------------------+--------------------------+--------------------------+ -| Create policy | PUT | | -+---------------------+--------------------------+--------------------------+ -| Query policy | GET | GET (sequence of \*) | -+---------------------+--------------------------+--------------------------+ -| Update policy | PUT | | -+---------------------+--------------------------+--------------------------+ -| Delete policy | DELETE | | -+---------------------+--------------------------+--------------------------+ -| Notify policy | POST | POST | -+---------------------+--------------------------+--------------------------+ - -Policy Agent Overview -======================= - -The Policy Agent maintains a transient repository of the following items to support R-Apps: - - * All Near-RT RICs in the network. This information is configured using the ONAP CDS database (which is using the Cloudify Consul database). - * All Policy types for all Near-RT RICs - * All configured Policy instances in the network - -It provides an NBI for the R-Apps (and for the Control Panel) for policy management. This is a REST API. -As an option, policy management can also be done via asynchronous messages through ONAP/Dmaap. -The NBI provides support for an R-APP to locate the correct Near-RT RIC based on identifiers as defined in O1. - -The agent monitors all Near-RT RICs and recovers from data inconsistencies, which may happen when (for instance) an Near-RT RIC restarts. - -The R-Apps can be monitored so that their Policies can be automatically removed when an R-App is stopped/removed. - -On its southbound side the agent can connect to a number of different A1 providers: - - * Directly to the Non-RT RIC: - - - OSC API, which is influenced by the A1 standard - - The Non-RT RIC simulator, which supports the A1 standard with a number of not yet CRs included. - * To an ONAP style controller. - -Amber release Policy Agent architecture ------------------------------------------ - -.. image:: ./images/NonRtRicComponents.png - :scale: 50 % - -Non-RT RIC components: - - #. Policy Agent - #. SDNC A1 Controller - diff --git a/docs/policy-agent-api.rst b/docs/policy-agent-api.rst deleted file mode 100644 index 4b6b870c..00000000 --- a/docs/policy-agent-api.rst +++ /dev/null @@ -1,1323 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 -.. Copyright (C) 2020 Nordix - -.. |nbsp| unicode:: 0xA0 - :trim: - -.. |nbh| unicode:: 0x2011 - :trim: - -.. _policy-agent-api: - -################################ -A1 Policy Management Service API -################################ - - -******************************************* -A1 Policy Management Service - Introduction -******************************************* - -The A1 Policy Management Service ("Policy Agent") is an SMO/NONRTRIC service above the NONRTRIC A1 Adapter/Controller -that provides: - -* Unified REST & DMAAP APIs for managing A1 Policies in all Near |nbh| RT |nbsp| RICs -* Synchronized view of registered "services" (e.g. R-APP, GUI, etc) -* Synchronized view of policy instances for each "service" -* Synchronized view of policy instances in all Near |nbh| RT |nbsp| RICs -* Synchronized view of policy types in all Near |nbh| RT |nbsp| RICs -* Policy Query API (e.g. per Near |nbh| RT |nbsp| RIC, per "service", per policy type) -* An initial interface for unified Near |nbh| RT |nbsp| RIC ID to Near |nbh| RT |nbsp| RIC address mapping. - (Note: may also later act as adapter to A&AI, CMDBs etc. to "find" Near |nbh| RT |nbsp| RICs - TBC) -* An Initial "O1 ManagedElement" mapping database & interface to find appropriate Near |nbh| RT |nbsp| RIC for RAN elements. - (Note: may also later act as adapter to A&AI, RuntimeDB, other CMDBs etc. - TBC) -* Monitors all Near |nbh| RT |nbsp| RICs and recovers from inconsistencies (Note: e.g. Near |nbh| RT |nbsp| RIC restarts) -* Support for different Southbound connectors on a per Near |nbh| RT |nbsp| RIC basis. (Note: e.g. different A1 - versions, different Near |nbh| RT |nbsp| RIC versions, different A1 adapters, different or proprietary A1 - controllers/EMSs) - -*************************************** -A1 Policy Management Service - REST NBI -*************************************** - -This is the north bound API of the A1 Policy Management Service ("Policy Agent"). This API allows *services* to interact -with the Policy Agent using REST. - -By registering with the Policy Agent, the Policy Agent takes responsibility for synchronizing the policies created by -the service in the Near |nbh| RT |nbsp| RICs. This means that if a Near |nbh| RT |nbsp| RIC restarts, the Policy Agent -will try to recreate all the policies residing in the Near |nbh| RT |nbsp| RIC once it is started again. If this is not -possible, it will remove all policies belonging to the Near |nbh| RT |nbsp| RIC. - -The Policy Agent also keeps an updated view of the policy types available, and which Near |nbh| RT |nbsp| RICs that -support which types. Also, the Policy Agent can tell if a Managed Element is managed by a certain -Near |nbh| RT |nbsp| RIC. - -The Policy Agent NBI has five distinct parts, described in the sections below: - -* Service Management -* Policy Types -* Policy Management -* Near-RT RIC Repository -* Health Check - -****************** -Service Management -****************** - -A service can register itself in the Policy Agent. - -By providing a callback URL the service can get notifications from the Policy Agent. - -A service can also register a "*Keep Alive Interval*", in seconds. By doing this the service promises to call the -Policy Agent's "*Keep Alive*" method, or else create or delete policies, more often than the "*Keep Alive Interval*" -measured in seconds. If the service, for some reason, is not able to do this, the Policy Agent will consider that the -service has died or vanished and will then delete all its policies, both in the internal repository and in the -Near |nbh| RT |nbsp| RICs where they were earlier created. **Note!** |nbsp| If the service does not provide a value for -"*Keep Alive Interval*", then the service maintains full responsibility to delete all of its policies when they are no -longer needed. - -/service -~~~~~~~~ - -PUT -+++ - -Register a service. - -Definition -"""""""""" - -**URL path:** - -/service - -**Parameters:** - -None. - -**Body:** (*Required*) - -A JSON object (ServiceRegistrationInfo): :: - - { - "callbackUrl": "string", (An empty string means the service will never get any callbacks.) - "keepAliveIntervalSeconds": 0, (0 means the service will always be considered alive.) - "serviceName": "string" (Required, must be unique.) - } - -**Responses:** - -200: - -Service updated. - -201: - -Service created. - -400: - -The ServiceRegistrationInfo is not accepted. - -Examples -"""""""" - -**Call**: :: - - curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d '{ - "callbackUrl": "URL", - "keepAliveIntervalSeconds": 0, - "serviceName": "existing" - }' - -**Result**: - -201: :: - - OK - -**Call**: :: - - curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d "{}" - -**Result**: - -400: :: - - Missing mandatory parameter 'serviceName' - -/services -~~~~~~~~~ - -GET -+++ - -Query service information. - -Definition -"""""""""" - -**URL path:** - -/services?name= - -**Parameters:** - -name: (*Optional*) - -The name of the service. - -**Responses:** - -200: - -Array of JSON objects (ServiceStatus). :: - - { - "callbackUrl": "string", (Callback URL) - "keepAliveIntervalSeconds": 0, (Policy keep alive interval) - "serviceName": "string", (Identity of the service) - "timeSinceLastActivitySeconds": 0 (Time since last invocation by the service) - } - -404: - -Service is not found. - -Examples -"""""""" - -**Call**: :: - - curl -X GET "http://localhost:8081/services?name=existing" - -**Result**: - -200: :: - - [ - { - "serviceName":"existing", - "keepAliveIntervalSeconds":0, - "timeSinceLastActivitySeconds":7224, - "callbackUrl":"URL" - } - ] - -**Call**: :: - - curl -X GET "http://localhost:8081/services?name=nonexistent" - -Result: - -404: :: - - Service not found - -DELETE -++++++ - -Delete a service. - -Definition -"""""""""" - -**URL path:** - -/services?name= - -**Parameters:** - -name: (*Required*) - -The name of the service. - -**Responses:** - -204: - OK - -404: - Service not found. - -Examples -"""""""" - -**Call**: :: - - curl -X DELETE "http://localhost:8081/services?name=existing" - -**Result**: - -204: :: - - OK - -**Call**: :: - - curl -X DELETE "http://localhost:8081/services?name=nonexistent" - -Result: - -404: :: - - Could not find service: nonexistent - -/services/keepalive -~~~~~~~~~~~~~~~~~~~ - -PUT -+++ - -Heart beat from a service. - -Definition -"""""""""" - -**URL path:** - -/services/keepalive?name= - -**Parameters:** - -name: (*Required*) - -The name of the service. - -**Responses:** - -200: - -OK - -404: - -Service is not found. - -Examples -"""""""" - -**Call**: :: - - curl -X PUT "http://localhost:8081/services/keepalive?name=existing" - -**Result**: - -200: :: - - OK - -**Call**: :: - - curl -X PUT "http://localhost:8081/services/keepalive?name=nonexistent" - -**Result**: - -404: :: - - Could not find service: nonexistent - -.. _policy-management: - -************ -Policy Types -************ - -Policies are based on types. The set of available policy types is determined by the set of policy types supported by -Near |nbh| RT |nbsp| RICs. At startup, the Policy Agent queries all Near |nbh| RT |nbsp| RICs for their supported types -and stores them in its internal repository. It then checks this at regular intervals to keep the repository of types up -to date. Policy types cannot be created, updated or deleted using this interface since this must be done via the -Near |nbh| RT |nbsp| RICs. - -A policy type defines a name and a JSON schema that constrains the content of a policy of that type. - -/policy_types -~~~~~~~~~~~~~ - -GET -+++ - -Query policy type names. - -Definition -"""""""""" - -**URL path:** - -/policy_types?ric= - -**Parameters:** - -ric: (*Optional*) - -The name of the Near |nbh| RT |nbsp| RIC to get types for. - -**Responses:** - -200: - - Array of policy type names. - -404: - - Near |nbh| RT |nbsp| RIC is not found. - -Examples -"""""""" - -**Call**: :: - - curl -X GET "http://localhost:8081/policy_types" - -**Result**: - -200: :: - - [ - "STD_PolicyModelUnconstrained_0.2.0", - "Example_QoETarget_1.0.0", - "ERIC_QoSNudging_0.2.0" - ] - -**Call**: :: - - curl -X GET "http://localhost:8081/policy_types?ric=nonexistent" - -**Result**: - -404: :: - - org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent - -/policy_schema -~~~~~~~~~~~~~~ - -GET -+++ - -Returns one policy type schema definition. - -Definition -"""""""""" - -**URL path:** - -/policy_schema?id= - -**Parameters:** - -id: (*Required*) - -The ID of the policy type to get the definition for. - -**Responses:** - -200: - -Policy schema as JSON schema. - -404: - -Policy type is not found. - -Examples -"""""""" - -**Call**: :: - - curl -X GET "http://localhost:8081/policy_schema?id=STD_PolicyModelUnconstrained_0.2.0" - -**Result**: - -200: :: - - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "STD_PolicyModelUnconstrained_0.2.0", - "description": "Standard model of a policy with unconstrained scope id combinations", - "type": "object", - "properties": { - "scope": { - "type": "object", - "properties": { - "ueId": {"type": "string"}, - "groupId": {"type": "string"} - }, - "minProperties": 1, - "additionalProperties": false - }, - "qosObjectives": { - "type": "object", - "properties": { - "gfbr": {"type": "number"}, - "mfbr": {"type": "number"} - }, - "additionalProperties": false - }, - "resources": { - "type": "array", - "items": { - "type": "object", - "properties": { - "cellIdList": { - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "type": "string" - } - }, - "additionalProperties": false, - "required": ["cellIdList"] - } - } - }, - "minProperties": 1, - "additionalProperties": false, - "required": ["scope"] - } - -**Call**: :: - - curl -X GET "http://localhost:8081/policy_schema?id=nonexistent" - -**Result**: - -404: :: - - org.oransc.policyagent.exceptions.ServiceException: Could not find type: nonexistent - -/policy_schemas -~~~~~~~~~~~~~~~ - -GET -+++ - -Returns policy type schema definitions. - -Definition -"""""""""" - -**URL path:** - -/policy_schemas?ric= - -**Parameters:** - -ric: (*Optional*) - -The name of the Near |nbh| RT |nbsp| RIC to get the definitions for. - -**Responses:** - -200: - -An array of policy schemas as JSON schemas. - -404: - -Near |nbh| RT |nbsp| RIC is not found. - -Examples -"""""""" - -**Call**: :: - - curl -X GET "http://localhost:8081/policy_schemas" - -**Result**: - -200: :: - - [ - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "STD_PolicyModelUnconstrained_0.2.0", - "description": "Standard model of a policy with unconstrained scope id combinations", - "type": "object", - "properties": { - "scope": { - "type": "object", - . - . - . - } - "additionalProperties": false, - "required": ["scope"] - }, - . - . - . - { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Example_QoETarget_1.0.0", - "description": "Example QoE Target policy type", - "type": "object", - "properties": { - "scope": { - "type": "object", - . - . - . - } - "additionalProperties": false, - "required": ["scope"] - } - } - } - ] - -**Call**: :: - - curl -X GET "http://localhost:8081/policy_schemas?ric=nonexistent" - -**Result**: - -404: :: - - org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent - -***************** -Policy Management -***************** - -Policies can be queried, created, updated, and deleted. A policy is always created in a specific -Near |nbh| RT |nbsp| RIC. - -A policy is defined by its policy type schema. - -When a policy is created, the Policy Agent stores information about it in its internal repository. At regular intervals, -it then checks with all Near |nbh| RT |nbsp| RICs that this repository is synchronized. If, for some reason, there is an -inconsistency, the Policy Agent will start a synchronization job and try to inconsistency, the Policy Agent will start a -synchronization job and try to reset the Near |nbh| RT |nbsp| RIC to its last-known-good status. If this fails, the -Policy Agent will clear all policies for the specific Near |nbh| RT |nbsp| RIC in the internal repository and set its -state to *UNKNOWN*. This means that no interaction with the Near |nbh| RT |nbsp| RIC is possible until the Policy Agent -has been able to contact it again and re-synchronize its state in the repository. - -Once a service has created a policy, it is the service's responsibility to maintain its life cycle. When a Near |nbh| RT -|nbsp| RIC has been restarted, the Policy Agent will try to recreate policies in the Near |nbh| RT |nbsp| RIC according -to the policies maintained in its local repository. -This means that the service must delete any policies it has created. -A policy may be created as a "transient policy", whereby if this policy "disappears" at any stage it will not be -re-synchronized to the Near |nbh| RT |nbsp| RIC. -For example, this is useful if the policy should not survive a restart of the Near |nbh| RT |nbsp| RIC. -A non-transient policy will continue to be maintained in the Near |nbh| RT |nbsp| RIC until it is explicitly deleted -(or the service that created it fails to update its Keep Alive status). - -There are some exceptions where policy instances are not re-synchronized after a Near |nbh| RT |nbsp| RIC restart or -when some inconsistency is identified: - -- The service has registered a "*Keep Alive Interval*", but the service then fails to update its Keep Alive status. -- The Policy Agent completely fails to synchronize with a Near |nbh| RT |nbsp| RIC, as described above. -- Policies that are marked as transient policies. - -/policies -~~~~~~~~~ - -GET -+++ - -Query policies. - -Definition -"""""""""" - -**URL path:** - -/policies?ric=&service=&type= - -**Parameters:** - -ric: (*Optional*) - -The name of the Near |nbh| RT |nbsp| RIC to get policies for. - -service: (*Optional*) - -The name of the service to get policies for. - -type: (*Optional*) - -The name of the policy type to get policies for. - -**Responses:** - -200: - -Array of JSON objects (PolicyInfo). :: - - { - "id": "string", (Identity of the policy) - "json": "object", (The configuration of the policy) - "lastModified": "string", (Timestamp, last modification time) - "ric": "string", (Identity of the target Near |nbh| RT |nbsp| RIC) - "service": "string", (The name of the service owning the policy) - "type": "string" (Name of the policy type) - } - -404: - Near |nbh| RT |nbsp| RIC or policy type not found. - -Examples -"""""""" - -**Call**: :: - - curl -X GET "http://localhost:8081/policies?ric=existing" - -**Result**: - -200: :: - - [ - { - "id": "Policy 1", - "json": { - "scope": { - "ueId": "UE 1", - "groupId": "Group 1" - }, - "qosObjectives": { - "gfbr": 1, - "mfbr": 2 - }, - "cellId": "Cell 1" - }, - "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT", - "ric": "existing", - "service": "Service 1", - "type": "STD_PolicyModelUnconstrained_0.2.0" - }, - { - "id": "Policy 2", - "json": { - . - . - . - }, - "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT", - "ric": "existing", - "service": "Service 2", - "type": "Example_QoETarget_1.0.0" - } - ] - -**Call**: :: - - curl -X GET "http://localhost:8081/policies?type=nonexistent" - -**Result**: - -404: :: - - Policy type not found - -/policy -~~~~~~~ - -GET -+++ - -Returns a policy configuration. - -Definition -"""""""""" - -**URL path:** - -/policy?id= - -**Parameters:** - -id: (*Required*) - -The ID of the policy instance. - -**Responses:** - -200: - -JSON object containing policy information. :: - - { - "id": "string", (ID of policy) - "json": "object", (JSON with policy data speified by the type) - "ownerServiceName": "string", (Name of the service that created the policy) - "ric": "string", (Name of the Near |nbh| RT |nbsp| RIC where the policy resides) - "type": "string", (Name of the policy type of the policy) - "lastModified" (Timestamp, last modification time) - } - -404: - -Policy is not found. - -Examples -"""""""" - -**Call**: :: - - curl -X GET "http://localhost:8081/policy?id=Policy 1" - -**Result**: - -200: :: - - { - "id": "Policy 1", - "json": { - "scope": { - "ueId": "UE1 ", - "cellId": "Cell 1" - }, - "qosObjectives": { - "gfbr": 319.5, - "mfbr": 782.75, - "priorityLevel": 268.5, - "pdb": 44.0 - }, - "qoeObjectives": { - "qoeScore": 329.0, - "initialBuffering": 27.75, - "reBuffFreq": 539.0, - "stallRatio": 343.0 - }, - "resources": [] - }, - "ownerServiceName": "Service 1", - "ric": "ric1", - "type": "STD_PolicyModelUnconstrained_0.2.0", - "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT" - } - -**Call**: :: - - curl -X GET "http://localhost:8081/policy?id=nonexistent" - -**Result**: - -404: :: - - Policy is not found - -PUT -+++ - -Create/Update a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a -"*Keep Alive Interval*" registered. - -Definition -"""""""""" - -**URL path:** - -/policy?id=&ric=&service=&type= - -**Parameters:** - -id: (*Required*) - -The ID of the policy instance. - -ric: (*Required*) - -The name of the Near |nbh| RT |nbsp| RIC where the policy will be created. - -service: (*Required*) - -The name of the service creating the policy. - -transient: (*Optional*) - -If the policy is transient or not (boolean defaulted to false). -A policy is transient if it will be forgotten when the service needs to reconnect to the Near |nbh| RT |nbsp| RIC. - -type: (*Optional*) - -The name of the policy type. - -**Body:** (*Required*) - -A JSON object containing the data specified by the type. - -**Responses:** - -200: - -Policy updated. - -201: - -Policy created. - -404: - -Near |nbh| RT |nbsp| RIC or policy type is not found. - -423: - -Near |nbh| RT |nbsp| RIC is not operational. - -Examples -"""""""" - -**Call**: :: - - curl -X PUT "http://localhost:8081/policy?id=Policy%201&ric=ric1&service=Service%201&type=STD_PolicyModelUnconstrained_0.2.0" - -H "Content-Type: application/json" - -d '{ - "scope": { - "ueId": "UE 1", - "cellId": "Cell 1" - }, - "qosObjectives": { - "gfbr": 319.5, - "mfbr": 782.75, - "priorityLevel": 268.5, - "pdb": 44.0 - }, - "qoeObjectives": { - "qoeScore": 329.0, - "initialBuffering": 27.75, - "reBuffFreq": 539.0, - "stallRatio": 343.0 - }, - "resources": [] - }' - -**Result**: - -200 - -DELETE -++++++ - -Deletes a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a -"*Keep Alive Interval*" registered. - -Definition -"""""""""" - -**URL path:** - -/policy?id= - -**Parameters:** - -id: (*Required*) - -The ID of the policy instance. - -**Responses:** - -204: - -Policy deleted. - -404: - -Policy is not found. - -423: - -Near |nbh| RT |nbsp| RIC is not operational. - -Examples -"""""""" - -**Call**: :: - - curl -X DELETE "http://localhost:8081/policy?id=Policy 1" - -**Result**: - -204 - -/policy_ids -~~~~~~~~~~~ - -GET -+++ - -Query policy type IDs. - -Definition -"""""""""" - -**URL path:** - -/policy_ids?ric=&service=&type= - -**Parameters:** - -ric: (*Optional*) - -The name of the Near |nbh| RT |nbsp| RIC to get policies for. - -service: (*Optional*) - -The name of the service to get policies for. - -type: (*Optional*) - -The name of the policy type to get policies for. - -**Responses:** - -200: - -Array of policy type names. - -404: - -RIC or policy type not found. - -Examples -"""""""" - -**Call**: :: - - curl -X GET "http://localhost:8081/policy_ids" - -**Result**: - -200: :: - - [ - "Policy 1", - "Policy 2", - "Policy 3" - ] - -**Call**: :: - - curl -X GET "http://localhost:8081/policy_ids?ric=nonexistent" - -**Result**: - -404: :: - - Ric not found - -/policy_status -~~~~~~~~~~~~~~ - -GET -+++ - -Returns the status of a policy. - -Definition -"""""""""" - -**URL path:** - -/policy_status?id= - -**Parameters:** - -id: (*Required*) - -The ID of the policy. - -**Responses:** - -200: - -JSON object with policy status. - -404: - -Policy not found. - -********************** -Near-RT RIC Repository -********************** - -The Policy Agent keeps an updated view of the Near |nbh| RT |nbsp| RICs that are available in the system. A service can -find out which Near |nbh| RT |nbsp| RIC that manages a specific element in the network or which -Near |nbh| RT |nbsp| RICs that support a specific policy type. - -/ric -~~~~ - -GET -+++ - -Returns the name of a Near |nbh| RT |nbsp| RIC managing a specific Mananged Element. - -Definition -"""""""""" - -**URL path:** - -/ric?managedElementId= - -**Parameters:** - -managedElementId: (*Required*) - -The ID of the Managed Element. - -**Responses:** - -200: - -Name of the Near |nbh| RT |nbsp| RIC managing the Managed Element. - -404: - -No Near |nbh| RT |nbsp| RIC manages the given Managed Element. - -Examples -"""""""" - -**Call**: :: - - curl -X GET "http://localhost:8081/ric?managedElementId=Node 1" - -**Result**: - -200: :: - - Ric 1 - -**Call**: :: - - curl -X GET "http://localhost:8081/ric?managedElementId=notmanaged" - -**Result**: - -404 - -/rics -~~~~~ - -GET -+++ - -Query Near |nbh| RT |nbsp| RIC information. - -Definition -"""""""""" - -**URL path:** - -/rics?policyType= - -**Parameters:** - -policyType: (*Optional*) - -The name of the policy type. - -**Responses:** - -200: - -Array of JSON objects containing Near |nbh| RT |nbsp| RIC information. :: - - [ - { - "managedElementIds": [ - "string" - ], - "policyTypes": [ - "string" - ], - "ricName": "string", - "state": "string" - } - ] - -404: - -Policy type is not found. - -Examples -"""""""" - -**Call**: :: - - curl -X GET "http://localhost:8081/rics?policyType=STD_PolicyModelUnconstrained_0.2.0" - -**Result**: - -200: :: - - [ - { - "managedElementIds": [ - "ME 1", - "ME 2" - ], - "policyTypes": [ - "STD_PolicyModelUnconstrained_0.2.0", - "Example_QoETarget_1.0.0", - "ERIC_QoSNudging_0.2.0" - ], - "ricName": "Ric 1", - "state": "AVAILABLE" - }, - . - . - . - { - "managedElementIds": [ - "ME 3" - ], - "policyTypes": [ - "STD_PolicyModelUnconstrained_0.2.0" - ], - "ricName": "Ric X", - "state": "UNAVAILABLE" - } - ] - -**Call**: :: - - curl -X GET "http://localhost:8081/rics?policyType=nonexistent" - -**Result**: - -404: :: - - Policy type not found - -************ -Health Check -************ - -The status of the Policy Agent. - -/status -~~~~~~~ - -GET -+++ - -Returns the status of the Policy Agent. - -Definition -"""""""""" - -**URL path:** - -/status - -**Parameters:** - -None. - -**Responses:** - -200: - -Service is living. - -Examples -"""""""" - -**Call**: :: - - curl -X GET "http://localhost:8081/status" - -**Result**: - -200 - -**************** -A1 through DMaaP -**************** - -The Policy Agent also provides the possibility to use DMaap to handle policies according to the A1 specification. The -Policy Agent polls the DMaaP Message Router regularly and processes any messages targeted to it. The response is then -published back to the DMaaP Message Router with the result of the call. - -Send Message -~~~~~~~~~~~~ - -The message to send is a JSON like the one below. The "*url*" is one of the URLs described under -:ref:`policy-management`. The "*target*" must always be "*policy-agent*" for the message to be processed by the Policy -Agent. The "*operation*" can be one of the following: "*GET | PUT | POST | DELETE*". :: - - { - "type": "string", - "correlationId": "string", - "target": "string", - "timestamp": "timestamp", - "apiVersion": "string", - "originatorId": "string", - "requestId": "string", - "operation": "string", - "url": "string" - } - -Example -+++++++ - -To get all policy types for a specific Near |nbh| RT |nbsp| RIC the following message should be sent to DMaaP Message -Router: :: - - { - "type":"request", - "correlationId":"c09ac7d1-de62-0016-2000-e63701125557-201", - "target":"policy-agent", - "timestamp":"2019-05-14T11:44:51.36Z", - "apiVersion":"1.0", - "originatorId":"849e6c6b420", - "requestId":"23343221", - "operation":"GET", - "url":"/policy_schemas?ric=ric_ric-simulator_1" - } - -Receive Message -~~~~~~~~~~~~~~~ - -The message the Policy Agent sends back to the DMaaP Message Router is a JSON like the one below. The "*requestId*" -"*correlationId*", and "*originatorId*" are the same as in the message sent to DMaaP MR. :: - - { - "requestId": "string", - "correlationId": "string", - "originatorId": "string", - "type": "string", - "message": "string", - "type": "string", - "timestamp": "string", - "status": "string" - } - -Example -+++++++ - -The response containing all policy types for a specific Near |nbh| RT |nbsp| RIC sent to the DMaaP Message Router from -the Policy Agent: :: - - { - \"requestId\":\"23343221\", - \"correlationId\":\"c09ac7d1-de62-0016-2000-e63701125557-201\", - \"originatorId\":\"849e6c6b420\", - \"type\":\"response\", - \"message\":\"[ - { - \\\"$schema\\\":\\\"http://json-schema.org/draft-07/schema#\\\", - \\\"description\\\":\\\"QoS policy type\\\", - \\\"title\\\":\\\"STD_QoSNudging_0.2.0\\\", - \\\"type\\\":\\\"object\\\", - \\\"properties\\\":{\\\"scope\\\":{\\\"additionalProperties\\\":true, - \\\"type\\\":\\\"object\\\", - \\\"properties\\\":{\\\"qosId\\\":{\\\"type\\\":\\\"string\\\"}, - \\\"ueId\\\":{\\\"type\\\":\\\"string\\\"}}, - \\\"required\\\":[\\\"ueId\\\", - \\\"qosId\\\"]}, - \\\"statement\\\":{\\\"additionalProperties\\\":false, - \\\"type\\\":\\\"object\\\", - \\\"properties\\\":{\\\"priorityLevel\\\":{\\\"type\\\":\\\"number\\\"}}, - \\\"required\\\":[\\\"priorityLevel\\\"]}} - } - ]\", - \"timestamp\":\"2019-05-14T11:44:51.36Z\", - \"status\":\"200 OK\" - } \ No newline at end of file diff --git a/docs/sdnc-a1-controller-api.rst b/docs/sdnc-a1-controller-api.rst deleted file mode 100644 index 5e0e908b..00000000 --- a/docs/sdnc-a1-controller-api.rst +++ /dev/null @@ -1,531 +0,0 @@ -.. This work is licensed under a Creative Commons Attribution 4.0 International License. -.. http://creativecommons.org/licenses/by/4.0 -.. Copyright (C) 2020 Nordix - -.. |nbsp| unicode:: 0xA0 - :trim: - -.. |nbh| unicode:: 0x2011 - :trim: - -.. _sdnc-a1-controller-api: - - -###################### -SDNC A1 Controller API -###################### - -The A1 of a Near |nbh| RT |nbsp| RIC can be used through the SDNC A1 Controller. - -The OSC A1 Controller supports using multiple versions of A1 API southbound. By passing the full URL for each southbound -A1 operation the problem of version-specific URL formats is avoided. - -Since different versions of A1 operations may use different data formats for data payloads for similar REST requests and -responses the data formatting requirements are flexible, so version-specific encoding/decoding is handled by the service -that requests the A1 operation. - -Get Policy Type -~~~~~~~~~~~~~~~ - -POST -++++ - -Gets a policy type. - -Definition -"""""""""" - -**URL path:** - -/restconf/operations/A1-ADAPTER-API:getA1PolicyType - -**Parameters:** - -None. - -**Body:** (*Required*) - -A JSON object. :: - - { - "input": { - "near-rt-ric-url": "" - } - } - -**Responses:** - -200: - -A JSON object where the body tag contains the JSON object of the policy type. :: - - { - "output": { - "http-status": "integer", - "body": "{ - - }" - } - } - -Examples -"""""""" - -Get a policy type from a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. The STD 1.1.3 version does not -support types, so this function is not available for that version. - -**Call**: :: - - curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1PolicyType" - -H "Content-Type: application/json" -d '{ - "input": { - "near-rt-ric-url": "http://nearRtRic-sim1:8085/a1-p/policytypes/11" - } - }' - -**Result**: - -200: :: - - { - "output": { - "http-status": 200, - "body": "{ - \"$schema\": \"http://json-schema.org/draft-07/schema#\", - \"title\": \"Example_QoETarget_1.0.0\", - \"description\": \"Example QoE Target policy type\", - \"type\": \"object\", - \"properties\": { - \"scope\": { - \"type\": \"object\", - \"properties\": { - \"ueId\": { - \"type\": \"string\" - }, - \"sliceId\": { - \"type\": \"string\" - }, - \"qosId\": { - \"type\": \"string\" - }, - \"cellId\": { - \"type\": \"string\" - } - }, - \"additionalProperties\": false, - \"required\": [ - \"ueId\", - \"sliceId\" - ] - }, - \"statement\": { - \"type\": \"object\", - \"properties\": { - \"qoeScore\": { - \"type\": \"number\" - }, - \"initialBuffering\": { - \"type\": \"number\" - }, - \"reBuffFreq\": { - \"type\": \"number\" - }, - \"stallRatio\": { - \"type\": \"number\" - } - }, - \"minProperties\": 1, - \"additionalProperties\": false - } - } - }" - } - } - -Put Policy -~~~~~~~~~~ - -POST -++++ - -Creates or updates a policy instance. - -Definition -"""""""""" - -**URL path:** - -/restconf/operations/A1-ADAPTER-API:putA1Policy - -**Parameters:** - -None. - -**Body:** (*Required*) - -A JSON object where the body tag contains the JSON object of the policy. :: - - { - "input": { - "near-rt-ric-url": "", - "body": "" - } - } - -**Responses:** - -200: - -A JSON object with the response. :: - - { - "output": { - "http-status": "integer" - } - } - -Examples -"""""""" - -**Call**: - -Create a policy in a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. :: - - curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:putA1Policy" - -H "Content-Type: application/json" -d '{ - "input": { - "near-rt-ric-url": "http://nearRtRic-sim1:8085/a1-p/policytypes/11/policies/5000", - "body": "{ - "blocking_rate":20, - "enforce":true, - "trigger_threshold":10, - "window_length":10 - }" - } - }' - -Create a policy in a Near |nbh| RT |nbsp| RIC that is using the STD 1.1.3 version. :: - - curl -X POST http://localhost:8282/restconf/operations/A1-ADAPTER-API:putA1Policy - -H Content-Type:application/json -d '{ - "input": { - "near-rt-ric-url": "http://ricsim_g2_1:8085/A1-P/v1/policies/5000", - "body": "{ - "scope": { - "ueId": "ue5000", - "qosId": "qos5000" - }, - "qosObjective": { - "priorityLevel": 5000 - } - }" - } - }' - -**Result**: - -The result is the same irrespective of which API that is used. - -200: :: - - { - "output": { - "http-status": 200 - } - } - -Get Policy -~~~~~~~~~~ - -POST -++++ - -Gets a policy instance. - -Definition -"""""""""" - -**URL path:** - -/restconf/operations/A1-ADAPTER-API:getA1Policy - -**Parameters:** - -None. - -**Body:** (*Required*) - -A JSON object. :: - - { - "input": { - "near-rt-ric-url": "" - } - } - -**Responses:** - -200: - A JSON object where the body tag contains the JSON object of the policy. :: - - { - "output": { - "http-status": "integer", - "body": "{ - - }" - } - } - -Examples -"""""""" - -**Call**: - -Get **all** policy IDs from a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. :: - - curl -X POST http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1Policy - -H Content-Type:application/json -d '{ - "input": { - "near-rt-ric-url":"http://ricsim_g1_1:8085/a1-p/policytypes/11/policies" - } - }' - -Get **all** policy IDs from a Near |nbh| RT |nbsp| RIC that is using the STD 1.1.3 version. :: - - curl -X POST http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1Policy - -H Content-Type:application/json -d '{ - "input": { - "near-rt-ric-url":"http://ricsim_g2_1:8085/A1-P/v1/policies" - } - }' - -**Result**: - -The result is the same irrespective of which API that is used. - -200: :: - - { - "output": { - "http-status":200, - "body":"[ - \"5000\", - . - . - . - \"6000\" - ]" - } - } - -**Call**: - -Get **a specific** policy from a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. :: - - curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1Policy" - -H "Content-Type: application/json" -d '{ - "input": { - "near-rt-ric-url": "http://nearRtRic-sim1:8085/a1-p/policytypes/11/policies/5000" - } - }' - -Get **a specific** policy from a Near |nbh| RT |nbsp| RIC that is using the STD 1.1.3 version. :: - - curl -X POST http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1Policy - -H Content-Type:application/json -d '{ - "input": { - "near-rt-ric-url":"http://ricsim_g2_1:8085/A1-P/v1/policies/5000" - } - }' - -**Result**: - -The result is the same irrespective of which API that is used. - -200: :: - - { - "output": { - "http-status": 200, - "body": "{ - \"blocking_rate\": 20, - \"enforce\": true, - \"trigger_threshold\": 10, - \"window_length\": 10 - }" - } - } - -Delete Policy -~~~~~~~~~~~~~ - -POST -++++ - -Deletes a policy instance. - -Definition -"""""""""" - -**URL path:** - -/restconf/operations/A1-ADAPTER-API:deleteA1Policy - -**Parameters:** - -None. - -**Body:** (*Required*) - -A JSON object. :: - - { - "input": { - "near-rt-ric-url": "" - } - } - -**Responses:** - -200: - -A JSON object with the response. :: - - { - "output": { - "http-status": "integer" - } - } - -Examples -"""""""" - -**Call**: - -Delete a policy from a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. :: - - curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:deleteA1Policy" - -H "Content-Type: application/json" -d '{ - "input": { - "near-rt-ric-url": "http://nearRtRic-sim1:8085/a1-p/policytypes/11/policies/5000" - } - }' - -Delete a policy from a Near |nbh| RT |nbsp| RIC that is using the STD 1.1.3 version. :: - - curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:deleteA1Policy" - -H "Content-Type: application/json" -d '{ - "input": { - "near-rt-ric-url": "http://ricsim_g2_1:8085/A1-P/v1/policies/5000" - } - }' - -**Result**: - -The result is the same irrespective of which API that is used. - -200: :: - - { - "output": { - "http-status": 202 - } - } - -Get Policy Status -~~~~~~~~~~~~~~~~~ - -POST -++++ - -Get the status of a policy instance. - -Definition -"""""""""" - -**URL path:** - -/restconf/operations/A1-ADAPTER-API:getA1PolicyStatus - -**Parameters:** - -None. - -**Body:** (*Required*) - -A JSON object. :: - - { - "input": { - "near-rt-ric-url": "" - } - } - -**Responses:** - -200: - -A JSON object where the body tag contains the JSON object with the policy status according to the API version used. :: - - { - "output": { - "http-status": "integer", - "body": "{ - - }" - } - } - -Examples -"""""""" - -**Call**: - -Get the policy status for a specific policy from a Near |nbh| RT |nbsp| RIC that is using the OSC 2.1.0 version. :: - - curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1PolicyStatus" - -H "Content-Type: application/json" -d '{ - "input": { - "near-rt-ric-url": "http://nearRtRic-sim1:8085/a1-p/policytypes/11/policies/5000/status" - } - }' - -**Result**: - -200: :: - - { - "output": { - "http-status": 200, - "body": "{ - \"instance_status\": \"IN EFFECT\", - \"has_been_deleted\": \"true\", - \"created_at\": \"Wed, 01 Apr 2020 07:45:45 GMT\" - }" - } - } - -**Call**: - -Get the policy status for a specific policy from a Near |nbh| RT |nbsp| RIC that is using the STD 1.1.3 version. :: - - curl -X POST "http://localhost:8282/restconf/operations/A1-ADAPTER-API:getA1PolicyStatus" - -H "Content-Type: application/json" -d '{ - "input": { - "near-rt-ric-url": "http://ricsim_g2_1:8085/A1-P/v1/policies/5000/status" - } - }' - -**Result**: - -200: :: - - { - "output": { - "http-status": 200, - "body": "{ - \"enforceStatus\": \"UNDEFINED\" - }" - } - } 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 68271f8f..c5ee82aa 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 @@ -162,7 +162,7 @@ class ApplicationTest { assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK); String indented = (new JSONObject(resp.getBody())).toString(4); - try (PrintStream out = new PrintStream(new FileOutputStream("docs/api.json"))) { + try (PrintStream out = new PrintStream(new FileOutputStream("../docs/offeredapis/swagger/ecs-api.json"))) { out.print(indented); } }