From e8f75f41224ce99eacf93b68956aa123176f5263 Mon Sep 17 00:00:00 2001 From: elinuxhenrik Date: Tue, 22 Sep 2020 15:49:25 +0200 Subject: [PATCH] Add Developer guide to documentation Change-Id: I960370076653737b9d2892ce657015cd5f8025ea Issue-ID: CCSDK-2833 Signed-off-by: elinuxhenrik --- .gitignore | 2 + docs/a1-adapter-api.rst | 530 +++++++++++++++++++++++++++++++++++++++++++++++ docs/developer-guide.rst | 56 +++++ docs/index.rst | 13 +- docs/pms-api.rst | 69 ++++++ docs/release-notes.rst | 66 ++++++ tox.ini | 32 --- 7 files changed, 731 insertions(+), 37 deletions(-) create mode 100644 docs/a1-adapter-api.rst create mode 100644 docs/developer-guide.rst create mode 100644 docs/pms-api.rst create mode 100644 docs/release-notes.rst delete mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index e4d28704..fe1a055c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,8 @@ MANIFEST.MF **/yang-gen-sal *.interp sli/model/src/main/java +node_modules +package-lock.json ## Misc Ignores (OS specific etc) ## bin/ diff --git a/docs/a1-adapter-api.rst b/docs/a1-adapter-api.rst new file mode 100644 index 00000000..5999d55e --- /dev/null +++ b/docs/a1-adapter-api.rst @@ -0,0 +1,530 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright (C) 2020 Nordix + +.. _a1-adapter-api: + +.. |nbsp| unicode:: 0xA0 + :trim: + +.. |nbh| unicode:: 0x2011 + :trim: + +############## +A1 Adapter API +############## + +The A1 of a Near |nbh| RT |nbsp| RIC can be used through the A1 Adapter. + +The A1 Adapter 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:getA1PolicyType + -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/docs/developer-guide.rst b/docs/developer-guide.rst new file mode 100644 index 00000000..8a32b206 --- /dev/null +++ b/docs/developer-guide.rst @@ -0,0 +1,56 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright (C) 2020 Nordix Foundation. + +Developer Guide +=============== + +This document provides a quickstart for developers of the CCSDK ORAN parts. + +A1 Adapter +++++++++++ + +TBD + +The A1 Adapter can be accessed over the REST API. See :ref:`a1-adapter-api` for how to use the API. + + +A1 Policy Management +++++++++++++++++++++ + +The CCSDK Policy Management Service (PMS) 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 Management Service can be accessed over the REST API. See :ref:`pms-api` for how to use the API. + +Configuration of certs +---------------------- +The Policy Management Service 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: + oran/a1-policy-management/config/application.yaml + +There is also Policy Management Service'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` diff --git a/docs/index.rst b/docs/index.rst index a69ca5fb..de676d17 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,13 +1,16 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. - Copyright 2020 Nordix Foundation. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2020 Nordix Foundation. .. _master_index: -.. _ccsdk/oran - ccsdk/oran ---------- .. toctree:: - :maxdepth: 1 - + :maxdepth: 2 + :caption: Contents: + ./developer-guide.rst + ./pms-api.rst + ./a1-adapter-api.rst + ./release-notes.rst diff --git a/docs/pms-api.rst b/docs/pms-api.rst new file mode 100644 index 00000000..e32194f4 --- /dev/null +++ b/docs/pms-api.rst @@ -0,0 +1,69 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2020 Nordix Foundation. + +.. _pms-api: + +Policy Management Service API +============================= + +This document provides the northboudn api for the Policy Management Service. + +.. raw:: html + + + + + + + + Swagger UI + + + + + +
+ + + + + + + diff --git a/docs/release-notes.rst b/docs/release-notes.rst new file mode 100644 index 00000000..c46e7ad6 --- /dev/null +++ b/docs/release-notes.rst @@ -0,0 +1,66 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright (C) 2020 Nordix Foundation. + +============= +Release-Notes +============= + + +This document provides the release notes for the release of the different parts of the ORAN project. + +.. contents:: + :depth: 3 + :local: + + +Version history Policy Management Service +========================================= + ++------------+----------+------------+----------------+ +| **Date** | **Ver.** | **Author** | **Comment** | +| | | | | ++------------+----------+------------+----------------+ +| 2020-09-10 | 1.0.0 | Dan Timony | First version | +| | | | Guilin Release | ++------------+----------+------------+----------------+ + + +Summary +------- +First version. + + +Version history A1 Adapter +========================== + ++------------+----------+------------+----------------+ +| **Date** | **Ver.** | **Author** | **Comment** | +| | | | | ++------------+----------+------------+----------------+ +| 2019-09-10 | 1.0.0 | Dan Timony | First version | +| | | | Guilin Release | ++------------+----------+------------+----------------+ + + +Release Data +============ + +Guilin +------ ++-----------------------------+-----------------------------------------------------+ +| **Project** | CCSDK ORAN | +| | | ++-----------------------------+-----------------------------------------------------+ +| **Repo/commit-ID** | ccsdk-oran/ec3829493c0b71c5e5908a430edd1e493504178e | +| | | ++-----------------------------+-----------------------------------------------------+ +| **Release designation** | Guilin | +| | | ++-----------------------------+-----------------------------------------------------+ +| **Release date** | 2020-09-10 | +| | | ++-----------------------------+-----------------------------------------------------+ +| **Purpose of the delivery** | Introducing ORAN | +| | | ++-----------------------------+-----------------------------------------------------+ diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 32de8a6c..00000000 --- a/tox.ini +++ /dev/null @@ -1,32 +0,0 @@ -[tox] -minversion = 2.0 -envlist = docs, -skipsdist = true - -[testenv:docs] -basepython = python3 -deps = - sphinx - sphinx-rtd-theme - sphinxcontrib-httpdomain - sphinxcontrib.blockdiag - sphinxcontrib.needs - sphinxcontrib.plantuml - sphinxcontrib.nwdiag - sphinxcontrib.seqdiag - sphinxcontrib.swaggerdoc - recommonmark - lfdocs-conf -commands = - sphinx-build -b html -n -d {envtmpdir}/docs/doctrees ./docs/ {toxinidir}/docs/_build/html - echo "Generated docs available in {toxinidir}/docs/_build/html" -whitelist_externals = - echo - git - sh - -[testenv:docs-linkcheck] -basepython = python3 -commands = echo "Link Checking not enforced" -#commands = sphinx-build -b linkcheck -d {envtmpdir}/docs/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck -whitelist_externals = echo -- 2.16.6