Update documentation and Raise test coverage 64/8064/3
authorelinuxhenrik <henrik.b.andersson@est.tech>
Mon, 11 Apr 2022 13:06:07 +0000 (15:06 +0200)
committerelinuxhenrik <henrik.b.andersson@est.tech>
Tue, 12 Apr 2022 07:27:39 +0000 (09:27 +0200)
Issue-ID: NONRTRIC-734
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
Change-Id: I4a891b1e43a4d371b99307b3938625b76ed82687

icsversion/README.md
icsversion/internal/restclient/client_test.go

index c11588e..86089e1 100644 (file)
@@ -1,65 +1,64 @@
-# O-RAN-SC Non-RealTime RIC O-DU Closed Loop Usecase Slice Assurance integrated with ICS
+## License
+Copyright (C) 2022 Nordix Foundation.
+Licensed under the Apache License, Version 2.0 (the "License")
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
 
-This basic slice assurance usecases use two slices per UE, one default slice and another dedicated slice. The default slice shall not be provisioned with resource quota by the operator where as the dedicated slice shall be provisioned with a resource quota so as to meet it’s slice level throughput requirement. O-DU system shall ensure the dedicated slice will be allocated resources as per the resource quota. O-DU shall monitor the slice performance and provide the slice level performance metrics to SMO. SMO sends this metrics to Non-RT RIC to perform analytic functions and decide to reoptimize the resource quota for the dedicated slice if needed.
+      http://www.apache.org/licenses/LICENSE-2.0
 
-This consumer creates a job of type `Performance_Measurement_Streaming` in the Information Coordinator Service (ICS). This job is associated with Dmaap topic "/events/unauthenticated.VES_O_RAN_SC_HELLO_WORLD_PM_STREAMING_OUTPUT". Messages from this topic contain information regarding throughput in a specific slice. With that information, rApp will check if throughput requirements are fulfilled for the slice and in case is not it sends configuration message to the O-DU through SDNC to reconfigure "radio-resource-management-policy-dedicated-ratio" property.
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
 
-## Configuration
+# O-RAN-SC docker-compose files for O-DU Closed Loop Usecase Slice Assurance integrated with ICS:
+The docker compose file helps the user to deploy all or partial components of the Slice assurance usecase with one command.
 
-The consumer takes a number of environment variables, described below, as configuration.
+## Prerequisite:
 
->- CONSUMER_HOST        **Required**. The host address for this consumer.                          Example: `http://consumer-sa`
->- CONSUMER_PORT        **Required**. The port for this consumer.                                  Example: `8095`
->- SDNR_ADDR            Optional. The address for SDNR.                                            Defaults to `http://sdnr:3904`.
->- SDNR_USER            Optional. The user for the SDNR.                                           Defaults to `admin`.
->- SDNR_PASSWORD        Optional. The password for the SDNR user.                                  Defaults to `Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U`.
->- INFO_COORD_ADDR      Optional. The address of the Information Coordinator.                      Defaults to `http://enrichmentservice:8083`.
->- LOG_LEVEL            Optional. The log level, which can be `Error`, `Warn`, `Info` or `Debug`.  Defaults to `Info`.
+Minimal SMO deployment is needed. This can be started using the instructions from https://gerrit.o-ran-sc.org/r/gitweb?p=oam.git;a=blob;f=solution/integration/README.md;h=73100a4d31a84fb0de9beeb52b639df249ab0fcf;hb=HEAD
 
-## Functionality
+## Overview
 
-The creation of the job is not done when the consumer is started. Instead the consumer provides a REST API where it can be started and stopped, described below. The API is available on the host and port configured for the consumer.
+This docker compose start the following components:
 
->- /admin/start  Creates the job in ICS.
->- /admin/stop   Deletes the job in ICS.
+### Information Coordinator Service
+Coordinate/Register Information Types, Producers, Consumers, and Jobs.
 
-If the consumer is shut down with a SIGTERM, it will also delete the job before exiting.
+### O-RAN-SC Control Panel
 
-There is also a status call provided in the REST API. This will return the running status of the consumer as JSON.
->- /status  {"status": "started/stopped"}
+The Non-RT RIC Control Panel is a graphical user interface that enables the user to view and manage the A1 policies in the RAN and also view producers and jobs for the Information coordinator service.
 
-## Development
+### O-RAN-SC Control Panel Gateway:
 
-To make it easy to test during development of the consumer, two stubs are provided in the `stub` folder.
+To view the policy or information jobs and types in control panel gui along with Policy Management Service & Information Coordinator Service you should also have nonrtric gateway because all the request from the gui are passed through this API gateway.
 
-Under the `prodSdnc` folder, there is a stub that simulate both received VES messages from Dmaap MR with information about performance measurements for the slices in a DU and also simulates SDNR, that sends information about Radio Resource Management Policy Ratio and allows to modify value for RRM Policy Dedicated Ratio from default to higher value.
+### Dmaap-Adaptor/Mediator
+Two alternatives mediators that take information from DMaaP (& Kafka) and present it as a coordinated Information Producer.
+These configurable adapters/mediators act as producers of Information Coordinator Service (ICS) jobs by polling topics in DMaaP Message Router (MR) or Kafka and pushing the messages to a consumer.
 
-The stub does not start to send messages until it recieves a create job call from the ICS stub. When a delete job call comes from the ICS stub it stops sending messages. To build and start the stub, do the following:
->1. cd stub/prodSdnc
->2. go build
->3. ./prodSdnc
+#### Configuration files for Dmaap topics
 
-An ICS stub, under the `ics` folder, that listens for create and delete job calls from the consumer. When it gets a call it calls the producer stub with the correct create or delete call and the provided job ID. By default, it listens to the port `8083`, but his can be overridden by passing a `-port [PORT]` flag when starting the stub. To build and start the stub, do the following:
->1. cd stub/ics
->2. go build
->3. ./ics
+* The Dmaap Adaptor Service needs two configurations files, one for the application specific parameters and one for the types the application supports. More information can be found on wiki page: [Java version](https://wiki.o-ran-sc.org/display/RICNR/Release+F+-+Run+in+Docker#ReleaseFRuninDocker-RuntheDmaapAdaptorServiceDockerContainer).
 
-There is also a docker-compose file available that will build both stubs and start application. In order to use it, do the following:
-docker-compose up
+* The Dmaap Mediator Producer needs one configuration file for the types the application supports and different enviroment variables that can be configured in the docker compose file. More information can be found on wiki page: [Go version](https://wiki.o-ran-sc.org/display/RICNR/Release+F+-+Run+in+Docker#ReleaseFRuninDocker-RuntheDmaapMediatorProducerDockerContainer).
 
-## License
+### O-DU Slice Assurance Rapp
+O-DU Closed Loop Usecase Slice Assurance Rapp integrated with ICS.
 
-Copyright (C) 2021 Nordix Foundation.
-Licensed under the Apache License, Version 2.0 (the "License")
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
+#### Startup solution
 
-      http://www.apache.org/licenses/LICENSE-2.0
+```
+docker-compose up -d
+```
 
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
+### Log files
+
+```
+docker logs -f ics
+docker logs -f dmaap-adaptor-service
+docker logs -f dmaap-mediator-service
+docker logs -f odu-app
+```
 
-For more information about license please see the [LICENSE](LICENSE.txt) file for details.
index e3dc452..33610e2 100644 (file)
@@ -377,9 +377,17 @@ func TestDelete(t *testing.T) {
 
        client := New(&http.Client{}, false)
        payload := `json:"example"`
+       // With user info
        err := client.Delete(srv.URL, payload, nil, "admin", "pass")
 
        if err != nil {
                assert.Equal(t, "", err.Error())
        }
+
+       // Without user info
+       err = client.Delete(srv.URL, payload, nil)
+
+       if err != nil {
+               assert.Equal(t, "", err.Error())
+       }
 }