.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2020 Nordix
.. |nbsp| unicode:: 0xA0
:trim:
.. _policy-agent-api:
-############################
-A1 Policy Management Service
-############################
+################################
+A1 Policy Management Service API
+################################
*******************************************
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
-.. contents:: Operations
- :depth: 4
- :local:
-
-
+******************
Service Management
-==================
+******************
A service can register itself in the Policy Agent.
"*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
~~~~~~~~
PUT
+++
- Register a service.
+Register a service.
- **URL path:**
- /service
+Definition
+""""""""""
- **Parameters:**
+**URL path:**
- None.
+/service
- **Body:** (*Required*)
- A JSON object (ServiceRegistrationInfo): ::
+**Parameters:**
- {
- "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.)
- }
+None.
+
+**Body:** (*Required*)
+
+A JSON object (ServiceRegistrationInfo): ::
+
+ {
+ "callbackUrl": "string", (An empty string means the service will never get any callbacks.)
+ "keepAliveIntervalSeconds": 0, (0 means the service will always be considered alive.)
+ "serviceName": "string" (Required, must be unique.)
+ }
+
+**Responses:**
+
+200:
+
+Service updated.
+
+201:
- **Responses:**
+Service created.
- 200:
- Service updated.
+400:
- 201:
- Service created.
+The ServiceRegistrationInfo is not accepted.
- 400:
- Something went wrong with the service registration.
+Examples
+""""""""
- **Examples:**
+**Call**: ::
- Call: ::
+ curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d '{
+ "callbackUrl": "URL",
+ "keepAliveIntervalSeconds": 0,
+ "serviceName": "existing"
+ }'
- curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d "{
- \"callbackUrl\": \"URL\",
- \"keepAliveIntervalSeconds\": 0,
- \"serviceName\": \"existing\"
- }"
+**Result**:
- Result:
- 201: ::
+201: ::
- OK
+ OK
- Call: ::
+**Call**: ::
- curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d "{}"
+ curl -X PUT "http://localhost:8081/service" -H "Content-Type: application/json" -d "{}"
- Result:
- 400: ::
+**Result**:
- Missing mandatory parameter 'serviceName'
+400: ::
+
+ Missing mandatory parameter 'serviceName'
/services
~~~~~~~~~
GET
+++
- Query service information.
+Query service information.
+
+Definition
+""""""""""
+
+**URL path:**
+
+/services?name=<service-name>
- **URL path:**
- /services?name=<service-name>
+**Parameters:**
- **Parameters:**
+name: (*Optional*)
- name: (*Optional*)
- The name of the service.
+The name of the service.
- **Responses:**
+**Responses:**
- 200:
- Array of JSON objects (ServiceStatus). ::
+200:
- {
- "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)
- }
+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.
+404:
- **Examples:**
+Service is not found.
- Call: ::
+Examples
+""""""""
- curl -X GET "http://localhost:8081/services?name=existing"
+**Call**: ::
- Result:
- 200: ::
+ curl -X GET "http://localhost:8081/services?name=existing"
- [
- {
- "serviceName":"existing",
- "keepAliveIntervalSeconds":0,
- "timeSinceLastActivitySeconds":7224,
- "callbackUrl":"URL"
- }
- ]
+**Result**:
- Call: ::
+200: ::
- curl -X GET "http://localhost:8081/services?name=nonexistent"
+ [
+ {
+ "serviceName":"existing",
+ "keepAliveIntervalSeconds":0,
+ "timeSinceLastActivitySeconds":7224,
+ "callbackUrl":"URL"
+ }
+ ]
- Result:
- 404: ::
+**Call**: ::
- Service not found
+ curl -X GET "http://localhost:8081/services?name=nonexistent"
+
+Result:
+
+404: ::
+
+ Service not found
DELETE
++++++
- Delete a service.
+Delete a service.
+
+Definition
+""""""""""
+
+**URL path:**
+
+/services?name=<service-name>
- **URL path:**
- /services?name=<service-name>
+**Parameters:**
- **Parameters:**
+name: (*Required*)
- name: (*Required*)
- The name of the service.
+The name of the service.
- **Responses:**
+**Responses:**
- 204:
- OK
+204:
+ OK
- 404:
- Service not found.
+404:
+ Service not found.
- **Examples:**
+Examples
+""""""""
- Call: ::
+**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
~~~~~~~~~~~~~~~~~~~
-POST
-++++
+PUT
++++
+
+Heart beat from a service.
+
+Definition
+""""""""""
+
+**URL path:**
- Heart beat from a service.
+/services/keepalive?name=<service-name>
- **URL path:**
- /services/keepalive?name=<service-name>
+**Parameters:**
- **Parameters:**
+name: (*Required*)
- name: (*Required*)
- The name of the service.
+The name of the service.
- **Responses:**
+**Responses:**
- 200:
- OK
+200:
- 404:
- Service is not found.
+OK
- **Examples:**
+404:
- Call: ::
+Service is not found.
- curl -X POST "http://localhost:8081/services/keepalive?name=existing"
+Examples
+""""""""
- Result:
- 200: ::
+**Call**: ::
- OK
+ curl -X PUT "http://localhost:8081/services/keepalive?name=existing"
- Call: ::
+**Result**:
- curl -X POST "http://localhost:8081/services/keepalive?name=nonexistent"
+200: ::
- Result:
- 404: ::
+ OK
- Could not find service: nonexistent
+**Call**: ::
+
+ 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
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
GET
+++
- Query policy type names.
+Query policy type names.
+
+Definition
+""""""""""
- **URL path:**
- /policy_types?ric=<name-of-ric>
+**URL path:**
- **Parameters:**
+/policy_types?ric=<name-of-ric>
- ric: (*Optional*)
- The name of the Near |nbh| RT |nbsp| RIC to get types for.
+**Parameters:**
- **Responses:**
+ric: (*Optional*)
- 200:
- Array of policy type names.
+The name of the Near |nbh| RT |nbsp| RIC to get types for.
- 404:
- Near |nbh| RT |nbsp| RIC is not found.
+**Responses:**
- **Examples:**
+200:
- Call: ::
+ Array of policy type names.
- curl -X GET "http://localhost:8081/policy_types"
+404:
- Result:
- 200: ::
+ Near |nbh| RT |nbsp| RIC is not found.
- [
- "STD_PolicyModelUnconstrained_0.2.0",
- "Example_QoETarget_1.0.0",
- "ERIC_QoSNudging_0.2.0"
- ]
+Examples
+""""""""
- Call: ::
+**Call**: ::
- curl -X GET "http://localhost:8081/policy_types?ric=nonexistent"
+ curl -X GET "http://localhost:8081/policy_types"
- Result:
- 404: ::
+**Result**:
- org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent
+200: ::
+
+ [
+ "STD_PolicyModelUnconstrained_0.2.0",
+ "Example_QoETarget_1.0.0",
+ "ERIC_QoSNudging_0.2.0"
+ ]
+
+**Call**: ::
+
+ curl -X GET "http://localhost:8081/policy_types?ric=nonexistent"
+
+**Result**:
+
+404: ::
+
+ org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent
/policy_schema
~~~~~~~~~~~~~~
GET
+++
- Returns one policy type schema definition.
+Returns one policy type schema definition.
+
+Definition
+""""""""""
- **URL path:**
- /policy_schema?id=<name-of-type>
+**URL path:**
- **Parameters:**
+/policy_schema?id=<name-of-type>
- id: (*Required*)
- The ID of the policy type to get the definition for.
+**Parameters:**
- **Responses:**
+id: (*Required*)
- 200:
- Policy schema as JSON schema.
+The ID of the policy type to get the definition for.
- 404:
- Policy type is not found.
+**Responses:**
- **Examples:**
+200:
- Call: ::
+Policy schema as JSON schema.
- curl -X GET "http://localhost:8081/policy_schema?id=STD_PolicyModelUnconstrained_0.2.0"
+404:
- Result:
- 200: ::
+Policy type is not found.
- {
- "$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",
+Examples
+""""""""
+
+**Call**: ::
+
+ curl -X GET "http://localhost:8081/policy_schema?id=STD_PolicyModelUnconstrained_0.2.0"
+
+**Result**:
+
+200: ::
+
+ {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "title": "STD_PolicyModelUnconstrained_0.2.0",
+ "description": "Standard model of a policy with unconstrained scope id combinations",
+ "type": "object",
+ "properties": {
+ "scope": {
+ "type": "object",
+ "properties": {
+ "ueId": {"type": "string"},
+ "groupId": {"type": "string"}
+ },
+ "minProperties": 1,
+ "additionalProperties": false
+ },
+ "qosObjectives": {
+ "type": "object",
+ "properties": {
+ "gfbr": {"type": "number"},
+ "mfbr": {"type": "number"}
+ },
+ "additionalProperties": false
+ },
+ "resources": {
+ "type": "array",
+ "items": {
"type": "object",
"properties": {
- "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": {
+ "cellIdList": {
"type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
"items": {
- "type": "object",
- "properties": {
- "cellIdList": {
- "type": "array",
- "minItems": 1,
- "uniqueItems": true,
- "items": {
- "type": "string"
- }
- },
- "additionalProperties": false,
- "required": ["cellIdList"]
+ "type": "string"
}
- }
- },
- "minProperties": 1,
+ },
"additionalProperties": false,
- "required": ["scope"]
+ "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
~~~~~~~~~~~~~~~
GET
+++
- Returns policy type schema definitions.
+Returns policy type schema definitions.
- **URL path:**
- /policy_schemas?ric=<name-of-ric>
+Definition
+""""""""""
- **Parameters:**
+**URL path:**
- ric: (*Optional*)
- The name of the Near |nbh| RT |nbsp| RIC to get the definitions for.
+/policy_schemas?ric=<name-of-ric>
- **Responses:**
+**Parameters:**
- 200:
- An array of policy schemas as JSON schemas.
+ric: (*Optional*)
- 404:
- Near |nbh| RT |nbsp| RIC is not found.
+The name of the Near |nbh| RT |nbsp| RIC to get the definitions for.
- **Examples:**
+**Responses:**
- 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",
- .
- .
- .
- "additionalProperties": false,
- "required": ["scope"]
- },
- .
- .
- .
- {
- "$schema": "http://json-schema.org/draft-07/schema#",
- "title": "Example_QoETarget_1.0.0",
- "description": "Example QoE Target policy type",
+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": {
+ "scope": {
"type": "object",
- .
- .
- .
- "additionalProperties": false,
- "required": ["scope"]
- }]
+ .
+ .
+ .
+ }
+ "additionalProperties": false,
+ "required": ["scope"]
+ }
+ }
+ }
+ ]
- Call:
- curl -X GET "http://localhost:8081/policy_schemas?ric=nonexistent"
+**Call**: ::
- Result:
- 404: ::
+ curl -X GET "http://localhost:8081/policy_schemas?ric=nonexistent"
- org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent
+**Result**:
-Policy
-------
+404: ::
+
+ org.oransc.policyagent.exceptions.ServiceException: Could not find ric: nonexistent
+
+*****************
+Policy Management
+*****************
+
+Policies can be queried, created, updated, and deleted. A policy is always created in a specific
+Near |nbh| RT |nbsp| RIC.
+
+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.
GET
+++
- Query policies.
+Query policies.
- **URL path:**
- /policies?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-type>
+Definition
+""""""""""
- **Parameters:**
+**URL path:**
- ric: (*Optional*)
- The name of the Near |nbh| RT |nbsp| RIC to get policies for.
+/policies?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-type>
- service: (*Optional*)
- The name of the service to get policies for.
+**Parameters:**
- type: (*Optional*)
- The name of the policy type to get policies for.
+ric: (*Optional*)
- **Responses:**
+The name of the Near |nbh| RT |nbsp| RIC to get policies for.
- 200:
- Array of JSON objects (PolicyInfo). ::
+service: (*Optional*)
- {
- "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)
- }
+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
+404:
+ Near |nbh| RT |nbsp| RIC or policy type not found.
+
+Examples
+""""""""
+
+**Call**: ::
+
+ curl -X GET "http://localhost:8081/policies?ric=existing"
+
+**Result**:
+
+200: ::
+
+ [
+ {
+ "id": "Policy 1",
+ "json": {
+ "scope": {
+ "ueId": "UE 1",
+ "groupId": "Group 1"
+ },
+ "qosObjectives": {
+ "gfbr": 1,
+ "mfbr": 2
+ },
+ "cellId": "Cell 1"
+ },
+ "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT",
+ "ric": "existing",
+ "service": "Service 1",
+ "type": "STD_PolicyModelUnconstrained_0.2.0"
+ },
+ {
+ "id": "Policy 2",
+ "json": {
+ .
+ .
+ .
+ },
+ "lastModified": "Wed, 01 Apr 2020 07:45:45 GMT",
+ "ric": "existing",
+ "service": "Service 2",
+ "type": "Example_QoETarget_1.0.0"
+ }
+ ]
+
+**Call**: ::
+
+ curl -X GET "http://localhost:8081/policies?type=nonexistent"
+
+**Result**:
+
+404: ::
+
+ Policy type not found
/policy
~~~~~~~
GET
+++
- Returns a policy configuration.
+Returns a policy configuration.
- **URL path:**
- /policy?id=<policy-id>
+Definition
+""""""""""
- **Parameters:**
+**URL path:**
- id: (*Required*)
- The ID of the policy instance.
+/policy?id=<policy-id>
- **Responses:**
+**Parameters:**
- 200:
- JSON object containing policy information. ::
+id: (*Required*)
- {
- "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)
- }
+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"
- 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
+**Result**:
+
+404: ::
+
+ Policy is not found
PUT
+++
- Create/Update a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a
- "*Keep Alive Interval*" registered.
+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=<policy-id>&ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-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*)
- **URL path:**
- /policy?id=<policy-id>&ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type>
+The name of the policy type.
- **Parameters:**
+**Body:** (*Required*)
- id: (*Required*)
- The ID of the policy instance.
+A JSON object containing the data specified by the type.
- ric: (*Required*)
- The name of the Near |nbh| RT |nbsp| RIC where the policy will be created.
+**Responses:**
- service: (*Required*)
- The name of the service creating the policy.
+200:
- type: (*Optional*)
- The name of the policy type.
+Policy updated.
- **Body:** (*Required*)
- A JSON object containing the data specified by the type.
+201:
- **Responses:**
+Policy created.
- 200:
- Policy updated.
+404:
- 201:
- Policy created.
+Near |nbh| RT |nbsp| RIC or policy type is not found.
- 404:
- Near |nbh| RT |nbsp| RIC or policy type is not found.
+423:
- 423:
- Near |nbh| RT |nbsp| RIC is locked.
+Near |nbh| RT |nbsp| RIC is not operational.
- **Examples:**
+Examples
+""""""""
- Call: ::
+**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\": []
- }"
+ 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**:
- Result:
- 200
+200
DELETE
++++++
- Deletes a policy. **Note!** Calls to this method will also trigger "*Keep Alive*" for a service which has a
- "*Keep Alive Interval*" registered.
+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>
- **URL path:**
- /policy?id=<policy-id>
+**Parameters:**
- **Parameters:**
+id: (*Required*)
- id: (*Required*)
- The ID of the policy instance.
+The ID of the policy instance.
- **Responses:**
+**Responses:**
- 204:
- Policy deleted.
+204:
- 404:
- Policy is not found.
+Policy deleted.
- **Examples:**
+404:
- Call: ::
+Policy is not found.
- curl -X DELETE "http://localhost:8081/policy?id=Policy 1"
+423:
- Result:
- 204
+Near |nbh| RT |nbsp| RIC is not operational.
+
+Examples
+""""""""
+
+**Call**: ::
+
+ curl -X DELETE "http://localhost:8081/policy?id=Policy 1"
+
+**Result**:
+
+204
/policy_ids
~~~~~~~~~~~
GET
+++
- Query policy type IDs.
+Query policy type IDs.
+
+Definition
+""""""""""
+
+**URL path:**
- **URL path:**
- /policy_ids?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type>
+/policy_ids?ric=<name-of-ric>&service=<name-of-service>&type=<name-of-policy-type>
- **Parameters:**
+**Parameters:**
- ric: (*Optional*)
- The name of the Near |nbh| RT |nbsp| RIC to get policies for.
+ric: (*Optional*)
- service: (*Optional*)
- The name of the service to get policies for.
+The name of the Near |nbh| RT |nbsp| RIC to get policies for.
- type: (*Optional*)
- The name of the policy type to get policies for.
+service: (*Optional*)
- **Responses:**
+The name of the service to get policies for.
- 200:
- Array of policy type names.
+type: (*Optional*)
- 404:
- RIC or policy type not found.
+The name of the policy type to get policies for.
- **Examples:**
+**Responses:**
- Call: ::
+200:
- curl -X GET "http://localhost:8081/policy_ids"
+Array of policy type names.
- Result:
- 200: ::
+404:
- [
- "Policy 1",
- "Policy 2",
- "Policy 3"
- ]
+RIC or policy type not found.
- Call: ::
+Examples
+""""""""
- curl -X GET "http://localhost:8081/policy_ids?ric=nonexistent"
+**Call**: ::
- Result:
- 404: ::
+ curl -X GET "http://localhost:8081/policy_ids"
- Ric not found
+**Result**:
+
+200: ::
+
+ [
+ "Policy 1",
+ "Policy 2",
+ "Policy 3"
+ ]
+
+**Call**: ::
+
+ curl -X GET "http://localhost:8081/policy_ids?ric=nonexistent"
+
+**Result**:
+
+404: ::
+
+ Ric not found
/policy_status
~~~~~~~~~~~~~~
GET
+++
- Returns the status of a policy.
+Returns the status of a policy.
- **URL path:**
- /policy_status?id=<policy-id>
+Definition
+""""""""""
- **Parameters:**
+**URL path:**
- id: (*Required*)
- The ID of the policy.
+/policy_status?id=<policy-id>
- **Responses:**
+**Parameters:**
- 200:
- JSON object with policy status.
+id: (*Required*)
- 404:
- Policy not found.
+The ID of the policy.
+**Responses:**
+
+200:
+
+JSON object with policy status.
+
+404:
+
+Policy not found.
+
+**********************
Near-RT RIC Repository
-======================
+**********************
The Policy Agent keeps an updated view of the Near |nbh| RT |nbsp| RICs that are available in the system. A service can
find out which Near |nbh| RT |nbsp| RIC that manages a specific element in the network or which
Near |nbh| RT |nbsp| RICs that support a specific policy type.
-Near-RT RIC
------------
-
/ric
~~~~
GET
+++
- Returns the name of a Near |nbh| RT |nbsp| RIC managing a specific Mananged Element.
+Returns the name of a Near |nbh| RT |nbsp| RIC managing a specific Mananged Element.
- **URL path:**
- /ric?managedElementId=<id-of-managed-element>
+Definition
+""""""""""
- **Parameters:**
+**URL path:**
- managedElementId: (*Optional*)
- The ID of the Managed Element.
+/ric?managedElementId=<id-of-managed-element>
- **Responses:**
+**Parameters:**
- 200:
- Name of the Near |nbh| RT |nbsp| RIC managing the Managed Element.
+managedElementId: (*Required*)
- 404:
- No Near |nbh| RT |nbsp| RIC manages the given Managed Element.
+The ID of the Managed Element.
- **Examples:**
+**Responses:**
- Call: ::
+200:
- curl -X GET "http://localhost:8081/ric?managedElementId=Node 1"
+Name of the Near |nbh| RT |nbsp| RIC managing the Managed Element.
- Result:
- 200: ::
+404:
- Ric 1
+No Near |nbh| RT |nbsp| RIC manages the given Managed Element.
- Call: ::
+Examples
+""""""""
- curl -X GET "http://localhost:8081/ric?managedElementId=notmanaged"
+**Call**: ::
- Result:
- 404
+ curl -X GET "http://localhost:8081/ric?managedElementId=Node 1"
+
+**Result**:
+
+200: ::
+
+ Ric 1
+
+**Call**: ::
+
+ curl -X GET "http://localhost:8081/ric?managedElementId=notmanaged"
+
+**Result**:
+
+404
/rics
~~~~~
GET
+++
- Query Near |nbh| RT |nbsp| RIC information.
+Query Near |nbh| RT |nbsp| RIC information.
- **URL path:**
- /rics?policyType=<name-of-policy-type>
+Definition
+""""""""""
- **Parameters:**
+**URL path:**
- policyType: (*Optional*)
- The name of the policy type.
+/rics?policyType=<name-of-policy-type>
- **Responses:**
+**Parameters:**
- 200:
- Array of JSON objects containing Near |nbh| RT |nbsp| RIC information. ::
+policyType: (*Optional*)
- [
- {
- "managedElementIds": [
- "string"
- ],
- "policyTypes": [
- "string"
- ],
- "ricName": "string"
- }
- ]
+The name of the policy type.
- 404:
- Policy type is not found.
+**Responses:**
- **Examples:**
+200:
- Call: ::
+Array of JSON objects containing Near |nbh| RT |nbsp| RIC information. ::
- curl -X GET "http://localhost:8081/rics?policyType=STD_PolicyModelUnconstrained_0.2.0"
+ [
+ {
+ "managedElementIds": [
+ "string"
+ ],
+ "policyTypes": [
+ "string"
+ ],
+ "ricName": "string",
+ "state": "string"
+ }
+ ]
- Result:
- 200: ::
+404:
- [
- {
- "managedElementIds": [
- "ME 1",
- "ME 2"
- ],
- "policyTypes": [
- "STD_PolicyModelUnconstrained_0.2.0",
- "Example_QoETarget_1.0.0",
- "ERIC_QoSNudging_0.2.0"
- ],
- "ricName": "Ric 1"
- },
- .
- .
- .
- {
- "managedElementIds": [
- "ME 3"
- ],
- "policyTypes": [
- "STD_PolicyModelUnconstrained_0.2.0"
- ],
- "ricName": "Ric X"
- }
- ]
+Policy type is not found.
- Call: ::
+Examples
+""""""""
- curl -X GET "http://localhost:8081/rics?policyType=nonexistent"
+**Call**: ::
- Result:
- 404: ::
+ curl -X GET "http://localhost:8081/rics?policyType=STD_PolicyModelUnconstrained_0.2.0"
- Policy type not found
+**Result**:
-Health Check
-============
+200: ::
-The status of the Policy Agent.
+ [
+ {
+ "managedElementIds": [
+ "ME 1",
+ "ME 2"
+ ],
+ "policyTypes": [
+ "STD_PolicyModelUnconstrained_0.2.0",
+ "Example_QoETarget_1.0.0",
+ "ERIC_QoSNudging_0.2.0"
+ ],
+ "ricName": "Ric 1",
+ "state": "AVAILABLE"
+ },
+ .
+ .
+ .
+ {
+ "managedElementIds": [
+ "ME 3"
+ ],
+ "policyTypes": [
+ "STD_PolicyModelUnconstrained_0.2.0"
+ ],
+ "ricName": "Ric X",
+ "state": "UNAVAILABLE"
+ }
+ ]
+**Call**: ::
+
+ curl -X GET "http://localhost:8081/rics?policyType=nonexistent"
+
+**Result**:
+
+404: ::
+
+ Policy type not found
+
+************
Health Check
-------------
+************
+
+The status of the Policy Agent.
/status
~~~~~~~
GET
+++
- Returns the status of the Policy Agent.
+Returns the status of the Policy Agent.
- **URL path:**
- /status
+Definition
+""""""""""
- **Parameters:**
+**URL path:**
- None.
+/status
+
+**Parameters:**
+
+None.
- **Responses:**
+**Responses:**
- 200:
- Service is living.
+200:
- **Examples:**
+Service is living.
- Call: ::
+Examples
+""""""""
- curl -X GET "http://localhost:8081/status"
+**Call**: ::
- Result:
- 200
+ curl -X GET "http://localhost:8081/status"
+
+**Result**:
+
+200
****************
A1 through DMaaP
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
}
Example
--------
++++++++
To get all policy types for a specific Near |nbh| RT |nbsp| RIC the following message should be sent to DMaaP Message
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. ::
"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: ::