Skip to content
Snippets Groups Projects
Commit 70d2474a authored by BjornMagnussonXA's avatar BjornMagnussonXA
Browse files

Corrected README and error message


Change-Id: I52311fba8b4c4bcbfb42e92519b52729cacbd885
Issue-ID: NONRTRIC-120
Signed-off-by: default avatarBjornMagnussonXA <bjorn.magnusson@est.tech>
parent 93f015a0
No related branches found
No related tags found
No related merge requests found
...@@ -2,97 +2,116 @@ ...@@ -2,97 +2,116 @@
The O-RAN SC Near-RealTime RIC simulates the A1 as an generic REST API which can receive and send northbound messages. The simulator validates the payload and applies policy. The O-RAN SC Near-RealTime RIC simulates the A1 as an generic REST API which can receive and send northbound messages. The simulator validates the payload and applies policy.
The simulator supports multiple A1 interface versions (version of the open API yaml file): The simulator supports multiple A1 interface versions (version of the open API yaml file\):
- OSC 2.1.0, version-id: OSC\_2.1.0 | Yaml file version | Version id|
- A1 Standard 1.1.3, version-id: STD\_1.1.3 | --------------------- | ------------------- |
- 1.1.x-alpha.2 , version-id: 1.1.x-alpha.2 | OSC 2.1.0, | OSC\_2.1.0 |
| A1 Standard 1.1.3, | STD\_1.1.3 |
| 1.1.x-alpha.2 , | 1.1.x-alpha.2 |
All versions are supported by the same container, see section 'Configuring the simulator' below for details about how to the start the simulator with the correct version. All versions are supported by the same container, see section 'Configuring the simulator' below for details about how to the start the simulator with the intended version id.
The overall folder structure is (relative to the location of this README file): The overall folder structure is \(relative to the location of this README file\):
. Dockerfile and README | Dir | Description |
api The open api yaml for each supported version | ---------------- | ----------- |
src Python source code for each supported version |. |Dockerfile and README |
test Basic test |api |The open api yaml for each supported version |
|src |Python source code for each supported version |
|test |Basic test |
The simulator handles the requests that are defined in the A1 open API yaml file. All these requests are in the a1.py file in the source folder. In addition, a number of administrative functions are also supported and implemented by the main.py in the source folder.
The simulator handles the requests that are defined in the A1 open API yaml file. All these requests are implemented in the a1.py file in the source folder. In addition, a number of administrative functions are also supported and implemented by the main.py in the source folder.
The section below outlines the supported open api REST operations as well as the adminstrative REST operations. The section below outlines the supported open api REST operations as well as the adminstrative REST operations.
# Supported operations in simulator OSC 2.1.0 # Supported operations in simulator OSC 2.1.0
URIs for A1: URIs for A1:
- GET, do a healthcheck: http://localhost:8085/healthcheck | Function | Path and parameters |
- GET, get all policy type ids: http://localhost:8085/policytypes | --------------------- | ------------------- |
- DELETE, delete a policy type: http://localhost:8085/policytypes/{policy\_type\_id} | GET, do a healthcheck | http://localhost:8085/a1-p/healthcheck |
- GET, get a policy type: http://localhost:8085/policytypes/{policy\_type\_id} | GET, get all policy type ids | http://localhost:8085/a1-p/policytypes |
- PUT, create/update a policy type: http://localhost:8085/policytypes/{policy\_type\_id} | DELETE, delete a policy type | http://localhost:8085/a1-p/policytypes/{policy\_type\_id} |
- GET, get all policy ids for a type: http://localhost:8085/policytypes/{policy\_type\_id}/policies | GET, get a policy type | http://localhost:8085/a1-p/policytypes/{policy\_type\_id} |
- DELETE, delete a policy: http://localhost:8085/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id} | PUT, create/update a policy type | http://localhost:8085/a1-p/policytypes/{policy\_type\_id} |
- GET, get a policy: http://localhost:8085/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id} | GET, get all policy ids for a type | http://localhost:8085/a1-p/policytypes/{policy\_type\_id}/policies |
- PUT, create/update a policy: http://localhost:8085/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id} | DELETE, delete a policy | http://localhost:8085/a1-p/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id} |
- GET, get policy status: http://localhost:8085/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id}/status | GET, get a policy | http://localhost:8085/a1-p/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id} |
<br>Swagger UI at:`http://localhost:8085/ui/` | PUT, create/update a policy | http://localhost:8085/a1-p/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id} |
| GET, get policy status | http://localhost:8085/a1-p/policytypes/{policy\_type\_id}/policies/{policy\_instance\_id}/status |
Swagger UI at: http://localhost:8085/ui/
URIs for admin operations: URIs for admin operations:
- GET, a basic healthcheck: http://localhost:8085/ | Function | Path and parameters |
- GET, a list of all supported interfaces: http://localhost:8085/container\_interfaces | --------------------- | ------------------- |
- POST, delete all policy instances: http://localhost:8085/deleteinstances | GET, a basic healthcheck | http://localhost:8085/ |
- POST, full reset: http://localhost:8085/deleteall | GET, a list of all supported interfaces | http://localhost:8085/container\_interfaces |
- PUT, create/update a policy type: http://localhost:8085/policytype?id=&lt;policytypeid&gt; | POST, delete all policy instances | http://localhost:8085/deleteinstances |
- DELETE, delete a policy type: http://localhost:8085/policytype?id=&lt;policytypeid&gt; | POST, full reset | http://localhost:8085/deleteall |
- GET, list of policy type id: http://localhost:8085/policytypes | PUT, create/update a policy type | http://localhost:8085/policytype?id=&lt;policytypeid&gt; |
- POST, force a specific response code for an A1 operation: http://localhost:8085/forceresponse?responsecode=&lt;http-code&gt; | DELETE, delete a policy type | http://localhost:8085/policytype?id=&lt;policytypeid&gt; |
- POST, force delayed response of all A1 operations: http://localhost:8085/forcedelay?delay=&lt;seconds&gt; | GET, list of policy type id | http://localhost:8085/policytypes |
- PUT, set status and optional reason, delete and timestamp: http://localhost:8085/status?status=&lt;status&gt;&ampreason=&lt;reason&gt;[&ampdeleted=&lt;boolean&gt;][&ampcreated\_at=&lt;timestamp&gt;] | POST, force a specific response code for an A1 operation | http://localhost:8085/forceresponse?code=&lt;http-code&gt; |
- POST, send status for policy: http://localhost:8085/sendstatus?policyid=&lt;policyid&gt; | POST, force delayed response of all A1 operations | http://localhost:8085/forcedelay?delay=&lt;seconds&gt; |
- GET a counter: http://localhost:8085/counter/&lt;counter-name&gt; | PUT, set status and optional reason, delete and timestamp | http://localhost:8085/status?status=&lt;status&gt;&amp;reason=&lt;reason&gt;[&amp;deleted=&lt;boolean&gt;][&amp;created\_at=&lt;timestamp&gt;] |
(counter-name: 'num\_instances', 'num\_types' or 'interface') | GET a counter <br> (counter-name: 'num\_instances', 'num\_types' or 'interface') | http://localhost:8085/counter/&lt;counter-name&gt; |
# Supported operations in simulator A1 Standard 1.1.3 # Supported operations in simulator A1 Standard 1.1.3
URIs for A1: URIs for A1:
- GET all policy identities http://localhost:8085/A1-P/v1/policies | Function | Path and parameters |
- PUT a policy instance(create or update it): http://localhost:8085/A1-P/v1/policies/{policyId} | --------------------- | ------------------- |
- GET a policy: http://localhost:8085/A1-P/v1/policies/{policyId} | GET all policy identities | http://localhost:8085/A1-P/v1/policies |
- DELETE a policy instance: http://localhost:8085/A1-P/v1/policies/{policyId} | PUT a policy instance(create or update it) | http://localhost:8085/A1-P/v1/policies/{policyId} |
- GET a policy status: http://localhost:8085/A1-P/v1/policies/{policyid} | GET a policy | http://localhost:8085/A1-P/v1/policies/{policyId} |
<br>Swagger UI at:`http://localhost:8085/A1-P/v1/ui/` | DELETE a policy instance | http://localhost:8085/A1-P/v1/policies/{policyId} |
| GET a policy status | http://localhost:8085/A1-P/v1/policies/{policyid} |
Swagger UI at: http://localhost:8085/A1-P/v1/ui/
URIs for admin operations: URIs for admin operations:
- GET, a basic healthcheck: http://localhost:8085/ | Function | Path and parameters |
- GET, a list of all supported interfaces: http://localhost:8085/container\_interfaces | --------------------- | ------------------- |
- POST, delete all policy instances: http://localhost:8085/deleteinstances | GET, a basic healthcheck | http://localhost:8085/ |
- POST, full reset: http://localhost:8085/deleteall | GET, a list of all supported interfaces | http://localhost:8085/container\_interfaces |
- POST, force a specific response code for an A1 operation: http://localhost:8085/forceresponse?responsecode=&lt;http-code&gt; | POST, delete all policy instances | http://localhost:8085/deleteinstances |
- POST, force delayed response of all A1 operations: http://localhost:8085/forcedelay?delay=&lt;seconds&gt; | POST, full reset | http://localhost:8085/deleteall |
- PUT, set status and optional reason: http://localhost:8085/status?status=&lt;status&gt;&ampreason=&lt;reason&gt; | POST, force a specific response code for an A1 operation | http://localhost:8085/forceresponse?code=&lt;http-code&gt; |
- POST, send status for policy: http://localhost:8085/sendstatus?policyid=&lt;policyid&gt; | POST, force delayed response of all A1 operations | http://localhost:8085/forcedelay?delay=&lt;seconds&gt; |
- GET a counter: http://localhost:8085/counter/&lt;counter-name&gt; | PUT, set status and optional reason | http://localhost:8085/status?status=&lt;status&gt;[&amp;reason=&lt;reason&gt;] |
(counter-name: 'num\_instances', 'num\_types'(always 0) or 'interface') | POST, send status for policy | http://localhost:8085/sendstatus?policyid=&lt;policyid&gt; |
| GET a counter <br> (counter-name: 'num\_instances', 'num\_types'(always 0) or 'interface') | http://localhost:8085/counter/&lt;counter-name&gt; |
# Supported operations in simulator 1.1.x-alpha.2 # Supported operations in simulator 1.1.x-alpha.2
The available requests and the addresses are currently: The available requests and the addresses are currently:
- GET all policy identities (respectively for a policy type if query parameter used): http://localhost:8085/A1-P/v1/policies?policyTypeId={policyTypeId} | Function | Path and parameters |
- PUT a policy instance(create or update it): http://localhost:8085/A1-P/v1/policies/{policyId}?policyTypeId={policyTypeId} | --------------------- | ------------------- |
- GET a policy: http://localhost:8085/A1-P/v1/policies/{policyId} | GET all policy identities (respectively for a policy type if query parameter used) | http://localhost:8085/A1-P/v1/policies?policyTypeId={policyTypeId} |
- DELETE a policy instance: http://localhost:8085/A1-P/v1/policies/{policyId} | PUT a policy instance(create or update it) | http://localhost:8085/A1-P/v1/policies/{policyId}?policyTypeId={policyTypeId} |
- GET a policy status: http://localhost:8085/A1-P/v1/policystatus | GET a policy | http://localhost:8085/A1-P/v1/policies/{policyId} |
- GET all policy types: http://localhost:8085/A1-P/v1/policytypes | DELETE a policy instance | http://localhost:8085/A1-P/v1/policies/{policyId} |
- GET the schemas for a policy type: http://localhost:8085/A1-P/v1/policytypes/{policyTypeId} | GET a policy status | http://localhost:8085/A1-P/v1/policystatus |
| GET all policy types | http://localhost:8085/A1-P/v1/policytypes |
| GET the schemas for a policy type | http://localhost:8085/A1-P/v1/policytypes/{policyTypeId} |
Nota Bene: It could happen that this page is not updated as soon as the yaml file is. The yaml file can be found under /near-rt-ric-simulator/a1-openapi.yaml. Nota Bene: It could happen that this page is not updated as soon as the yaml file is. The yaml file can be found under /near-rt-ric-simulator/a1-openapi.yaml.
Additionally, there are requests that are defined in main.py as an administrative API. The goal is to handle information that couldn't be handled using the A1 interface. The available requests and the addresses are currently: Additionally, there are requests that are defined in main.py as an administrative API. The goal is to handle information that couldn't be handled using the A1 interface. The available requests and the addresses are currently:
- GET, a basic healthcheck: http://localhost:8085/ | Function | Path and parameters |
- PUT a policy type: http://localhost:8085/policytypes/{policyTypeId} | --------------------- | ------------------- |
- DELETE a policy type: http://localhost:8085/policytypes/{policyTypeId} | GET, a basic healthcheck | http://localhost:8085/ |
- DELETE all policy instances: http://localhost:8085/deleteinstances | PUT a policy type | http://localhost:8085/policytypes/{policyTypeId} |
- DELETE all policy types: http://localhost:8085/deletetypes | DELETE a policy type | http://localhost:8085/policytypes/{policyTypeId} |
- PUT a status to a policy instance with an enforceStatus parameter only: http://localhost:8085/{policyId}/{enforceStatus} | DELETE all policy instances | http://localhost:8085/deleteinstances |
- PUT a status to a policy instance with both enforceStatus and enforceReason: http://localhost:8085/{policyId}/{enforceStatus}/{enforceReason} | DELETE all policy types | http://localhost:8085/deletetypes |
| PUT a status to a policy instance with an enforceStatus parameter only | http://localhost:8085/{policyId}/{enforceStatus} |
| PUT a status to a policy instance with both enforceStatus and enforceReason | http://localhost:8085/{policyId}/{enforceStatus}/{enforceReason} |
| GET a counter <br> (counter-name: 'num\_instances', 'num\_types' or 'interface') | http://localhost:8085/counter/{counter-name} |
The backend server publishes live API documentation at the URL `http://localhost:8085/A1-P/v1/ui/` The backend server publishes live API documentation at the URL `http://localhost:8085/A1-P/v1/ui/`
......
...@@ -106,7 +106,7 @@ def del_policytype(): ...@@ -106,7 +106,7 @@ def del_policytype():
policyTypeId=request.args.get('id') policyTypeId=request.args.get('id')
if (policyTypeId is None): if (policyTypeId is None):
return Response('Parameter <policytypeid> missing in request', status=400, mimetype='text/plain') return Response('Parameter <id> missing in request', status=400, mimetype='text/plain')
try: try:
val=int(policyTypeId) val=int(policyTypeId)
except: except:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment