From: Henrik Andersson Date: Tue, 5 May 2020 07:27:13 +0000 (+0000) Subject: Merge "Further updates to the auto-test environment" X-Git-Tag: 2.0.0~57 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=97aaf161d02804c08cffff826f3afdb7690ee5bb;hp=72667f1d4b9e534b38b206f64f2ac67df01a2ed9;p=nonrtric.git Merge "Further updates to the auto-test environment" --- diff --git a/docs/policy-agent-api.rst b/docs/policy-agent-api.rst index 7161bdf1..ce94b3d3 100644 --- a/docs/policy-agent-api.rst +++ b/docs/policy-agent-api.rst @@ -10,9 +10,9 @@ .. _policy-agent-api: -############################ -A1 Policy Management Service -############################ +################################ +A1 Policy Management Service API +################################ ******************************************* @@ -53,15 +53,17 @@ The Policy Agent also keeps an updated view of the policy types available, and w 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 four distinct parts, described in the sections below: +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. @@ -75,9 +77,6 @@ Near |nbh| RT |nbsp| RICs where they were earlier created. **Note!** |nbsp| If t "*Keep Alive Interval*", then the service maintains full responsibility to delete all of its policies when they are no longer needed. -Service Management Operations ------------------------------ - /service ~~~~~~~~ @@ -86,51 +85,67 @@ PUT Register a service. +Definition +"""""""""" + **URL path:** - /service + +/service **Parameters:** - None. + +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.) - } +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**: :: +200: - curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d '{ - "callbackUrl": "URL", - "keepAliveIntervalSeconds": 0, - "serviceName": "existing" - }' +Service updated. - Result: - 201: :: +201: - OK +Service created. - **Call**: :: +400: - curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d "{}" +The ServiceRegistrationInfo is not accepted. - Result: - 400: :: +Examples +"""""""" - Missing mandatory parameter 'serviceName' +**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 ~~~~~~~~~ @@ -140,88 +155,114 @@ GET Query service information. +Definition +"""""""""" + **URL path:** - /services?name= + +/services?name= **Parameters:** - name: (*Optional*) - The name of the service. + +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. +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 +"""""""" -**Examples:** - **Call**: :: +**Call**: :: - curl -X GET "http://localhost:8081/services?name=existing" + curl -X GET "http://localhost:8081/services?name=existing" - Result: - 200: :: +**Result**: - [ - { - "serviceName":"existing", - "keepAliveIntervalSeconds":0, - "timeSinceLastActivitySeconds":7224, - "callbackUrl":"URL" - } - ] +200: :: - **Call**: :: + [ + { + "serviceName":"existing", + "keepAliveIntervalSeconds":0, + "timeSinceLastActivitySeconds":7224, + "callbackUrl":"URL" + } + ] - curl -X GET "http://localhost:8081/services?name=nonexistent" +**Call**: :: - Result: - 404: :: + curl -X GET "http://localhost:8081/services?name=nonexistent" - Service not found +Result: + +404: :: + + Service not found DELETE ++++++ Delete a service. +Definition +"""""""""" + **URL path:** - /services?name= + +/services?name= **Parameters:** - name: (*Required*) - The name of the service. + +name: (*Required*) + +The name of the service. **Responses:** - 204: - OK - 404: - Service not found. -**Examples:** - **Call**: :: +204: + OK + +404: + Service not found. + +Examples +"""""""" + +**Call**: :: - curl -X DELETE "http://localhost:8081/services?name=existing" + curl -X DELETE "http://localhost:8081/services?name=existing" - Result: - 204: :: +**Result**: - OK +204: :: - **Call**: :: + OK - curl -X DELETE "http://localhost:8081/services?name=nonexistent" +**Call**: :: - Result: - 404: :: + curl -X DELETE "http://localhost:8081/services?name=nonexistent" - Could not find service: nonexistent +Result: + +404: :: + + Could not find service: nonexistent /services/keepalive ~~~~~~~~~~~~~~~~~~~ @@ -231,42 +272,57 @@ PUT Heart beat from a service. +Definition +"""""""""" + **URL path:** - /services/keepalive?name= + +/services/keepalive?name= **Parameters:** - name: (*Required*) - The name of the service. + +name: (*Required*) + +The name of the service. **Responses:** - 200: - OK - 404: - Service is not found. -**Examples:** - **Call**: :: +200: + +OK + +404: + +Service is not found. + +Examples +"""""""" - curl -X PUT "http://localhost:8081/services/keepalive?name=existing" +**Call**: :: - Result: - 200: :: + curl -X PUT "http://localhost:8081/services/keepalive?name=existing" - OK +**Result**: - **Call**: :: +200: :: - curl -X PUT "http://localhost:8081/services/keepalive?name=nonexistent" + OK - Result: - 404: :: +**Call**: :: - Could not find service: nonexistent + curl -X PUT "http://localhost:8081/services/keepalive?name=nonexistent" + +**Result**: + +404: :: + + Could not find service: nonexistent .. _policy-management: -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 @@ -274,20 +330,6 @@ and stores them in its internal repository. It then checks this at regular inter 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. -Policies can be queried, created, updated, and deleted. A policy is always created in a specific -Near |nbh| RT |nbsp| RIC. - -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 reflect the status of the -Near |nbh| RT |nbsp| RIC. If this fails, the Policy Agent will delete 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. - -Policy Types ------------- - A policy type defines a name and a JSON schema that constrains the content of a policy of that type. /policy_types @@ -298,42 +340,55 @@ GET Query policy type names. +Definition +"""""""""" + **URL path:** - /policy_types?ric= + +/policy_types?ric= **Parameters:** - ric: (*Optional*) - The name of the Near |nbh| RT |nbsp| RIC to get types for. + +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. +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" -**Examples:** - **Call**: :: +**Result**: - curl -X GET "http://localhost:8081/policy_types" +200: :: - Result: - 200: :: + [ + "STD_PolicyModelUnconstrained_0.2.0", + "Example_QoETarget_1.0.0", + "ERIC_QoSNudging_0.2.0" + ] - [ - "STD_PolicyModelUnconstrained_0.2.0", - "Example_QoETarget_1.0.0", - "ERIC_QoSNudging_0.2.0" - ] +**Call**: :: - **Call**: :: + curl -X GET "http://localhost:8081/policy_types?ric=nonexistent" - curl -X GET "http://localhost:8081/policy_types?ric=nonexistent" +**Result**: - Result: - 404: :: +404: :: - org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent + org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent /policy_schema ~~~~~~~~~~~~~~ @@ -343,81 +398,95 @@ GET Returns one policy type schema definition. +Definition +"""""""""" + **URL path:** - /policy_schema?id= + +/policy_schema?id= **Parameters:** - id: (*Required*) - The ID of the policy type to get the definition for. + +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**: :: +200: - curl -X GET "http://localhost:8081/policy_schema?id=STD_PolicyModelUnconstrained_0.2.0" +Policy schema as JSON schema. - Result: - 200: :: +404: - { - "$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", +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": { - "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"] - } - } + "ueId": {"type": "string"}, + "groupId": {"type": "string"} }, "minProperties": 1, - "additionalProperties": false, - "required": ["scope"] + "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**: :: +**Call**: :: - curl -X GET "http://localhost:8081/policy_schema?id=nonexistent" + curl -X GET "http://localhost:8081/policy_schema?id=nonexistent" - Result: - 404: :: +**Result**: - org.oransc.policyagent.exceptions.ServiceException: Could not find type: nonexistent +404: :: + + org.oransc.policyagent.exceptions.ServiceException: Could not find type: nonexistent /policy_schemas ~~~~~~~~~~~~~~~ @@ -427,70 +496,102 @@ GET Returns policy type schema definitions. +Definition +"""""""""" + **URL path:** - /policy_schemas?ric= + +/policy_schemas?ric= **Parameters:** - ric: (*Optional*) - The name of the Near |nbh| RT |nbsp| RIC to get the definitions for. + +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**: :: +200: - curl -X GET "http://localhost:8081/policy_schemas" +An array of policy schemas as JSON schemas. - Result: - 200: :: +404: - [{ - "$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", +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"] - }] + "properties": { + "scope": { + "type": "object", + . + . + . + } + "additionalProperties": false, + "required": ["scope"] + } + } + } + ] + +**Call**: :: + + curl -X GET "http://localhost:8081/policy_schemas?ric=nonexistent" - **Call**: :: +**Result**: - curl -X GET "http://localhost:8081/policy_schemas?ric=nonexistent" +404: :: - Result: - 404: :: + org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent - org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent +***************** +Policy Management +***************** -Policy ------- +Policies can be queried, created, updated, and deleted. A policy is always created in a specific +Near |nbh| RT |nbsp| RIC. + +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 reflect the status of the +Near |nbh| RT |nbsp| RIC. If this fails, the Policy Agent will delete 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. A policy is defined by its type schema. @@ -512,81 +613,98 @@ GET Query policies. +Definition +"""""""""" + **URL path:** - /policies?ric=&service=&type= + +/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. + +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 + +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 ~~~~~~~ @@ -596,71 +714,85 @@ GET Returns a policy configuration. +Definition +"""""""""" + **URL path:** - /policy?id= + +/policy?id= **Parameters:** - id: (*Required*) - The ID of the policy instance. + +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 + +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 +++ @@ -668,59 +800,83 @@ 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= + +/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. - type: (*Optional*) - The name of the policy type. + +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. + +type: (*Optional*) + +The name of the policy type. **Body:** (*Required*) - A JSON object containing the data specified by the type. + +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 +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 ++++++ @@ -728,28 +884,43 @@ 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= + +/policy?id= **Parameters:** - id: (*Required*) - The ID of the policy instance. + +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**: :: +204: + +Policy deleted. - curl -X DELETE "http://localhost:8081/policy?id=Policy 1" +404: - Result: - 204 +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 ~~~~~~~~~~~ @@ -759,45 +930,63 @@ GET Query policy type IDs. +Definition +"""""""""" + **URL path:** - /policy_ids?ric=&service=&type= + +/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. + +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**: :: +200: + +Array of policy type names. + +404: + +RIC or policy type not found. + +Examples +"""""""" - curl -X GET "http://localhost:8081/policy_ids" +**Call**: :: - Result: - 200: :: + curl -X GET "http://localhost:8081/policy_ids" - [ - "Policy 1", - "Policy 2", - "Policy 3" - ] +**Result**: - **Call**: :: +200: :: - curl -X GET "http://localhost:8081/policy_ids?ric=nonexistent" + [ + "Policy 1", + "Policy 2", + "Policy 3" + ] - Result: - 404: :: +**Call**: :: - Ric not found + curl -X GET "http://localhost:8081/policy_ids?ric=nonexistent" + +**Result**: + +404: :: + + Ric not found /policy_status ~~~~~~~~~~~~~~ @@ -807,29 +996,37 @@ GET Returns the status of a policy. +Definition +"""""""""" + **URL path:** - /policy_status?id= + +/policy_status?id= **Parameters:** - id: (*Required*) - The ID of the policy. + +id: (*Required*) + +The ID of the policy. **Responses:** - 200: - JSON object with policy status. - 404: - Policy not found. +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. -Near-RT RIC ------------ - /ric ~~~~ @@ -838,35 +1035,49 @@ GET Returns the name of a Near |nbh| RT |nbsp| RIC managing a specific Mananged Element. - **URL path:** - /ric?managedElementId= +Definition +"""""""""" + +**URL path:** + +/ric?managedElementId= **Parameters:** - managedElementId: (*Required*) - The ID of the Managed Element. + +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**: :: +200: + +Name of the Near |nbh| RT |nbsp| RIC managing the Managed Element. + +404: - curl -X GET "http://localhost:8081/ric?managedElementId=Node 1" +No Near |nbh| RT |nbsp| RIC manages the given Managed Element. - Result: - 200: :: +Examples +"""""""" - Ric 1 +**Call**: :: - **Call**: :: + curl -X GET "http://localhost:8081/ric?managedElementId=Node 1" - curl -X GET "http://localhost:8081/ric?managedElementId=notmanaged" +**Result**: - Result: - 404 +200: :: + + Ric 1 + +**Call**: :: + + curl -X GET "http://localhost:8081/ric?managedElementId=notmanaged" + +**Result**: + +404 /rics ~~~~~ @@ -876,86 +1087,98 @@ GET Query Near |nbh| RT |nbsp| RIC information. - **URL path:** - /rics?policyType= +Definition +"""""""""" -**Parameters:** - policyType: (*Optional*) - The name of the policy type. +**URL path:** -**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" - } - ] +/rics?policyType= - **Call**: :: +**Parameters:** - curl -X GET "http://localhost:8081/rics?policyType=nonexistent" +policyType: (*Optional*) - Result: - 404: :: +The name of the policy type. - Policy type not found +**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. -Health Check ------------- - /status ~~~~~~~ @@ -964,23 +1187,33 @@ GET Returns the status of the Policy Agent. - **URL path:** - /status +Definition +"""""""""" + +**URL path:** + +/status **Parameters:** - None. + +None. **Responses:** - 200: - Service is living. -**Examples:** - **Call**: :: +200: + +Service is living. - curl -X GET "http://localhost:8081/status" +Examples +"""""""" - Result: - 200 +**Call**: :: + + curl -X GET "http://localhost:8081/status" + +**Result**: + +200 **************** A1 through DMaaP @@ -991,7 +1224,7 @@ Policy Agent polls the DMaaP Message Router regularly and processes any messages 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 @@ -1010,7 +1243,7 @@ Agent. The "*operation*" can be one of the following: "*GET | PUT | POST | DELET } Example -------- ++++++++ To get all policy types for a specific Near |nbh| RT |nbsp| RIC the following message should be sent to DMaaP Message Router: :: @@ -1028,7 +1261,7 @@ Router: :: } 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. :: @@ -1039,13 +1272,13 @@ The message the Policy Agent sends back to the DMaaP Message Router is a JSON li "originatorId": "string", "type": "string", "message": "string", - "type": 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: :: diff --git a/docs/sdnc-a1-controller-api.rst b/docs/sdnc-a1-controller-api.rst index fb6f1778..24f9d451 100644 --- a/docs/sdnc-a1-controller-api.rst +++ b/docs/sdnc-a1-controller-api.rst @@ -10,9 +10,9 @@ .. |nbh| unicode:: 0x2011 :trim: -################## -SDNC A1 Controller -################## +###################### +SDNC A1 Controller API +###################### The A1 of a Near |nbh| RT |nbsp| RIC can be used through the SDNC A1 Controller. diff --git a/policy-agent/pom.xml b/policy-agent/pom.xml index aec78f2d..8ed33684 100644 --- a/policy-agent/pom.xml +++ b/policy-agent/pom.xml @@ -58,7 +58,7 @@ 2.8.1 1.18.0 0.30.0 - 1.1.9 + 1.1.11 2.1.1 3.7.0.1746 0.8.5 diff --git a/policy-agent/src/main/java/org/oransc/policyagent/clients/A1ClientFactory.java b/policy-agent/src/main/java/org/oransc/policyagent/clients/A1ClientFactory.java index 546979ce..57ac9809 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/clients/A1ClientFactory.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/clients/A1ClientFactory.java @@ -86,13 +86,20 @@ public class A1ClientFactory { private ControllerConfig getControllerConfig(Ric ric) throws ServiceException { String controllerName = ric.getConfig().controllerName(); if (controllerName.isEmpty()) { + ric.setProtocolVersion(A1ProtocolType.UNKNOWN); throw new ServiceException("No controller configured for RIC: " + ric.name()); } - return this.appConfig.getControllerConfig(controllerName); + try { + return this.appConfig.getControllerConfig(controllerName); + } catch (ServiceException e) { + ric.setProtocolVersion(A1ProtocolType.UNKNOWN); + throw e; + } } private void assertNoControllerConfig(Ric ric, A1ProtocolType version) throws ServiceException { if (!ric.getConfig().controllerName().isEmpty()) { + ric.setProtocolVersion(A1ProtocolType.UNKNOWN); throw new ServiceException( "Controller config should be empty, ric: " + ric.name() + " when using protocol version: " + version); } diff --git a/policy-agent/src/main/java/org/oransc/policyagent/clients/AsyncRestClient.java b/policy-agent/src/main/java/org/oransc/policyagent/clients/AsyncRestClient.java index ef1acfc1..26d51528 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/clients/AsyncRestClient.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/clients/AsyncRestClient.java @@ -28,6 +28,7 @@ import io.netty.handler.timeout.ReadTimeoutHandler; import io.netty.handler.timeout.WriteTimeoutHandler; import java.lang.invoke.MethodHandles; +import java.util.concurrent.atomic.AtomicInteger; import javax.net.ssl.SSLException; @@ -52,13 +53,16 @@ public class AsyncRestClient { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private WebClient webClient = null; private final String baseUrl; + private static final AtomicInteger sequenceNumber = new AtomicInteger(); public AsyncRestClient(String baseUrl) { this.baseUrl = baseUrl; } public Mono> postForEntity(String uri, @Nullable String body) { - logger.debug("POST uri = '{}{}''", baseUrl, uri); + Object traceTag = createTraceTag(); + logger.debug("{} POST uri = '{}{}''", traceTag, baseUrl, uri); + logger.trace("{} POST body: {}", traceTag, body); Mono bodyProducer = body != null ? Mono.just(body) : Mono.empty(); return getWebClient() // .flatMap(client -> { @@ -66,7 +70,7 @@ public class AsyncRestClient { .uri(uri) // .contentType(MediaType.APPLICATION_JSON) // .body(bodyProducer, String.class); - return retrieve(request); + return retrieve(traceTag, request); }); } @@ -76,7 +80,9 @@ public class AsyncRestClient { } public Mono postWithAuthHeader(String uri, String body, String username, String password) { - logger.debug("POST (auth) uri = '{}{}''", baseUrl, uri); + Object traceTag = createTraceTag(); + logger.debug("{} POST (auth) uri = '{}{}''", traceTag, baseUrl, uri); + logger.trace("{} POST body: {}", traceTag, body); return getWebClient() // .flatMap(client -> { RequestHeadersSpec request = client.post() // @@ -84,30 +90,34 @@ public class AsyncRestClient { .headers(headers -> headers.setBasicAuth(username, password)) // .contentType(MediaType.APPLICATION_JSON) // .bodyValue(body); - return retrieve(request) // + return retrieve(traceTag, request) // .flatMap(this::toBody); }); } public Mono> putForEntity(String uri, String body) { - logger.debug("PUT uri = '{}{}''", baseUrl, uri); + Object traceTag = createTraceTag(); + logger.debug("{} PUT uri = '{}{}''", traceTag, baseUrl, uri); + logger.trace("{} PUT body: {}", traceTag, body); return getWebClient() // .flatMap(client -> { RequestHeadersSpec request = client.put() // .uri(uri) // .contentType(MediaType.APPLICATION_JSON) // .bodyValue(body); - return retrieve(request); + return retrieve(traceTag, request); }); } public Mono> putForEntity(String uri) { - logger.debug("PUT uri = '{}{}''", baseUrl, uri); + Object traceTag = createTraceTag(); + logger.debug("{} PUT uri = '{}{}''", traceTag, baseUrl, uri); + logger.trace("{} PUT body: ", traceTag); return getWebClient() // .flatMap(client -> { RequestHeadersSpec request = client.put() // .uri(uri); - return retrieve(request); + return retrieve(traceTag, request); }); } @@ -117,11 +127,12 @@ public class AsyncRestClient { } public Mono> getForEntity(String uri) { - logger.debug("GET uri = '{}{}''", baseUrl, uri); + Object traceTag = createTraceTag(); + logger.debug("{} GET uri = '{}{}''", traceTag, baseUrl, uri); return getWebClient() // .flatMap(client -> { RequestHeadersSpec request = client.get().uri(uri); - return retrieve(request); + return retrieve(traceTag, request); }); } @@ -131,11 +142,12 @@ public class AsyncRestClient { } public Mono> deleteForEntity(String uri) { - logger.debug("DELETE uri = '{}{}''", baseUrl, uri); + Object traceTag = createTraceTag(); + logger.debug("{} DELETE uri = '{}{}''", traceTag, baseUrl, uri); return getWebClient() // .flatMap(client -> { RequestHeadersSpec request = client.delete().uri(uri); - return retrieve(request); + return retrieve(traceTag, request); }); } @@ -144,19 +156,24 @@ public class AsyncRestClient { .flatMap(this::toBody); } - private Mono> retrieve(RequestHeadersSpec request) { + private Mono> retrieve(Object traceTag, RequestHeadersSpec request) { return request.retrieve() // .toEntity(String.class) // - .doOnError(this::onHttpError); + .doOnNext(entity -> logger.trace("{} Received: {}", traceTag, entity.getBody())) + .doOnError(throwable -> onHttpError(traceTag, throwable)); } - private void onHttpError(Throwable t) { + private static Object createTraceTag() { + return sequenceNumber.incrementAndGet(); + } + + private void onHttpError(Object traceTag, Throwable t) { if (t instanceof WebClientResponseException) { WebClientResponseException exception = (WebClientResponseException) t; - logger.debug("HTTP error status = '{}', body '{}'", exception.getStatusCode(), + logger.debug("{} HTTP error status = '{}', body '{}'", traceTag, exception.getStatusCode(), exception.getResponseBodyAsString()); } else { - logger.debug("HTTP error: {}", t.getMessage()); + logger.debug("{} HTTP error: {}", traceTag, t.getMessage()); } } @@ -179,7 +196,7 @@ public class AsyncRestClient { .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10_000) // .secure(c -> c.sslContext(sslContext)) // .doOnConnected(connection -> { - connection.addHandler(new ReadTimeoutHandler(10)); + connection.addHandler(new ReadTimeoutHandler(30)); connection.addHandler(new WriteTimeoutHandler(30)); }); HttpClient httpClient = HttpClient.from(tcpClient); diff --git a/policy-agent/src/main/java/org/oransc/policyagent/clients/OscA1Client.java b/policy-agent/src/main/java/org/oransc/policyagent/clients/OscA1Client.java index aaa9519c..90fbd101 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/clients/OscA1Client.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/clients/OscA1Client.java @@ -126,6 +126,19 @@ public class OscA1Client implements A1Client { uri = new UriBuilder(ricConfig); } + public static Mono extractCreateSchema(String policyTypeResponse, String policyTypeId) { + try { + JSONObject obj = new JSONObject(policyTypeResponse); + JSONObject schemaObj = obj.getJSONObject("create_schema"); + schemaObj.put(TITLE, policyTypeId); + return Mono.just(schemaObj.toString()); + } catch (Exception e) { + String exceptionString = e.toString(); + logger.error("Unexpected response for policy type: {}, exception: {}", policyTypeResponse, exceptionString); + return Mono.error(e); + } + } + @Override public Mono> getPolicyTypeIdentities() { return getPolicyTypeIds() // @@ -143,7 +156,7 @@ public class OscA1Client implements A1Client { public Mono getPolicyTypeSchema(String policyTypeId) { String schemaUri = uri.createGetSchemaUri(policyTypeId); return restClient.get(schemaUri) // - .flatMap(response -> getCreateSchema(response, policyTypeId)); + .flatMap(response -> extractCreateSchema(response, policyTypeId)); } @Override @@ -186,19 +199,6 @@ public class OscA1Client implements A1Client { .flatMapMany(SdncJsonHelper::parseJsonArrayOfString); } - private Mono getCreateSchema(String policyTypeResponse, String policyTypeId) { - try { - JSONObject obj = new JSONObject(policyTypeResponse); - JSONObject schemaObj = obj.getJSONObject("create_schema"); - schemaObj.put(TITLE, policyTypeId); - return Mono.just(schemaObj.toString()); - } catch (Exception e) { - String exceptionString = e.toString(); - logger.error("Unexpected response for policy type: {}, exception: {}", policyTypeResponse, exceptionString); - return Mono.error(e); - } - } - private Mono deletePolicyById(String typeId, String policyId) { String policyUri = uri.createDeleteUri(typeId, policyId); return restClient.delete(policyUri); diff --git a/policy-agent/src/main/java/org/oransc/policyagent/clients/SdncOscA1Client.java b/policy-agent/src/main/java/org/oransc/policyagent/clients/SdncOscA1Client.java index c29d70e1..fcb3236a 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/clients/SdncOscA1Client.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/clients/SdncOscA1Client.java @@ -132,7 +132,8 @@ public class SdncOscA1Client implements A1Client { } else if (this.protocolType == A1ProtocolType.SDNC_OSC_OSC_V1) { OscA1Client.UriBuilder uri = new OscA1Client.UriBuilder(ricConfig); final String ricUrl = uri.createGetSchemaUri(policyTypeId); - return post(GET_POLICY_RPC, ricUrl, Optional.empty()); + return post(GET_POLICY_RPC, ricUrl, Optional.empty()) // + .flatMap(response -> OscA1Client.extractCreateSchema(response, policyTypeId)); } else { return Mono.error(createIllegalProtocolException()); } diff --git a/policy-agent/src/main/java/org/oransc/policyagent/configuration/ApplicationConfigParser.java b/policy-agent/src/main/java/org/oransc/policyagent/configuration/ApplicationConfigParser.java index dd35e5b3..8418749e 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/configuration/ApplicationConfigParser.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/configuration/ApplicationConfigParser.java @@ -119,9 +119,9 @@ public class ApplicationConfigParser { JsonObject ricAsJson = ricElem.getAsJsonObject(); JsonElement controllerNameElement = ricAsJson.get(CONTROLLER); ImmutableRicConfig ricConfig = ImmutableRicConfig.builder() // - .name(ricAsJson.get("name").getAsString()) // - .baseUrl(ricAsJson.get("baseUrl").getAsString()) // - .managedElementIds(parseManagedElementIds(ricAsJson.get("managedElementIds").getAsJsonArray())) // + .name(get(ricAsJson, "name").getAsString()) // + .baseUrl(get(ricAsJson, "baseUrl").getAsString()) // + .managedElementIds(parseManagedElementIds(get(ricAsJson, "managedElementIds").getAsJsonArray())) // .controllerName(controllerNameElement != null ? controllerNameElement.getAsString() : "") // .build(); result.add(ricConfig); @@ -137,10 +137,10 @@ public class ApplicationConfigParser { for (JsonElement element : getAsJsonArray(config, CONTROLLER)) { JsonObject controllerAsJson = element.getAsJsonObject(); ImmutableControllerConfig controllerConfig = ImmutableControllerConfig.builder() // - .name(controllerAsJson.get("name").getAsString()) // - .baseUrl(controllerAsJson.get("baseUrl").getAsString()) // - .password(controllerAsJson.get("password").getAsString()) // - .userName(controllerAsJson.get("userName").getAsString()) // ) + .name(get(controllerAsJson, "name").getAsString()) // + .baseUrl(get(controllerAsJson, "baseUrl").getAsString()) // + .password(get(controllerAsJson, "password").getAsString()) // + .userName(get(controllerAsJson, "userName").getAsString()) // ) .build(); if (result.put(controllerConfig.name(), controllerConfig) != null) { @@ -164,7 +164,7 @@ public class ApplicationConfigParser { private static JsonElement get(JsonObject obj, String memberName) throws ServiceException { JsonElement elem = obj.get(memberName); if (elem == null) { - throw new ServiceException("Could not find member: " + memberName + " in: " + obj); + throw new ServiceException("Could not find member: '" + memberName + "' in: " + obj); } return elem; } @@ -205,8 +205,8 @@ public class ApplicationConfigParser { dmaapProps.put("group", path.consumerGroup); dmaapProps.put("id", path.consumerId); dmaapProps.put("TransportType", ProtocolTypeConstants.HTTPNOAUTH.toString()); - dmaapProps.put("timeout", 15000); - dmaapProps.put("limit", 100); + dmaapProps.put("timeout", "15000"); + dmaapProps.put("limit", "100"); dmaapProps.put("maxBatchSize", "10"); dmaapProps.put("maxAgeMs", "10000"); dmaapProps.put("compress", true); diff --git a/policy-agent/src/main/java/org/oransc/policyagent/dmaap/DmaapMessageConsumer.java b/policy-agent/src/main/java/org/oransc/policyagent/dmaap/DmaapMessageConsumer.java index f03aa582..da209a86 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/dmaap/DmaapMessageConsumer.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/dmaap/DmaapMessageConsumer.java @@ -110,7 +110,7 @@ public class DmaapMessageConsumer implements Runnable { } private DmaapMessageHandler getDmaapMessageHandler() throws IOException { - String agentBaseUrl = "http://localhost:" + this.localServerPort; + String agentBaseUrl = "https://localhost:" + this.localServerPort; AsyncRestClient agentClient = createRestClient(agentBaseUrl); Properties dmaapPublisherProperties = applicationConfig.getDmaapPublisherConfig(); MRBatchingPublisher producer = getMessageRouterPublisher(dmaapPublisherProperties); diff --git a/policy-agent/src/main/java/org/oransc/policyagent/tasks/RefreshConfigTask.java b/policy-agent/src/main/java/org/oransc/policyagent/tasks/RefreshConfigTask.java index 7cfe4868..05bcb0f2 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/tasks/RefreshConfigTask.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/tasks/RefreshConfigTask.java @@ -24,7 +24,6 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import com.google.gson.JsonSyntaxException; import com.google.gson.TypeAdapterFactory; import java.io.BufferedInputStream; @@ -109,9 +108,8 @@ public class RefreshConfigTask { logger.debug("Starting refreshConfigTask"); stop(); refreshTask = createRefreshTask() // - .subscribe( - notUsed -> logger.debug("Refreshed configuration data"), throwable -> logger - .error("Configuration refresh terminated due to exception {}", throwable.getMessage()), + .subscribe(notUsed -> logger.debug("Refreshed configuration data"), + throwable -> logger.error("Configuration refresh terminated due to exception {}", throwable.toString()), () -> logger.error("Configuration refresh terminated")); } @@ -123,17 +121,17 @@ public class RefreshConfigTask { Flux createRefreshTask() { Flux loadFromFile = Flux.interval(Duration.ZERO, FILE_CONFIG_REFRESH_INTERVAL) // - .filter(notUsed -> configFileExists()) // .filter(notUsed -> !this.isConsulUsed) // .flatMap(notUsed -> loadConfigurationFromFile()) // - .onErrorResume(this::ignoreError) // + .onErrorResume(this::ignoreErrorFlux) // .doOnNext(json -> logger.debug("loadFromFile succeeded")) // .doOnTerminate(() -> logger.error("loadFromFile Terminate")); - Flux loadFromConsul = getEnvironment(systemEnvironment) // + Flux loadFromConsul = Flux.interval(Duration.ZERO, CONSUL_CONFIG_REFRESH_INTERVAL) // + .flatMap(i -> getEnvironment(systemEnvironment)) // .flatMap(this::createCbsClient) // - .flatMapMany(this::periodicConfigurationUpdates) // - .onErrorResume(this::ignoreError) // + .flatMap(this::getFromCbs) // + .onErrorResume(this::ignoreErrorMono) // .doOnNext(json -> logger.debug("loadFromConsul succeeded")) // .doOnNext(json -> this.isConsulUsed = true) // .doOnTerminate(() -> logger.error("loadFromConsul Terminated")); @@ -147,20 +145,32 @@ public class RefreshConfigTask { } Mono getEnvironment(Properties systemEnvironment) { - return EnvironmentProcessor.readEnvironmentVariables(systemEnvironment); + return EnvironmentProcessor.readEnvironmentVariables(systemEnvironment) // + .onErrorResume(t -> Mono.empty()); } Mono createCbsClient(EnvProperties env) { - return CbsClientFactory.createCbsClient(env); + return CbsClientFactory.createCbsClient(env) // + .onErrorResume(this::ignoreErrorMono); } - private Flux periodicConfigurationUpdates(CbsClient cbsClient) { - final Duration initialDelay = Duration.ZERO; + private Mono getFromCbs(CbsClient cbsClient) { final CbsRequest getConfigRequest = CbsRequests.getAll(RequestDiagnosticContext.create()); - return cbsClient.updates(getConfigRequest, initialDelay, CONSUL_CONFIG_REFRESH_INTERVAL); + try { + return cbsClient.get(getConfigRequest) // + .onErrorResume(this::ignoreErrorMono); + } catch (Exception e) { + return ignoreErrorMono(e); + } + } + + private Flux ignoreErrorFlux(Throwable throwable) { + String errMsg = throwable.toString(); + logger.warn("Could not refresh application configuration. {}", errMsg); + return Flux.empty(); } - private Mono ignoreError(Throwable throwable) { + private Mono ignoreErrorMono(Throwable throwable) { String errMsg = throwable.toString(); logger.warn("Could not refresh application configuration. {}", errMsg); return Mono.empty(); @@ -170,9 +180,10 @@ public class RefreshConfigTask { try { ApplicationConfigParser parser = new ApplicationConfigParser(); return Mono.just(parser.parse(jsonObject)); - } catch (ServiceException e) { - logger.error("Could not parse configuration {}", e.toString(), e); - return Mono.error(e); + } catch (Exception e) { + String str = e.toString(); + logger.error("Could not parse configuration {}", str); + return Mono.empty(); } } @@ -180,8 +191,7 @@ public class RefreshConfigTask { return this.appConfig.setConfiguration(config); } - boolean configFileExists() { - String filepath = appConfig.getLocalConfigurationFilePath(); + boolean fileExists(String filepath) { return (filepath != null && (new File(filepath).exists())); } @@ -223,6 +233,10 @@ public class RefreshConfigTask { */ Flux loadConfigurationFromFile() { String filepath = appConfig.getLocalConfigurationFilePath(); + if (!fileExists(filepath)) { + return Flux.empty(); + } + GsonBuilder gsonBuilder = new GsonBuilder(); ServiceLoader.load(TypeAdapterFactory.class).forEach(gsonBuilder::registerTypeAdapterFactory); @@ -232,8 +246,8 @@ public class RefreshConfigTask { appParser.parse(rootObject); logger.debug("Local configuration file loaded: {}", filepath); return Flux.just(rootObject); - } catch (JsonSyntaxException | ServiceException | IOException e) { - logger.debug("Local configuration file not loaded: {}", filepath, e); + } catch (IOException | ServiceException e) { + logger.error("Local configuration file not loaded: {}, {}", filepath, e.getMessage()); return Flux.empty(); } } diff --git a/policy-agent/src/test/java/org/oransc/policyagent/ApplicationTest.java b/policy-agent/src/test/java/org/oransc/policyagent/ApplicationTest.java index 0027cca1..d274d5a3 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/ApplicationTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/ApplicationTest.java @@ -72,7 +72,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.http.HttpStatus; @@ -164,6 +166,12 @@ public class ApplicationTest { Duration checkInterval = Duration.ofMillis(1); return new ServiceSupervision(this.services, this.policies, this.getA1ClientFactory(), checkInterval); } + + @Bean + public ServletWebServerFactory servletContainer() { + return new TomcatServletWebServerFactory(); + } + } @LocalServerPort @@ -301,6 +309,10 @@ public class ApplicationTest { String rsp = restClient().get(url).block(); assertThat(rsp.contains(policyInstanceId)).isTrue(); + url = "/policy?id=" + policyInstanceId; + rsp = restClient().get(url).block(); + assertThat(rsp).isEqualTo(policyBody); + // Test of error codes url = putPolicyUrl(serviceName, ricName + "XX", policyTypeName, policyInstanceId); testErrorCode(restClient().put(url, policyBody), HttpStatus.NOT_FOUND); @@ -663,7 +675,7 @@ public class ApplicationTest { } private String jsonString() { - return "{\n \"servingCellNrcgi\": \"1\"\n }"; + return "{\"servingCellNrcgi\":\"1\"}"; } @Test diff --git a/policy-agent/src/test/java/org/oransc/policyagent/ConcurrencyTestRunnable.java b/policy-agent/src/test/java/org/oransc/policyagent/ConcurrencyTestRunnable.java index f3aaa24d..f8f7ca3b 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/ConcurrencyTestRunnable.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/ConcurrencyTestRunnable.java @@ -22,6 +22,7 @@ package org.oransc.policyagent; import java.util.concurrent.atomic.AtomicInteger; +import org.oransc.policyagent.clients.AsyncRestClient; import org.oransc.policyagent.repository.ImmutablePolicy; import org.oransc.policyagent.repository.Policy; import org.oransc.policyagent.repository.PolicyType; @@ -33,10 +34,6 @@ import org.oransc.policyagent.utils.MockA1Client; import org.oransc.policyagent.utils.MockA1ClientFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; -import org.springframework.web.client.RestTemplate; /** * Invoke operations over the NBI and start synchronizations in a separate @@ -44,8 +41,7 @@ import org.springframework.web.client.RestTemplate; */ class ConcurrencyTestRunnable implements Runnable { private static final Logger logger = LoggerFactory.getLogger(ConcurrencyTestRunnable.class); - private final RestTemplate restTemplate = new RestTemplate(); - private final String baseUrl; + private final AsyncRestClient webClient; static AtomicInteger nextCount = new AtomicInteger(0); private final int count; private final RicSupervision supervision; @@ -55,12 +51,12 @@ class ConcurrencyTestRunnable implements Runnable { ConcurrencyTestRunnable(String baseUrl, RicSupervision supervision, MockA1ClientFactory a1ClientFactory, Rics rics, PolicyTypes types) { - this.baseUrl = baseUrl; this.count = nextCount.incrementAndGet(); this.supervision = supervision; this.a1ClientFactory = a1ClientFactory; this.rics = rics; this.types = types; + this.webClient = new AsyncRestClient(baseUrl); } @Override @@ -80,7 +76,7 @@ class ConcurrencyTestRunnable implements Runnable { deletePolicy(name + "-"); } } catch (Exception e) { - logger.error("Concurrency exception " + e.toString()); + logger.error("Concurrency test exception " + e.toString()); } } @@ -105,29 +101,22 @@ class ConcurrencyTestRunnable implements Runnable { } private void listPolicies() { - String uri = baseUrl + "/policies"; - restTemplate.getForObject(uri, String.class); + String uri = "/policies"; + webClient.getForEntity(uri).block(); } private void listTypes() { - String uri = baseUrl + "/policy_types"; - restTemplate.getForObject(uri, String.class); + String uri = "/policy_types"; + webClient.getForEntity(uri).block(); } private void putPolicy(String name) { - String putUrl = baseUrl + "/policy?type=type1&id=" + name + "&ric=ric&service=service1"; - restTemplate.put(putUrl, createJsonHttpEntity("{}")); + String putUrl = "/policy?type=type1&id=" + name + "&ric=ric&service=service1"; + webClient.putForEntity(putUrl, "{}").block(); } private void deletePolicy(String name) { - String deleteUrl = baseUrl + "/policy?id=" + name; - restTemplate.delete(deleteUrl); + String deleteUrl = "/policy?id=" + name; + webClient.delete(deleteUrl).block(); } - - private static HttpEntity createJsonHttpEntity(String content) { - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - return new HttpEntity(content, headers); - } - } diff --git a/policy-agent/src/test/java/org/oransc/policyagent/clients/SdncOscA1ClientTest.java b/policy-agent/src/test/java/org/oransc/policyagent/clients/SdncOscA1ClientTest.java index fd504250..2cdfe352 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/clients/SdncOscA1ClientTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/clients/SdncOscA1ClientTest.java @@ -27,7 +27,12 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import com.google.gson.Gson; +import com.google.gson.JsonElement; +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.nio.file.Files; import java.util.Arrays; import java.util.List; import java.util.Optional; @@ -112,7 +117,30 @@ public class SdncOscA1ClientTest { String expInput = SdncJsonHelper.createInputJsonString(expectedParams); verify(asyncRestClientMock).postWithAuthHeader(GET_A1_POLICY_URL, expInput, CONTROLLER_USERNAME, CONTROLLER_PASSWORD); + } + + private String loadFile(String fileName) throws IOException { + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + URL url = loader.getResource(fileName); + File file = new File(url.getFile()); + return new String(Files.readAllBytes(file.toPath())); + } + + @Test + public void testGetTypeSchema_OSC() throws IOException { + clientUnderTest = new SdncOscA1Client(A1ProtocolType.SDNC_OSC_OSC_V1, // + A1ClientHelper.createRic(RIC_1_URL).getConfig(), // + controllerConfig(), asyncRestClientMock); + + String ricResponse = loadFile("test_osc_get_schema_response.json"); + JsonElement elem = gson().fromJson(ricResponse, JsonElement.class); + String responseFromController = createResponse(elem); + whenAsyncPostThenReturn(Mono.just(responseFromController)); + String response = clientUnderTest.getPolicyTypeSchema("policyTypeId").block(); + JsonElement respJson = gson().fromJson(response, JsonElement.class); + assertEquals("policyTypeId", respJson.getAsJsonObject().get("title").getAsString(), + "title should be updated to contain policyType ID"); } private String policiesUrl() { diff --git a/policy-agent/src/test/java/org/oransc/policyagent/configuration/ApplicationConfigParserTest.java b/policy-agent/src/test/java/org/oransc/policyagent/configuration/ApplicationConfigParserTest.java index 3303e3f7..79eb07a6 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/configuration/ApplicationConfigParserTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/configuration/ApplicationConfigParserTest.java @@ -68,8 +68,8 @@ public class ApplicationConfigParserTest { () -> assertEquals("admin", actualPublisherConfig.get("password"), "Wrong password"), () -> assertEquals(ProtocolTypeConstants.HTTPNOAUTH.toString(), actualPublisherConfig.get("TransportType"), "Wrong TransportType"), - () -> assertEquals(15000, actualPublisherConfig.get("timeout"), "Wrong timeout"), - () -> assertEquals(100, actualPublisherConfig.get("limit"), "Wrong limit")); + () -> assertEquals("15000", actualPublisherConfig.get("timeout"), "Wrong timeout"), + () -> assertEquals("100", actualPublisherConfig.get("limit"), "Wrong limit")); Properties actualConsumerConfig = result.dmaapConsumerConfig(); assertAll("consumerConfig", @@ -84,8 +84,8 @@ public class ApplicationConfigParserTest { () -> assertEquals("policy-agent", actualConsumerConfig.get("id"), "Wrong id"), () -> assertEquals(ProtocolTypeConstants.HTTPNOAUTH.toString(), actualConsumerConfig.get("TransportType"), "Wrong TransportType"), - () -> assertEquals(15000, actualConsumerConfig.get("timeout"), "Wrong timeout"), - () -> assertEquals(100, actualConsumerConfig.get("limit"), "Wrong limit")); + () -> assertEquals("15000", actualConsumerConfig.get("timeout"), "Wrong timeout"), + () -> assertEquals("100", actualConsumerConfig.get("limit"), "Wrong limit")); Map controllers = result.controllerConfigs(); assertEquals(1, controllers.size(), "size"); @@ -201,7 +201,7 @@ public class ApplicationConfigParserTest { JsonObject jsonRootObject = getJsonRootObject(); JsonObject json = jsonRootObject.getAsJsonObject("config"); json.remove("ric"); - final String message = "Could not find member: ric in: " + json; + final String message = "Could not find member: 'ric' in: " + json; Exception actualException = assertThrows(ServiceException.class, () -> parserUnderTest.parse(jsonRootObject)); diff --git a/policy-agent/src/test/java/org/oransc/policyagent/dmaap/DmaapMessageConsumerTest.java b/policy-agent/src/test/java/org/oransc/policyagent/dmaap/DmaapMessageConsumerTest.java index 153c4ecc..8dd36473 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/dmaap/DmaapMessageConsumerTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/dmaap/DmaapMessageConsumerTest.java @@ -170,7 +170,7 @@ public class DmaapMessageConsumerTest { messageConsumerUnderTest.run(); - verify(messageConsumerUnderTest).createRestClient("http://localhost:0"); + verify(messageConsumerUnderTest).createRestClient("https://localhost:0"); verify(messageConsumerUnderTest).getMessageRouterPublisher(properties); verify(messageHandlerMock).handleDmaapMsg("message"); diff --git a/policy-agent/src/test/java/org/oransc/policyagent/tasks/RefreshConfigTaskTest.java b/policy-agent/src/test/java/org/oransc/policyagent/tasks/RefreshConfigTaskTest.java index e24867b7..cb911330 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/tasks/RefreshConfigTaskTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/tasks/RefreshConfigTaskTest.java @@ -124,7 +124,7 @@ public class RefreshConfigTaskTest { RefreshConfigTask obj = spy(new RefreshConfigTask(appConfig, rics, policies, new Services(), new PolicyTypes(), new A1ClientFactory(appConfig))); if (stubConfigFileExists) { - doReturn(configFileExists).when(obj).configFileExists(); + doReturn(configFileExists).when(obj).fileExists(any()); } return obj; } @@ -221,7 +221,7 @@ public class RefreshConfigTaskTest { doReturn(Mono.just(props)).when(refreshTaskUnderTest).getEnvironment(any()); doReturn(Mono.just(cbsClient)).when(refreshTaskUnderTest).createCbsClient(props); - when(cbsClient.updates(any(), any(), any())).thenReturn(Flux.error(new IOException())); + when(cbsClient.get(any())).thenReturn(Mono.error(new IOException())); final ListAppender logAppender = LoggingUtils.getLogListAppender(RefreshConfigTask.class, WARN); Flux task = refreshTaskUnderTest.createRefreshTask(); @@ -229,7 +229,7 @@ public class RefreshConfigTaskTest { StepVerifier // .create(task) // .expectSubscription() // - .expectNoEvent(Duration.ofMillis(100)) // + .expectNoEvent(Duration.ofMillis(1000)) // .thenCancel() // .verify(); @@ -262,7 +262,7 @@ public class RefreshConfigTaskTest { JsonObject configAsJson = getJsonRootObject(); String newBaseUrl = "newBaseUrl"; modifyTheRicConfiguration(configAsJson, newBaseUrl); - when(cbsClient.updates(any(), any(), any())).thenReturn(Flux.just(configAsJson)); + when(cbsClient.get(any())).thenReturn(Mono.just(configAsJson)); doNothing().when(refreshTaskUnderTest).runRicSynchronization(any(Ric.class)); Flux task = refreshTaskUnderTest.createRefreshTask(); diff --git a/policy-agent/src/test/resources/test_osc_get_schema_response.json b/policy-agent/src/test/resources/test_osc_get_schema_response.json new file mode 100644 index 00000000..537d86f7 --- /dev/null +++ b/policy-agent/src/test/resources/test_osc_get_schema_response.json @@ -0,0 +1,45 @@ +{ + "name": "pt1", + "description": "pt1 policy type", + "policy_type_id": 1, + "create_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSC_Type1_1.0.0", + "description": "Type 1 policy type", + "type": "object", + "properties": { + "scope": { + "type": "object", + "properties": { + "ueId": { + "type": "string" + }, + "qosId": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "ueId", + "qosId" + ] + }, + "qosObjective": { + "type": "object", + "properties": { + "priorityLevel": { + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "priorityLevel" + ] + } + }, + "additionalProperties": false, + "required": [ + "scope", "qosObjective" + ] + } +} diff --git a/sdnc-a1-controller/README.md b/sdnc-a1-controller/README.md index 477707bf..bd0d3669 100644 --- a/sdnc-a1-controller/README.md +++ b/sdnc-a1-controller/README.md @@ -1,6 +1,12 @@ # O-RAN-SC Non-RealTime RIC - A1 Controller -SDNC provides Northbound Interface for A1 operation to do policy management on XAPPS's in Near-RealTime RIC's. +SDNC-A1 controller provides a Northbound Interface for A1 operations to do policy management in Near-RealTime RICs. + +It is a very lightweight version of ONAP SDNC. + +Many features/components of SDNC that are not needed for A1 operations have been removed from both northbound and oam directories. + +This makes it very fast to start the controller and also puts less load on the CPU. Please see the documentation in the docs/ folder diff --git a/sdnc-a1-controller/northbound/README.md b/sdnc-a1-controller/northbound/README.md index f5ae1290..0a325f02 100644 --- a/sdnc-a1-controller/northbound/README.md +++ b/sdnc-a1-controller/northbound/README.md @@ -1,9 +1,8 @@ -This source repository contains the code for the SDN Controller northbound interface adaptors. -To compile this code: +This source repository contains the code for the SDNC-A1 Controller northbound interface. -1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains references to the OpenECOMP repositories and OpenDaylight repositories. See example-settings.xml for an example. +It contains an OSGI bundle named "nonrt-ric-api" that provides the interface for A1 operations. -2. To compile, run "mvn clean install". +To compile, run "mvn clean install". ## License diff --git a/sdnc-a1-controller/northbound/features/features-sdnc-northbound/pom.xml b/sdnc-a1-controller/northbound/features/features-sdnc-a1-northbound/pom.xml similarity index 80% rename from sdnc-a1-controller/northbound/features/features-sdnc-northbound/pom.xml rename to sdnc-a1-controller/northbound/features/features-sdnc-a1-northbound/pom.xml index 6ab5343f..49737bf6 100644 --- a/sdnc-a1-controller/northbound/features/features-sdnc-northbound/pom.xml +++ b/sdnc-a1-controller/northbound/features/features-sdnc-a1-northbound/pom.xml @@ -17,17 +17,17 @@ - org.onap.sdnc.northbound - features-sdnc-northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound + features-sdnc-a1-northbound 1.7.3-SNAPSHOT feature - sdnc-northbound :: features :: ${project.artifactId} + sdnc-a1-northbound :: features :: ${project.artifactId} ${project.groupId} - sdnc-northbound-all + sdnc-a1-northbound-all ${project.version} xml features diff --git a/sdnc-a1-controller/northbound/features/installer/pom.xml b/sdnc-a1-controller/northbound/features/installer/pom.xml index ea67490f..d2e7dcc4 100755 --- a/sdnc-a1-controller/northbound/features/installer/pom.xml +++ b/sdnc-a1-controller/northbound/features/installer/pom.xml @@ -9,24 +9,24 @@ - org.onap.sdnc.northbound - sdnc-northbound-features-installer + org.o-ran-sc.nonrtric.sdnc-a1.northbound + sdnc-a1-northbound-features-installer 1.7.3-SNAPSHOT pom - sdnc-northbound :: features :: ${project.artifactId} + sdnc-a1-northbound :: features :: ${project.artifactId} - sdnc-northbound-all + sdnc-a1-northbound-all ${application.name} - mvn:org.onap.sdnc.northbound/${features.boot}/${project.version}/xml/features + mvn:org.o-ran-sc.nonrtric.sdnc-a1.northbound/${features.boot}/${project.version}/xml/features false - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound ${application.name} ${project.version} xml @@ -98,7 +98,7 @@ true false false - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound provided diff --git a/sdnc-a1-controller/northbound/features/pom.xml b/sdnc-a1-controller/northbound/features/pom.xml index 37336a2b..43302a5e 100755 --- a/sdnc-a1-controller/northbound/features/pom.xml +++ b/sdnc-a1-controller/northbound/features/pom.xml @@ -9,16 +9,16 @@ - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound sdnc-northbound-feature-aggregator 1.7.3-SNAPSHOT pom - sdnc-northbound :: features + sdnc-a1-northbound :: features - sdnc-northbound-all - features-sdnc-northbound + sdnc-a1-northbound-all + features-sdnc-a1-northbound installer diff --git a/sdnc-a1-controller/northbound/features/sdnc-northbound-all/pom.xml b/sdnc-a1-controller/northbound/features/sdnc-a1-northbound-all/pom.xml similarity index 88% rename from sdnc-a1-controller/northbound/features/sdnc-northbound-all/pom.xml rename to sdnc-a1-controller/northbound/features/sdnc-a1-northbound-all/pom.xml index 5c5c9cdd..b9a8332a 100644 --- a/sdnc-a1-controller/northbound/features/sdnc-northbound-all/pom.xml +++ b/sdnc-a1-controller/northbound/features/sdnc-a1-northbound-all/pom.xml @@ -17,12 +17,12 @@ - org.onap.sdnc.northbound - sdnc-northbound-all + org.o-ran-sc.nonrtric.sdnc-a1.northbound + sdnc-a1-northbound-all 1.7.3-SNAPSHOT feature - sdnc-northbound :: features :: ${project.artifactId} + sdnc-a1-northbound :: features :: ${project.artifactId} diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/features/ccsdk-dblib/pom.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/features/ccsdk-dblib/pom.xml deleted file mode 100644 index 5c9ae5e7..00000000 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/features/ccsdk-dblib/pom.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - 4.0.0 - - - org.onap.ccsdk.parent - single-feature-parent - 1.4.3 - - - - org.onap.ccsdk.sli.core - ccsdk-dblib - ${ccsdk.sli.core.version} - feature - - sdnc-northbound :: nonrt-ric-api :: ${project.artifactId} - - - - ${project.groupId} - dblib-provider - ${project.version} - - - org.mariadb.jdbc - mariadb-java-client - - - org.apache.tomcat - tomcat-jdbc - - - org.onap.ccsdk.sli.core - utils-provider - ${project.version} - - - org.apache.derby - derby - - - - - - - org.apache.karaf.tooling - karaf-maven-plugin - true - - - slf4j-api - tomcat-jdbc - tomcat-juli - - - - - - \ No newline at end of file diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/features/ccsdk-dblib/src/main/feature/feature.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/features/ccsdk-dblib/src/main/feature/feature.xml deleted file mode 100644 index 771c3745..00000000 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/features/ccsdk-dblib/src/main/feature/feature.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - -
Root POM to be used in place of odlparent for CCSDK based projects
- wrap - mvn:org.onap.ccsdk.sli.core/dblib-provider/${project.version} - mvn:org.mariadb.jdbc/mariadb-java-client/${mariadb.connector.version} - wrap:mvn:org.apache.tomcat/tomcat-jdbc/${tomcat-jdbc.version}/$DynamicImport-Package=org.mariadb.*,org.apache.derby.*&overwrite=merge - wrap:mvn:org.apache.tomcat/tomcat-juli/${tomcat-jdbc.version}/$DynamicImport-Package=org.mariadb.*,org.apache.derby.*&overwrite=merge - mvn:org.onap.ccsdk.sli.core/utils-provider/${project.version} -
-
diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/features/ccsdk-sli/pom.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/features/ccsdk-sli/pom.xml deleted file mode 100644 index feacb4ea..00000000 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/features/ccsdk-sli/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - 4.0.0 - - - org.onap.ccsdk.parent - single-feature-parent - 1.4.3 - - - - org.onap.ccsdk.sli.core - ccsdk-sli - ${ccsdk.sli.core.version} - feature - - sdnc-northbound :: nonrt-ric-api :: ${project.artifactId} - - - - org.onap.ccsdk.sli.core - sli-common - ${project.version} - - - org.onap.ccsdk.sli.core - sli-provider - ${project.version} - - - org.onap.ccsdk.sli.core - dblib-provider - ${project.version} - provided - - - org.mariadb.jdbc - mariadb-java-client - - - org.onap.ccsdk.sli.core - ccsdk-dblib - ${project.version} - xml - features - - - \ No newline at end of file diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/features/features-nonrt-ric-api/pom.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/features/features-nonrt-ric-api/pom.xml index 8a2a5160..10b5d43c 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/features/features-nonrt-ric-api/pom.xml +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/features/features-nonrt-ric-api/pom.xml @@ -28,12 +28,12 @@ - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound features-nonrt-ric-api 1.7.3-SNAPSHOT feature - sdnc-northbound :: nonrt-ric-api :: ${project.artifactId} + sdnc-a1-northbound :: nonrt-ric-api :: ${project.artifactId} diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/features/pom.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/features/pom.xml index c05b80e9..a83de20a 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/features/pom.xml +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/features/pom.xml @@ -28,17 +28,15 @@ - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound nonrt-ric-api-features 1.7.3-SNAPSHOT pom - sdnc-northbound :: nonrt-ric-api :: ${project.artifactId} + sdnc-a1-northbound :: nonrt-ric-api :: ${project.artifactId} sdnc-nonrt-ric-api features-nonrt-ric-api - ccsdk-sli - ccsdk-dblib diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/features/sdnc-nonrt-ric-api/pom.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/features/sdnc-nonrt-ric-api/pom.xml index b58293d3..f39d9ca5 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/features/sdnc-nonrt-ric-api/pom.xml +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/features/sdnc-nonrt-ric-api/pom.xml @@ -28,12 +28,12 @@ - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound sdnc-nonrt-ric-api 1.7.3-SNAPSHOT feature - sdnc-northbound :: nonrt-ric-api :: ${project.artifactId} + sdnc-a1-northbound :: nonrt-ric-api :: ${project.artifactId} diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/installer/pom.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/installer/pom.xml index 966686b7..2532d118 100755 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/installer/pom.xml +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/installer/pom.xml @@ -28,24 +28,24 @@ - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound nonrt-ric-api-installer 1.7.3-SNAPSHOT pom - sdnc-northbound :: nonrt-ric-api :: ${project.artifactId} + sdnc-a1-northbound :: nonrt-ric-api :: ${project.artifactId} sdnc-nonrt-ric-api ${application.name} - mvn:org.onap.sdnc.northbound/${application.name}/${project.version}/xml/features + mvn:org.o-ran-sc.nonrtric.sdnc-a1.northbound/${application.name}/${project.version}/xml/features false - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound ${application.name} ${project.version} xml @@ -59,7 +59,7 @@ - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound nonrt-ric-api-provider ${project.version} @@ -123,7 +123,7 @@ true false false - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound provided diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/model/pom.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/model/pom.xml index ea5ed711..7d45eb50 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/model/pom.xml +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/model/pom.xml @@ -36,20 +36,18 @@ - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound nonrt-ric-api-model 1.7.3-SNAPSHOT bundle - sdnc-northbound :: nonrt-ric-api :: ${project.artifactId} + sdnc-a1-northbound :: nonrt-ric-api :: ${project.artifactId} org.opendaylight.mdsal.binding.model.ietf rfc6991 - - diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/model/src/main/yang/NONRT-RIC-API.yang b/sdnc-a1-controller/northbound/nonrt-ric-api/model/src/main/yang/NONRT-RIC-API.yang index 19336603..34c0a72d 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/model/src/main/yang/NONRT-RIC-API.yang +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/model/src/main/yang/NONRT-RIC-API.yang @@ -19,7 +19,7 @@ // module A1-ADAPTER-API { - namespace "org:onap:sdnc:northbound:a1-adapter"; + namespace "org:o_ran_sc:nonrtric:sdnc_a1:northbound:a1-adapter"; prefix a1-adapter-api; diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/pom.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/pom.xml index 44b02e23..2868a0c0 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/pom.xml +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/pom.xml @@ -30,12 +30,12 @@ - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound nonrt-ric-api 1.7.3-SNAPSHOT pom - sdnc-northbound :: nonrt-ric-api + sdnc-a1-northbound :: nonrt-ric-api 3.7.0.1746 diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/pom.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/pom.xml index e3c7ab95..02e32e70 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/pom.xml +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/pom.xml @@ -38,12 +38,12 @@ - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound nonrt-ric-api-provider 1.7.3-SNAPSHOT bundle - sdnc-northbound :: nonrt-ric-api :: ${project.artifactId} + sdnc-a1-northbound :: nonrt-ric-api :: ${project.artifactId} @@ -93,7 +93,7 @@
- org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound nonrt-ric-api-model ${project.version} @@ -115,6 +115,10 @@ org.apache.commons commons-lang3
+ + org.apache.httpcomponents + httpclient + org.onap.ccsdk.sli.core sli-common diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/onap/sdnc/northbound/provider/NonrtRicApiProvider.java b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/provider/NonrtRicApiProvider.java similarity index 80% rename from sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/onap/sdnc/northbound/provider/NonrtRicApiProvider.java rename to sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/provider/NonrtRicApiProvider.java index 12704df6..ac9181bf 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/onap/sdnc/northbound/provider/NonrtRicApiProvider.java +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/provider/NonrtRicApiProvider.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.sdnc.northbound.provider; +package org.o_ran_sc.nonrtric.sdnc_a1.northbound.provider; import com.google.common.util.concurrent.CheckedFuture; import com.google.common.util.concurrent.Futures; @@ -26,31 +26,31 @@ import com.google.common.util.concurrent.ListenableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import org.onap.sdnc.northbound.restadapter.RestAdapter; -import org.onap.sdnc.northbound.restadapter.RestAdapterImpl; +import org.o_ran_sc.nonrtric.sdnc_a1.northbound.restadapter.RestAdapter; +import org.o_ran_sc.nonrtric.sdnc_a1.northbound.restadapter.RestAdapterImpl; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.A1ADAPTERAPIService; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.DeleteA1PolicyInput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.DeleteA1PolicyOutput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.DeleteA1PolicyOutputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyInput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyOutput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyOutputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyStatusInput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyStatusOutput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyStatusOutputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyTypeInput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyTypeOutput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyTypeOutputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.PutA1PolicyInput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.PutA1PolicyOutput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.PutA1PolicyOutputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.A1ADAPTERAPIService; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.DeleteA1PolicyInput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.DeleteA1PolicyOutput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.DeleteA1PolicyOutputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyInput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyInputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyOutput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyOutputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyStatusInput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyStatusOutput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyStatusOutputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyTypeInput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyTypeOutput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyTypeOutputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.PutA1PolicyInput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.PutA1PolicyOutput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.PutA1PolicyOutputBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/onap/sdnc/northbound/restadapter/RestAdapter.java b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/restadapter/RestAdapter.java similarity index 96% rename from sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/onap/sdnc/northbound/restadapter/RestAdapter.java rename to sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/restadapter/RestAdapter.java index a99edceb..9cd40af0 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/onap/sdnc/northbound/restadapter/RestAdapter.java +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/restadapter/RestAdapter.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.sdnc.northbound.restadapter; +package org.o_ran_sc.nonrtric.sdnc_a1.northbound.restadapter; import org.springframework.http.ResponseEntity; diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/restadapter/RestAdapterImpl.java b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/restadapter/RestAdapterImpl.java new file mode 100644 index 00000000..d317e56a --- /dev/null +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/restadapter/RestAdapterImpl.java @@ -0,0 +1,143 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.o_ran_sc.nonrtric.sdnc_a1.northbound.restadapter; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; +import java.util.Properties; +import org.apache.http.client.HttpClient; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.conn.ssl.TrustSelfSignedStrategy; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContexts; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.util.ResourceUtils; +import org.springframework.web.client.RestTemplate; + +/** + * This class provides the Generic Rest Adapter interface to the RestTemplate + * + * @author lathishbabu.ganesan@est.tech + * + */ + +public class RestAdapterImpl implements RestAdapter { + + private static final String PROPERTIES_FILE = "nonrt-ric-api-provider.properties"; + private final Logger log = LoggerFactory.getLogger(RestAdapterImpl.class); + + private RestTemplate restTemplateHttp; + private RestTemplate restTemplateHttps; + + public RestAdapterImpl() { + restTemplateHttp = new RestTemplate(); + try { + restTemplateHttps = createRestTemplateForHttps(); + } catch (IOException | UnrecoverableKeyException | KeyManagementException | CertificateException + | NoSuchAlgorithmException | KeyStoreException ex) { + log.error("Caught exception when trying to create restTemplateHttps: {}", ex.getMessage()); + } + } + + private RestTemplate createRestTemplateForHttps() throws IOException, UnrecoverableKeyException, CertificateException, + NoSuchAlgorithmException, KeyStoreException, KeyManagementException { + InputStream inputStream = RestAdapterImpl.class.getClassLoader().getResourceAsStream(PROPERTIES_FILE); + if (inputStream == null) { + throw new FileNotFoundException("properties file not found in classpath"); + } else { + Properties properties = new Properties(); + properties.load(inputStream); + final String keystorePassword = properties.getProperty("key-store-password"); + SSLConnectionSocketFactory scsf = new SSLConnectionSocketFactory( + SSLContexts.custom() + .loadKeyMaterial(ResourceUtils.getFile(properties.getProperty("key-store")), + keystorePassword.toCharArray(), keystorePassword.toCharArray()) + .loadTrustMaterial(null, new TrustSelfSignedStrategy()) + .build(), + NoopHostnameVerifier.INSTANCE); + HttpClient client = HttpClients.custom().setSSLSocketFactory(scsf).build(); + HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); + requestFactory.setHttpClient(client); + inputStream.close(); + return new RestTemplate(requestFactory); + } + } + + private HttpEntity getHttpEntity(final Object object) { + return new HttpEntity<>(object); + } + + @Override + public ResponseEntity get(String uri, Class clazz) { + HttpEntity entity = getHttpEntity(null); + return invokeHttpRequest(uri, HttpMethod.GET, clazz, entity); + } + + @Override + public ResponseEntity put(String uri, String body, Class clazz) { + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + HttpEntity entity = new HttpEntity<>(body, headers); + return invokeHttpRequest(uri, HttpMethod.PUT, clazz, entity); + } + + @Override + public ResponseEntity delete(String uri) { + HttpEntity entity = getHttpEntity(null); + return invokeHttpRequest(uri, HttpMethod.DELETE, null, entity); + } + + @SuppressWarnings("unchecked") + private ResponseEntity invokeHttpRequest(String uri, HttpMethod httpMethod, Class clazz, + HttpEntity entity) { + try { + URL url = new URL(uri); + if (url.getProtocol().equals("https")) { + return (ResponseEntity) restTemplateHttps.exchange(uri, httpMethod, entity, clazz); + } else if (url.getProtocol().equals("http")) { + return (ResponseEntity) restTemplateHttp.exchange(uri, httpMethod, entity, clazz); + } else { + log.error("Invalid protocol in URL"); + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + } + } catch (MalformedURLException ex) { + log.error("URL is not valid, exception: {}", ex.getMessage()); + return new ResponseEntity<>(HttpStatus.BAD_REQUEST); + } + } +} \ No newline at end of file diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/onap/sdnc/northbound/restadapter/RestAdapterImpl.java b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/onap/sdnc/northbound/restadapter/RestAdapterImpl.java deleted file mode 100644 index 9e9d28a0..00000000 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/java/org/onap/sdnc/northbound/restadapter/RestAdapterImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.sdnc.northbound.restadapter; - -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.client.RestTemplate; - -/** - * This class provides the Generic Rest Adapter interface to the RestTemplate - * - * @author lathishbabu.ganesan@est.tech - * - */ - -public class RestAdapterImpl implements RestAdapter { - - private RestTemplate restTemplate; - - public RestAdapterImpl() { - restTemplate = new RestTemplate(); - } - - private HttpEntity getHttpEntity(final Object object) { - return new HttpEntity<>(object); - } - - @Override - public ResponseEntity get(String uri, Class clazz) { - HttpEntity entity = getHttpEntity(null); - return invokeHttpRequest(uri, HttpMethod.GET, clazz, entity); - } - - @Override - public ResponseEntity put(String uri, String body, Class clazz) { - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - HttpEntity entity = new HttpEntity<>(body, headers); - return invokeHttpRequest(uri, HttpMethod.PUT, clazz, entity); - } - - @Override - public ResponseEntity delete(String uri) { - HttpEntity entity = getHttpEntity(null); - return invokeHttpRequest(uri, HttpMethod.DELETE, null, entity); - } - - @SuppressWarnings("unchecked") - private ResponseEntity invokeHttpRequest(String uri, HttpMethod httpMethod, Class clazz, - HttpEntity entity) { - return (ResponseEntity) restTemplate.exchange(uri, httpMethod, entity, clazz); - } -} diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/OSGI-INF/blueprint/nonrt-ric-api-blueprint.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/OSGI-INF/blueprint/nonrt-ric-api-blueprint.xml index 3f732ab3..53c15096 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/OSGI-INF/blueprint/nonrt-ric-api-blueprint.xml +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/OSGI-INF/blueprint/nonrt-ric-api-blueprint.xml @@ -34,7 +34,7 @@ interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry" odl:type="default" /> - + diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/NearRtRicList.properties b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/nonrt-ric-api-provider.properties similarity index 74% rename from sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/NearRtRicList.properties rename to sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/nonrt-ric-api-provider.properties index f5d3bf7d..6a066a6d 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/NearRtRicList.properties +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/nonrt-ric-api-provider.properties @@ -1,7 +1,7 @@ # ========================LICENSE_START================================= # O-RAN-SC # %% -# Copyright (C) 2019 Nordix Foundation +# Copyright (C) 2020 Nordix Foundation # %% # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,8 +16,5 @@ # limitations under the License. # ========================LICENSE_END=================================== -# Defines the list of Near-RT RICs that the SDNC can contact, -# where key is nearRTRicId and value is domainname:port of a Near-RT Ric. - -NearRtRic1 = nearRtRic-sim1:8080 -NearRtRic2 = nearRtRic-sim2:8080 \ No newline at end of file +key-store-password = sdnc-a1-controller +key-store = /etc/ssl/certs/java/keystore.jks \ No newline at end of file diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/org/opendaylight/blueprint/nonrt-ric-api-blueprint.xml b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/org/opendaylight/blueprint/nonrt-ric-api-blueprint.xml index 3f732ab3..53c15096 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/org/opendaylight/blueprint/nonrt-ric-api-blueprint.xml +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/main/resources/org/opendaylight/blueprint/nonrt-ric-api-blueprint.xml @@ -34,7 +34,7 @@ interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry" odl:type="default" /> - + diff --git a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/test/java/org/onap/sdnc/northbound/NonrtRicApiProviderTest.java b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/test/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/NonrtRicApiProviderTest.java similarity index 82% rename from sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/test/java/org/onap/sdnc/northbound/NonrtRicApiProviderTest.java rename to sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/test/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/NonrtRicApiProviderTest.java index 94b2f923..dd76a077 100644 --- a/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/test/java/org/onap/sdnc/northbound/NonrtRicApiProviderTest.java +++ b/sdnc-a1-controller/northbound/nonrt-ric-api/provider/src/test/java/org/o_ran_sc/nonrtric/sdnc_a1/northbound/NonrtRicApiProviderTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.sdnc.northbound; +package org.o_ran_sc.nonrtric.sdnc_a1.northbound; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.when; @@ -32,22 +32,22 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.internal.util.reflection.Whitebox; import org.mockito.runners.MockitoJUnitRunner; -import org.onap.sdnc.northbound.provider.NonrtRicApiProvider; -import org.onap.sdnc.northbound.restadapter.RestAdapter; +import org.o_ran_sc.nonrtric.sdnc_a1.northbound.provider.NonrtRicApiProvider; +import org.o_ran_sc.nonrtric.sdnc_a1.northbound.restadapter.RestAdapter; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.DeleteA1PolicyInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.DeleteA1PolicyOutput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyOutput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyStatusInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyStatusOutput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyTypeInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.GetA1PolicyTypeOutput; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.PutA1PolicyInputBuilder; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.a1.adapter.rev200122.PutA1PolicyOutput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.DeleteA1PolicyInputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.DeleteA1PolicyOutput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyInputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyOutput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyStatusInputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyStatusOutput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyTypeInputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.GetA1PolicyTypeOutput; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.PutA1PolicyInputBuilder; +import org.opendaylight.yang.gen.v1.org.o_ran_sc.nonrtric.sdnc_a1.northbound.a1.adapter.rev200122.PutA1PolicyOutput; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/sdnc-a1-controller/northbound/pom.xml b/sdnc-a1-controller/northbound/pom.xml index b243d712..6e0878c8 100644 --- a/sdnc-a1-controller/northbound/pom.xml +++ b/sdnc-a1-controller/northbound/pom.xml @@ -36,8 +36,8 @@ - org.onap.sdnc.northbound - sdnc-northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound + sdnc-a1-northbound 1.7.3-SNAPSHOT pom @@ -45,7 +45,7 @@ 3.7.0.1746 - sdnc-northbound + sdnc-a1-northbound The SDN-C Northbound APIs repo contains code for northbound API adaptors, typically MD-SAL applications https://wiki.onap.org @@ -57,27 +57,6 @@ nonrt-ric-api - - scm:git:ssh://git@${onap.git.host}/sdnc-northbound.git - - scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/sdnc-northbound.git - ${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/sdnc-northbound/browse - - - JIRA - https://jira.onap.org/ - - - Jenkins - https://jenkins.onap.org/ - - - - sdnc-javadoc - dav:https://${onap.nexus.host}:${onap.nexus.port}/repository/sdn-c-javadoc/${project.artifactId}/${project.version} - - - @@ -97,41 +76,4 @@ - - - blackduck - - - blackduck-scan - - - - - - com.blackducksoftware.integration - hub-maven-plugin - 1.4.0 - false - - ${project.name} - ${project.basedir} - - - - create-bdio-file - package - - createHubOutput - - - - - - - - - - - - diff --git a/sdnc-a1-controller/oam/README.md b/sdnc-a1-controller/oam/README.md index 2cabf6bd..ce55f565 100644 --- a/sdnc-a1-controller/oam/README.md +++ b/sdnc-a1-controller/oam/README.md @@ -1,15 +1,12 @@ -This source repository contains the code for SDN Controller operations, administration and maintenance utilities. This code depends on the following, which should be downloaded and compiled first: +This source repository contains the code for SDNC-A1 Controller operations, administration and maintenance utilities. -1. org.openecomp.sdnc/sdnc-core -2. org.openecomp.sdnc/sdnc-adaptors -3. org.openecomp.sdnc/sdnc-northbound -4. org.openecomp.sdnc/sdnc-plugins +It adds the features from northbound directory and creates the docker image for SDNC-A1 controller. -To compile this code: +It also contains the keystore, the script to start OpenDaylight, and the healthcheck script. -1. Make sure your local Maven settings file ($HOME/.m2/settings.xml) contains references to the OpenECOMP repositories and OpenDaylight repositories. See example-settings.xml for an example. +The docker-compose file is also included in this directory. -2. To compile, run "mvn clean install". +To compile, run "mvn clean install". ## License diff --git a/sdnc-a1-controller/oam/installation/TagVersion.groovy b/sdnc-a1-controller/oam/installation/TagVersion.groovy index 9daac313..551eb70e 100644 --- a/sdnc-a1-controller/oam/installation/TagVersion.groovy +++ b/sdnc-a1-controller/oam/installation/TagVersion.groovy @@ -21,7 +21,7 @@ * */ -package org.onap.sdnc.oam +package org.o_ran_sc.nonrtric.sdnc_a1.oam def versionArray; diff --git a/sdnc-a1-controller/oam/installation/pom.xml b/sdnc-a1-controller/oam/installation/pom.xml index 76ff884e..0b64bca4 100644 --- a/sdnc-a1-controller/oam/installation/pom.xml +++ b/sdnc-a1-controller/oam/installation/pom.xml @@ -28,14 +28,14 @@ 4.0.0 pom - org.onap.sdnc.oam + org.o-ran-sc.nonrtric.sdnc-a1.oam installation 1.7.3-SNAPSHOT - sdnc-oam :: installation + sdnc-a1-oam :: installation Installs SDN-C on local file system - sdnc + sdnc-a1 diff --git a/sdnc-a1-controller/oam/installation/sdnc/pom.xml b/sdnc-a1-controller/oam/installation/sdnc-a1/pom.xml similarity index 89% rename from sdnc-a1-controller/oam/installation/sdnc/pom.xml rename to sdnc-a1-controller/oam/installation/sdnc-a1/pom.xml index 8525571b..3e0b4680 100644 --- a/sdnc-a1-controller/oam/installation/sdnc/pom.xml +++ b/sdnc-a1-controller/oam/installation/sdnc-a1/pom.xml @@ -28,11 +28,11 @@ 4.0.0 pom - org.onap.sdnc.oam - installation-sdnc + org.o-ran-sc.nonrtric.sdnc-a1.oam + installation-sdnc-a1 1.7.3-SNAPSHOT - sdnc-oam :: installation :: ${project.artifactId} + sdnc-a1-oam :: installation :: ${project.artifactId} Creates SDN Controller Docker container @@ -42,23 +42,20 @@ ${maven.build.timestamp} 1.7.3-SNAPSHOT 0.6.3 - org.onap.sdnc.p12 - - 8443 deploy - org.onap.sdnc.northbound + org.o-ran-sc.nonrtric.sdnc-a1.northbound nonrt-ric-api-installer ${sdnc.northbound.version} repo zip - org.onap.sdnc.northbound - sdnc-northbound-features-installer + org.o-ran-sc.nonrtric.sdnc-a1.northbound + sdnc-a1-northbound-features-installer ${sdnc.northbound.version} repo zip @@ -194,7 +191,7 @@ src/main/resources idmlight.db.mv.db - truststoreONAPall.jks + keystore.jks aaa-app-config.xml false @@ -242,27 +239,6 @@ - - copy-keystores - - copy-resources - - validate - - ${basedir}/target/docker-stage/opt/onap/sdnc/data/stores - - - ../src/main/stores - - *.jks - *.keyfile - *.p12 - - false - - - - diff --git a/sdnc-a1-controller/oam/installation/sdnc/src/main/docker/standalone.Dockerfile b/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/docker/standalone.Dockerfile similarity index 63% rename from sdnc-a1-controller/oam/installation/sdnc/src/main/docker/standalone.Dockerfile rename to sdnc-a1-controller/oam/installation/sdnc-a1/src/main/docker/standalone.Dockerfile index 629732c5..80262ff3 100755 --- a/sdnc-a1-controller/oam/installation/sdnc/src/main/docker/standalone.Dockerfile +++ b/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/docker/standalone.Dockerfile @@ -20,18 +20,16 @@ RUN rsync -a /tmp/system $ODL_HOME FROM nexus3.onap.org:10001/onap/ccsdk-odlsli-alpine-image:${ccsdk.docker.version} -MAINTAINER SDN-C Team (sdnc@lists.onap.org) +MAINTAINER O-RAN-SC NONRTRIC Team ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk ENV ODL_HOME /opt/opendaylight ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties -ENV SDNC_STORE_DIR /opt/onap/sdnc/data/stores -ENV SSL_CERTS_DIR /etc/ssl/certs -ENV JAVA_SECURITY_DIR $SSL_CERTS_DIR/java -ENV SDNC_NORTHBOUND_REPO mvn:org.onap.sdnc.northbound/sdnc-northbound-all/${sdnc.northbound.version}/xml/features -ENV SDNC_KEYSTORE ${sdnc.keystore} -ENV SDNC_KEYPASS ${sdnc.keypass} -ENV SDNC_SECUREPORT ${sdnc.secureport} +ENV JAVA_SECURITY_DIR /etc/ssl/certs/java +ENV SDNC_NORTHBOUND_REPO mvn:org.o-ran-sc.nonrtric.sdnc-a1.northbound/sdnc-a1-northbound-all/${sdnc.northbound.version}/xml/features +ENV SDNC_KEYSTORE keystore.jks +ENV SDNC_KEYPASS sdnc-a1-controller +ENV SDNC_SECUREPORT 8443 USER root @@ -40,18 +38,16 @@ COPY --from=stage0 --chown=odl:odl /opt /opt # Add SDNC repositories to boot repositories RUN cp $ODL_HOME/etc/org.apache.karaf.features.cfg $ODL_HOME/etc/org.apache.karaf.features.cfg.orig RUN sed -i -e "\|featuresRepositories|s|$|,${SDNC_NORTHBOUND_REPO}|" $ODL_HOME/etc/org.apache.karaf.features.cfg -RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,sdnc-northbound-all|" $ODL_HOME/etc/org.apache.karaf.features.cfg +RUN sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,sdnc-a1-northbound-all|" $ODL_HOME/etc/org.apache.karaf.features.cfg RUN sed -i "s/odl-restconf-all/odl-restconf-all,odl-netconf-topology/g" $ODL_HOME/etc/org.apache.karaf.features.cfg -# Install ssl and java certificates -COPY truststoreONAPall.jks $JAVA_SECURITY_DIR -COPY truststoreONAPall.jks $SDNC_STORE_DIR -RUN keytool -importkeystore -srckeystore $JAVA_SECURITY_DIR/truststoreONAPall.jks -srcstorepass changeit -destkeystore $JAVA_SECURITY_DIR/cacerts -deststorepass changeit +# Install java certificate +COPY $SDNC_KEYSTORE $JAVA_SECURITY_DIR # Secure with TLS RUN echo org.osgi.service.http.secure.enabled=true >> $ODL_HOME/etc/custom.properties RUN echo org.osgi.service.http.secure.port=$SDNC_SECUREPORT >> $ODL_HOME/etc/custom.properties -RUN echo org.ops4j.pax.web.ssl.keystore=$SDNC_STORE_DIR/$SDNC_KEYSTORE >> $ODL_HOME/etc/custom.properties +RUN echo org.ops4j.pax.web.ssl.keystore=$JAVA_SECURITY_DIR/$SDNC_KEYSTORE >> $ODL_HOME/etc/custom.properties RUN echo org.ops4j.pax.web.ssl.password=$SDNC_KEYPASS >> $ODL_HOME/etc/custom.properties RUN echo org.ops4j.pax.web.ssl.keypassword=$SDNC_KEYPASS >> $ODL_HOME/etc/custom.properties @@ -60,4 +56,4 @@ RUN chown -R odl:odl /opt USER odl ENTRYPOINT /opt/onap/sdnc/bin/startODL.sh -EXPOSE 8181 +EXPOSE 8181 $SDNC_SECUREPORT diff --git a/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/resources/keystore.jks b/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/resources/keystore.jks new file mode 100644 index 00000000..705b2845 Binary files /dev/null and b/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/resources/keystore.jks differ diff --git a/sdnc-a1-controller/oam/installation/sdnc/src/main/resources/sdnctl.dump b/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/resources/sdnctl.dump similarity index 100% rename from sdnc-a1-controller/oam/installation/sdnc/src/main/resources/sdnctl.dump rename to sdnc-a1-controller/oam/installation/sdnc-a1/src/main/resources/sdnctl.dump diff --git a/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/scripts/healthcheck.py b/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/scripts/healthcheck.py new file mode 100644 index 00000000..35a1d4bb --- /dev/null +++ b/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/scripts/healthcheck.py @@ -0,0 +1,68 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2019 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +# + + +# coding=utf-8 +import os +import httplib +import base64 +import time + +username = os.environ['ODL_ADMIN_USERNAME'] +password = os.environ['ODL_ADMIN_PASSWORD'] +TIMEOUT=1000 +INTERVAL=30 +timePassed=0 + +headers = {'Authorization':'Basic %s' % base64.b64encode(username + ":" + password), + 'X-FromAppId': 'csit-sdnc', + 'X-TransactionId': 'csit-sdnc', + 'Accept':"application/json", + 'Content-type':"application/json"} + +def makeHealthcheckCall(headers, timePassed): + connected = False + # WAIT 10 minutes maximum and test every 30 seconds if HealthCheck API is returning 200 + while timePassed < TIMEOUT: + try: + conn = httplib.HTTPConnection("localhost",8181) + req = conn.request("POST", "/restconf/operations/SLI-API:healthcheck",headers=headers) + res = conn.getresponse() + res.read() + if res.status == 200: + print ("Healthcheck Passed in %d seconds." %timePassed) + connected = True + break + else: + print ("Sleep: %d seconds before testing if Healthcheck worked. Total wait time up now is: %d seconds. Timeout is: %d seconds" %(INTERVAL, timePassed, TIMEOUT)) + except: + print ("Cannot execute REST call. Sleep: %d seconds before testing if Healthcheck worked. Total wait time up now is: %d seconds. Timeout is: %d seconds" %(INTERVAL, timePassed, TIMEOUT)) + timePassed = timeIncrement(timePassed) + + if timePassed > TIMEOUT: + print ("TIME OUT: Healthcheck not passed in %d seconds... Could cause problems for testing activities..." %TIMEOUT) + return connected + + +def timeIncrement(timePassed): + time.sleep(INTERVAL) + timePassed = timePassed + INTERVAL + return timePassed + +makeHealthcheckCall(headers, timePassed) diff --git a/sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/installSdncDb.sh b/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/scripts/installSdncDb.sh similarity index 100% rename from sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/installSdncDb.sh rename to sdnc-a1-controller/oam/installation/sdnc-a1/src/main/scripts/installSdncDb.sh diff --git a/sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/startODL.sh b/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/scripts/startODL.sh similarity index 91% rename from sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/startODL.sh rename to sdnc-a1-controller/oam/installation/sdnc-a1/src/main/scripts/startODL.sh index 9418984b..78d3ea3d 100755 --- a/sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/startODL.sh +++ b/sdnc-a1-controller/oam/installation/sdnc-a1/src/main/scripts/startODL.sh @@ -51,10 +51,8 @@ fi if [ ! -f ${INSTALLED_DIR}/.installed ] then - echo "Installing SDN-C database" + echo "Installing SDNC-A1 database" ${SDNC_HOME}/bin/installSdncDb.sh - echo "Installing SDN-C keyStore" - ${SDNC_HOME}/bin/addSdncKeyStore.sh if [ -x ${SDNC_HOME}/svclogic/bin/install.sh ] then @@ -63,8 +61,6 @@ then fi fi -cp /opt/opendaylight/current/certs/* /tmp - -nohup python ${SDNC_BIN}/installCerts.py & +nohup python ${SDNC_BIN}/healthcheck.py & exec ${ODL_HOME}/bin/karaf server diff --git a/sdnc-a1-controller/oam/installation/sdnc/src/main/resources/truststoreONAPall.jks b/sdnc-a1-controller/oam/installation/sdnc/src/main/resources/truststoreONAPall.jks deleted file mode 100755 index ff844b10..00000000 Binary files a/sdnc-a1-controller/oam/installation/sdnc/src/main/resources/truststoreONAPall.jks and /dev/null differ diff --git a/sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/addSdncKeyStore.sh b/sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/addSdncKeyStore.sh deleted file mode 100755 index c6f0e5ae..00000000 --- a/sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/addSdncKeyStore.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -SDNC_HOME=${SDNC_HOME:-/opt/onap/sdnc} - -keyStoreFile=${SDNC_HOME}/data/stores/sdnc.p12 - -if [ ! -f ${keyStoreFile} ] -then - keytool -genkeypair -dname "CN=SDNC, OU=ONAP, O=ONAP, L=, S=, C=" -alias sdncKey -keyalg RSA -keysize 1024 -keystore $keyStoreFile -storepass adminadmin -storetype pkcs12 -fi - diff --git a/sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/installCerts.py b/sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/installCerts.py deleted file mode 100644 index 17ada4c1..00000000 --- a/sdnc-a1-controller/oam/installation/sdnc/src/main/scripts/installCerts.py +++ /dev/null @@ -1,202 +0,0 @@ -# ============LICENSE_START======================================================= -# Copyright (C) 2019 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 -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# 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. -# -# SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END========================================================= -# - - -# coding=utf-8 -import os -import httplib -import base64 -import time -import zipfile -import shutil - -Path = "/tmp" - -zipFileList = [] - -username = os.environ['ODL_ADMIN_USERNAME'] -password = os.environ['ODL_ADMIN_PASSWORD'] -TIMEOUT=1000 -INTERVAL=30 -timePassed=0 - -postKeystore= "/restconf/operations/netconf-keystore:add-keystore-entry" -postPrivateKey= "/restconf/operations/netconf-keystore:add-private-key" -postTrustedCertificate= "/restconf/operations/netconf-keystore:add-trusted-certificate" - - -headers = {'Authorization':'Basic %s' % base64.b64encode(username + ":" + password), - 'X-FromAppId': 'csit-sdnc', - 'X-TransactionId': 'csit-sdnc', - 'Accept':"application/json", - 'Content-type':"application/json"} - -def readFile(folder, file): - key = open(Path + "/" + folder + "/" + file, "r") - fileRead = key.read() - key.close() - fileRead = "\n".join(fileRead.splitlines()[1:-1]) - return fileRead - -def readTrustedCertificate(folder, file): - listCert = list() - caPem = "" - startCa = False - key = open(Path + "/" + folder + "/" + file, "r") - lines = key.readlines() - for line in lines: - if not "BEGIN CERTIFICATE" in line and not "END CERTIFICATE" in line and startCa: - caPem += line - elif "BEGIN CERTIFICATE" in line: - startCa = True - elif "END CERTIFICATE" in line: - startCa = False - listCert.append(caPem) - caPem = "" - return listCert - -def makeKeystoreKey(clientKey, count): - odl_private_key="ODL_private_key_%d" %count - - json_keystore_key='{{\"input\": {{ \"key-credential\": {{\"key-id\": \"{odl_private_key}\", \"private-key\" : ' \ - '\"{clientKey}\",\"passphrase\" : \"\"}}}}}}'.format( - odl_private_key=odl_private_key, - clientKey=clientKey) - - return json_keystore_key - - - -def makePrivateKey(clientKey, clientCrt, certList, count): - caPem = "" - for cert in certList: - caPem += '\"%s\",' % cert - - caPem = caPem.rsplit(',', 1)[0] - odl_private_key="ODL_private_key_%d" %count - - json_private_key='{{\"input\": {{ \"private-key\":{{\"name\": \"{odl_private_key}\", \"data\" : ' \ - '\"{clientKey}\",\"certificate-chain\":[\"{clientCrt}\",{caPem}]}}}}}}'.format( - odl_private_key=odl_private_key, - clientKey=clientKey, - clientCrt=clientCrt, - caPem=caPem) - - return json_private_key - -def makeTrustedCertificate(certList, count): - number = 0 - json_cert_format = "" - for cert in certList: - cert_name = "xNF_CA_certificate_%d_%d" %(count, number) - json_cert_format += '{{\"name\": \"{trusted_name}\",\"certificate\":\"{cert}\"}},\n'.format( - trusted_name=cert_name, - cert=cert.strip()) - number += 1 - - json_cert_format = json_cert_format.rsplit(',', 1)[0] - json_trusted_cert='{{\"input\": {{ \"trusted-certificate\": [{certificates}]}}}}'.format( - certificates=json_cert_format) - return json_trusted_cert - - -def makeRestconfPost(conn, json_file, apiCall): - req = conn.request("POST", apiCall, json_file, headers=headers) - res = conn.getresponse() - res.read() - if res.status != 200: - print "Error here, response back wasnt 200: Response was : %d , %s" % (res.status, res.reason) - else: - print res.status, res.reason - -def extractZipFiles(zipFileList, count): - for zipFolder in zipFileList: - with zipfile.ZipFile(Path + "/" + zipFolder.strip(),"r") as zip_ref: - zip_ref.extractall(Path) - folder = zipFolder.rsplit(".")[0] - processFiles(folder, count) - -def processFiles(folder, count): - conn = httplib.HTTPConnection("localhost",8181) - for file in os.listdir(Path + "/" + folder): - if os.path.isfile(Path + "/" + folder + "/" + file.strip()): - if ".key" in file: - clientKey = readFile(folder, file.strip()) - elif "trustedCertificate" in file: - certList = readTrustedCertificate(folder, file.strip()) - elif ".crt" in file: - clientCrt = readFile(folder, file.strip()) - else: - print "Could not find file %s" % file.strip() - shutil.rmtree(Path + "/" + folder) - json_keystore_key = makeKeystoreKey(clientKey, count) - json_private_key = makePrivateKey(clientKey, clientCrt, certList, count) - json_trusted_cert = makeTrustedCertificate(certList, count) - - makeRestconfPost(conn, json_keystore_key, postKeystore) - makeRestconfPost(conn, json_private_key, postPrivateKey) - makeRestconfPost(conn, json_trusted_cert, postTrustedCertificate) - -def makeHealthcheckCall(headers, timePassed): - connected = False - # WAIT 10 minutes maximum and test every 30 seconds if HealthCheck API is returning 200 - while timePassed < TIMEOUT: - try: - conn = httplib.HTTPConnection("localhost",8181) - req = conn.request("POST", "/restconf/operations/SLI-API:healthcheck",headers=headers) - res = conn.getresponse() - res.read() - if res.status == 200: - print ("Healthcheck Passed in %d seconds." %timePassed) - connected = True - break - else: - print ("Sleep: %d seconds before testing if Healthcheck worked. Total wait time up now is: %d seconds. Timeout is: %d seconds" %(INTERVAL, timePassed, TIMEOUT)) - except: - print ("Cannot execute REST call. Sleep: %d seconds before testing if Healthcheck worked. Total wait time up now is: %d seconds. Timeout is: %d seconds" %(INTERVAL, timePassed, TIMEOUT)) - timePassed = timeIncrement(timePassed) - - if timePassed > TIMEOUT: - print ("TIME OUT: Healthcheck not passed in %d seconds... Could cause problems for testing activities..." %TIMEOUT) - return connected - - -def timeIncrement(timePassed): - time.sleep(INTERVAL) - timePassed = timePassed + INTERVAL - return timePassed - -def readCertProperties(): - connected = makeHealthcheckCall(headers, timePassed) - - if connected: - count = 0 - if os.path.isfile(Path + "/certs.properties"): - with open(Path + "/certs.properties", "r") as f: - for line in f: - if not "*****" in line: - zipFileList.append(line) - else: - extractZipFiles(zipFileList, count) - count += 1 - del zipFileList[:] - else: - print "Error: File not found in path entered" - -readCertProperties() diff --git a/sdnc-a1-controller/oam/installation/src/main/properties/org.onap.sdnc.cred.props b/sdnc-a1-controller/oam/installation/src/main/properties/org.onap.sdnc.cred.props deleted file mode 100644 index 88983837..00000000 --- a/sdnc-a1-controller/oam/installation/src/main/properties/org.onap.sdnc.cred.props +++ /dev/null @@ -1,17 +0,0 @@ -############################################################ -# Properties Generated by AT&T Certificate Manager -# by ubuntu -# on 2019-04-26T17:48:02.614+0000 -# @copyright 2019, AT&T -############################################################ -Challenge=enc:YLFZL0xwmf-22zzHjNwMDus4xQhhjOO_HERh0LisPjGFMODJtM77jjh7EctH-Pme -cadi_alias=sdnc@sdnc.onap.org -cadi_key_password=enc:fbgVR_kMh7wuaEfm16VlW84HJR_yiob_CUf3oDXSE0K2yPlp0t55xT335GMh8ZSv -cadi_keyfile=/opt/sdnc/data/stores/org.onap.sdnc.keyfile -cadi_keystore=/opt/sdnc/data/stores/org.onap.sdnc.p12 -cadi_keystore_password=enc:xAl_o-JBdI86B4pDUNyrY9IauP54ecsXLUZYl_9p9R4Roybcnppqwwkdp_wJq1Ir -cadi_keystore_password_jks=enc:Qf5-2ZRKRMYBwvO14qENypmu4A1HNjkdu_KkM0N5i7v7QjC_GmshNrYmmeWLQWIr -cadi_keystore_password_p12=enc:xAl_o-JBdI86B4pDUNyrY9IauP54ecsXLUZYl_9p9R4Roybcnppqwwkdp_wJq1Ir -cadi_truststore=/opt/sdnc/data/stores/org.onap.sdnc.trust.jks -cadi_truststore_password=enc:U-tuJC67-g5WkC4o8aYf-zqxfB-u2ep3NcB9CZt3VfGCP_NhTWFYVx8mCL3S-jhU -cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US diff --git a/sdnc-a1-controller/oam/installation/src/main/properties/org.onap.sdnc.props b/sdnc-a1-controller/oam/installation/src/main/properties/org.onap.sdnc.props deleted file mode 100644 index 5b96b907..00000000 --- a/sdnc-a1-controller/oam/installation/src/main/properties/org.onap.sdnc.props +++ /dev/null @@ -1,15 +0,0 @@ -############################################################ -# Properties Generated by AT&T Certificate Manager -# by root -# on 2019-02-15T20:08:07.125+0000 -# @copyright 2016, AT&T -############################################################ -aaf_id=sdnc@sdnc.onap.org -aaf_locate_url=https://aaf-onap-test.osaaf.org:8095 -aaf_url=https://AAF_LOCATE_URL/AAF_NS.service:2.1 -cadi_etc_dir=/opt/sdnc/data/stores -cadi_latitude=38.432899 -cadi_longitude=-90.43248 -cadi_prop_files=/opt/sdnc/data/properties/org.onap.sdnc.cred.props -cm_url=https://AAF_LOCATE_URL/AAF_NS.cm:2.1 -cadi_bath_convert=/opt/sdnc/data/properties/bath_config.csv diff --git a/sdnc-a1-controller/oam/installation/src/main/stores/keystore.sdnc.p12 b/sdnc-a1-controller/oam/installation/src/main/stores/keystore.sdnc.p12 deleted file mode 100644 index 8fb4e2cd..00000000 Binary files a/sdnc-a1-controller/oam/installation/src/main/stores/keystore.sdnc.p12 and /dev/null differ diff --git a/sdnc-a1-controller/oam/installation/src/main/stores/org.onap.sdnc.keyfile b/sdnc-a1-controller/oam/installation/src/main/stores/org.onap.sdnc.keyfile deleted file mode 100644 index 4bbb0abc..00000000 --- a/sdnc-a1-controller/oam/installation/src/main/stores/org.onap.sdnc.keyfile +++ /dev/null @@ -1,27 +0,0 @@ -ssTXV3XxGHmaZ_tDK60bUUwJMidA6-cMQbn8EVO1HWhwTS3vhftirZkfE-Ymv0xkhB82LT05cTjv -MnM6E_OU8ZzQtNCb0XTTsOU-xTExWuIJzgfTKDanH14OB83r-pM0Q1z3iOjgIZyKNn7Qtl-7FyJu -Fr6bmPKFMMSDROwH347eYBpunVPIa1X0NNqJcHDQsWFhW0bgsfRMnP3XZNltqbuAFZocYsY3Tk5N -Iz52WXz6-nSWYBO0sPuBUZmkck1zKZ9PMn2SAPYx1V3i1-kOBLE6AHj-ad7e_dnJjdSTrjhG5z81 -QtmwAevh2ROCdNXTeyurrGXaLrMluE9csSVIp0YCCuhUCX02oDQBqIY5IDIQtAIXS8_i2bJWwmMv -tZOTavGZH1_nwyQQ60lWF8w0GtL1m-s1SVH5v8VunYrjdnwFsrwUkKWfmz70OWFy6RwRis4IL434 -ln0RY48K-E_93jw3pbV4vZFTo8-RO59DGr_0pZf7ZhDSNrdy8sMpaSeHjjrVMfD5TI-JWDdzaKhi -edKGZN_MZLfgPKwXTfXLDQKxowLUoDpEKfAj_KSOAdTCB2piala6Ht3FM5zfXFY7PnYgDho1fe2j -nSWQhN6BqMr4LVKCLVonIiiAgyEetseUnW5_FCcFJALhfEKG4CHI0TvbRZ9IG7SwEFBovrk3RkBv --UHxqqUAi9W3Zdm6wmYtSsUaT-lmMomJxHigWn9vCJ6fO0r_KSoGo-u8idP8P989hNdLqKx6sVWa -en-Kyf0YUvYUk6TblucGVG0UYpjqMAr64tA2_a595QWriVRsxFWTZXBiXWUrOtbXxYZ6vn4jLomF -KWAOu7ot-SQa9zAAAgIme5VB3I2h9s0mUOsQd-T1fJq_CdAGzyqXmBwt8TO4G8iQCMUtOptxJ220 -dq_unPUWJylDuU_9fTY95PLSIGfTCwOedOJb5A9IvyN_mahSPZqYH3a0P6gOgHPxQfTrUid31u7a -BqsQdKKMoWCT7ZdX-ja95f3Z3PzHxhlI2dr1nCRBkN89GLyIK70dVN2QTVVWV5B4hLoyrON6QVwy -1csZ1X6UGO-4YOX3_GUacJSnCenZzJFbn3moCkZ-QfpwU7Cqq2I7DEa8bDKz1sdeNtycOxiQnmnA -AnVdXfOavctGcpA6tWyj-WAkZvV6yedt6Kb4BPL5_qDsCNa0r1wYNaQqzH1bYQnJu0aVjspTzlj4 -2ik_2i9t36Avoqj_g3e8fvwmF0r__yPpF2oULa4LcIQ8Cs3U9Oq3BmxlNXlEj7dyNOTIlJLcvrzX -Js_5iv5rA_rIWY7YpOc-UCVrZw3yb8Ih-XI4tNuUn3qE7tHHQclWrrYRVM2Jt_u-73WYqL-iCvwQ -BU5soWkSK5TwgR1BHfDs5-yNh1MRnr9RbNd8x_p3ohQrFtepgBHodTl98er9XANCy-HycLZhDP3D -TUQdWVKxAwDFVBB-p6itYB9oVvkQtSosLQUYcAjbMTrFz4zqOj0CHMvquE-Wbznkayo5ZdvKoPXk -loNtiG4qPx3UXpvfHElps-vPi8y1TlcmwqWEOn2vxKd5IIk2fglHXM9tv2m86XRgvTjppSs1V7NS -Uoz_C_bW8zH5D-Twmq2DGHxuKbpUpqe0FDFXxoQezGCVhN6bzp-44CBkz9I9QeNVkm3XFu8s2fDn -PeP2B_hGxkLhJHAJ28_3zZex818zqvFW-flWY43w6Cke8qWns3gxdyvXLUTluoidkFdTEvMBPIos -itOB1MsLxsZNdAZtn3vxANPm7dTf8YIAJdMYH6yL9G83PxgKZ8uhoIZIsbrV2UWOJMLH8agctEZI -pFqCipM8RZwuZwq7JmTYPyIjUDVTvAmiLJbG127T9eAfrZa2TYDWaE469v9f-7MdTD4_PK2JSogD -8dg30EruD1VwQq03M98hL9EQsRNwAZ4MAshE2Kp3jQje2A-ZxGtMKNiw6DV0j3BM42FBitpV-Ley -UaqWwELwDh7-BFmUeCu_RSP4XwrTUcOV725yIYcGkk06wLahMf2UvFzYS3PAmZLrs4fvLMK5 \ No newline at end of file diff --git a/sdnc-a1-controller/oam/installation/src/main/stores/org.onap.sdnc.p12 b/sdnc-a1-controller/oam/installation/src/main/stores/org.onap.sdnc.p12 deleted file mode 100644 index 079ee67a..00000000 Binary files a/sdnc-a1-controller/oam/installation/src/main/stores/org.onap.sdnc.p12 and /dev/null differ diff --git a/sdnc-a1-controller/oam/installation/src/main/stores/org.onap.sdnc.trust.jks b/sdnc-a1-controller/oam/installation/src/main/stores/org.onap.sdnc.trust.jks deleted file mode 100644 index e1f2e570..00000000 Binary files a/sdnc-a1-controller/oam/installation/src/main/stores/org.onap.sdnc.trust.jks and /dev/null differ diff --git a/sdnc-a1-controller/oam/installation/src/main/stores/truststore.onap.client.jks b/sdnc-a1-controller/oam/installation/src/main/stores/truststore.onap.client.jks deleted file mode 100755 index 28afd8fa..00000000 Binary files a/sdnc-a1-controller/oam/installation/src/main/stores/truststore.onap.client.jks and /dev/null differ diff --git a/sdnc-a1-controller/oam/installation/src/main/stores/truststore.openecomp.client.jks b/sdnc-a1-controller/oam/installation/src/main/stores/truststore.openecomp.client.jks deleted file mode 100644 index 6c854b4c..00000000 Binary files a/sdnc-a1-controller/oam/installation/src/main/stores/truststore.openecomp.client.jks and /dev/null differ diff --git a/sdnc-a1-controller/oam/installation/src/main/yaml/docker-compose.yml b/sdnc-a1-controller/oam/installation/src/main/yaml/docker-compose.yml index acf15a13..70513515 100644 --- a/sdnc-a1-controller/oam/installation/src/main/yaml/docker-compose.yml +++ b/sdnc-a1-controller/oam/installation/src/main/yaml/docker-compose.yml @@ -47,6 +47,7 @@ services: entrypoint: ["/opt/onap/sdnc/bin/startODL.sh"] ports: - "8282:8181" + - "8383:8443" links: - db:dbhost - db:sdnctldb01 diff --git a/sdnc-a1-controller/oam/platform-logic/installer/pom.xml b/sdnc-a1-controller/oam/platform-logic/installer/pom.xml index 668c5b02..77fb72c6 100644 --- a/sdnc-a1-controller/oam/platform-logic/installer/pom.xml +++ b/sdnc-a1-controller/oam/platform-logic/installer/pom.xml @@ -28,12 +28,12 @@ - org.onap.sdnc.oam + org.o-ran-sc.nonrtric.sdnc-a1.oam platform-logic-installer 1.7.3-SNAPSHOT pom - sdnc-oam :: platform-logic :: ${project.artifactId} + sdnc-a1-oam :: platform-logic :: ${project.artifactId} Contains platform-level service logic installer diff --git a/sdnc-a1-controller/oam/platform-logic/pom.xml b/sdnc-a1-controller/oam/platform-logic/pom.xml index 2644861d..c4f3e8fe 100644 --- a/sdnc-a1-controller/oam/platform-logic/pom.xml +++ b/sdnc-a1-controller/oam/platform-logic/pom.xml @@ -28,12 +28,12 @@ - org.onap.sdnc.oam + org.o-ran-sc.nonrtric.sdnc-a1.oam platform-logic 1.7.3-SNAPSHOT pom - sdnc-oam :: platform-logic + sdnc-a1-oam :: platform-logic Contains platform-level service logic ONAP diff --git a/sdnc-a1-controller/oam/platform-logic/setup/pom.xml b/sdnc-a1-controller/oam/platform-logic/setup/pom.xml index 68e506ce..4b8b3543 100644 --- a/sdnc-a1-controller/oam/platform-logic/setup/pom.xml +++ b/sdnc-a1-controller/oam/platform-logic/setup/pom.xml @@ -28,12 +28,12 @@ - org.onap.sdnc.oam + org.o-ran-sc.nonrtric.sdnc-a1.oam platform-logic-setup 1.7.3-SNAPSHOT pom - sdnc-oam :: platform-logic :: ${project.artifactId} + sdnc-a1-oam :: platform-logic :: ${project.artifactId} Copies base ONAP platform-logic diff --git a/sdnc-a1-controller/oam/pom.xml b/sdnc-a1-controller/oam/pom.xml index 6ac9f907..8cc1cabc 100755 --- a/sdnc-a1-controller/oam/pom.xml +++ b/sdnc-a1-controller/oam/pom.xml @@ -27,12 +27,12 @@ 1.4.3 - org.onap.sdnc.oam - sdnc-oam + org.o-ran-sc.nonrtric.sdnc-a1.oam + sdnc-a1-oam 1.7.3-SNAPSHOT pom - sdnc-oam + sdnc-a1-oam The SDN-C OAM component contains the components needed to operate, administer and maintain the SDN-C platform. https://wiki.onap.org @@ -43,27 +43,6 @@ platform-logic - - scm:git:ssh://git@${onap.git.host}/sdnc-oam.git - scm:git:ssh://${onap.git.host}:${onap.git.port}/${onap.git.project}/sdnc-oam.git - ${onap.git.protocol}://${onap.git.host}/projects/${onap.git.project}/repos/sdnc-oam/browse - HEAD - - - JIRA - https://jira.onap.org/ - - - Jenkins - https://jenkins.onap.org/ - - - - sdnc-javadoc - dav:https://${onap.nexus.host}:${onap.nexus.port}/repository/sdn-c-javadoc/${project.artifactId}/${project.version} - - - diff --git a/sdnc-a1-controller/pom.xml b/sdnc-a1-controller/pom.xml index f2decfd9..96ca1a5d 100644 --- a/sdnc-a1-controller/pom.xml +++ b/sdnc-a1-controller/pom.xml @@ -23,12 +23,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.onap.sdnc - sdnc + org.o-ran-sc.nonrtric.sdnc-a1 + sdnc-a1 1.7.4-SNAPSHOT pom - sdnc + sdnc-a1 3.7.0.1746