From b5ca7ce70bdfa58701f9fb5fe8a36a4a8b55bc82 Mon Sep 17 00:00:00 2001 From: "halil.cakal" Date: Tue, 2 Aug 2022 08:54:43 +0100 Subject: [PATCH] docs not generated fix Issue-ID: NONRTRIC-771 Change-Id: I1e8ca742fec7611f3e039d600f6ed557ed219fb3 Signed-off-by: halil.cakal --- api/EXT_SRV_api.yaml | 205 +++++++++++++++++++++ docs/callout-server.rst | 2 +- .../test/STD_2.0.0/build_and_start_with_kafka.sh | 2 +- 3 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 api/EXT_SRV_api.yaml diff --git a/api/EXT_SRV_api.yaml b/api/EXT_SRV_api.yaml new file mode 100644 index 0000000..043e984 --- /dev/null +++ b/api/EXT_SRV_api.yaml @@ -0,0 +1,205 @@ +openapi: 3.0.0 +info: + title: 'External Server for A1 simulator' + version: 0.0.1 + description: | + External test server. + © 2022, O-RAN Alliance. + All rights reserved. +externalDocs: + description: 'An external server building CRUD RestFUL APIs which is provisioned by A1 simulator. It will be a refrence point for the callouts' + url: 'https://docs.o-ran-sc.org/projects/o-ran-sc-sim-a1-interface/en/latest/external-server.html' +servers: + - url: '{apiRoot}' + variables: + apiRoot: + default: 'http://www.example.com' +paths: + '/a1policies': + get: + operationId: server.get_all_a1_policies + description: 'Get all a1 policies' + tags: + - All a1policies + responses: + 200: + description: 'Array of all a1 policies' + content: + application/json: + schema: + type: array + items: + "$ref": "#/components/schemas/A1PolicyObject" + minItems: 0 + 429: + "$ref": "#/components/responses/429-TooManyRequests" + 503: + "$ref": "#/components/responses/503-ServiceUnavailable" + '/a1policy/{a1policyId}': + parameters: + - name: a1policyId + in: path + required: true + schema: + "$ref": "#/components/schemas/A1PolicyId" + get: + operationId: server.get_a1_policy + description: 'Query for an A1 policy' + tags: + - Single A1 Policy Object + responses: + 200: + description: 'The requested A1 policy object' + content: + application/json: + schema: + "$ref": "#/components/schemas/A1PolicyObject" + 404: + "$ref": "#/components/responses/404-NotFound" + 409: + "$ref": "#/components/responses/409-Conflict" + 429: + "$ref": "#/components/responses/429-TooManyRequests" + 503: + "$ref": "#/components/responses/503-ServiceUnavailable" + put: + operationId: server.put_a1_policy + description: 'Create an A1 policy' + tags: + - Individual A1 policy Object + requestBody: + required: true + content: + application/json: + schema: + "$ref": "#/components/schemas/A1PolicyObject" + responses: + 200: + description: 'The A1 policy was updated' + content: + application/json: + schema: + "$ref": "#/components/schemas/A1PolicyObject" + 201: + description: 'The A1 policy was created' + content: + application/json: + schema: + "$ref": "#/components/schemas/A1PolicyObject" + headers: + Location: + description: 'Contains the URI of the created A1 policy' + required: true + schema: + type: string + 400: + "$ref": "#/components/responses/400-BadRequest" + 409: + "$ref": "#/components/responses/409-Conflict" + 429: + "$ref": "#/components/responses/429-TooManyRequests" + 503: + "$ref": "#/components/responses/503-ServiceUnavailable" + 507: + "$ref": "#/components/responses/507-InsufficientStorage" + + delete: + operationId: server.delete_a1_policy + description: 'Delete an A1 policy' + tags: + - Individual a1policy Object + responses: + 204: + description: 'The A1 policy was deleted' + 404: + "$ref": "#/components/responses/404-NotFound" + 429: + "$ref": "#/components/responses/429-TooManyRequests" + 503: + "$ref": "#/components/responses/503-ServiceUnavailable" + +components: + schemas: + # + # Representation objects + # + A1PolicyObject: + title: 'Title' + description: 'A generic A1 policy object' + type: object + + ProblemDetails: + description: 'A problem detail to carry details in a HTTP response according to RFC 7807' + type: object + properties: + type: + type: string + title: + type: string + status: + type: number + detail: + type: string + instance: + type: string + + # + # Simple data types + # + JsonSchema: + description: 'A JSON schema following http://json-schema.org/draft-07/schema' + type: object + + A1PolicyId: + description: 'A1 policy identifier.' + type: string + + responses: + 400-BadRequest: + description: 'A1 policy not properly formulated or not related to the method' + content: + application/problem+json: + schema: + "$ref": "#/components/schemas/ProblemDetails" + + 404-NotFound: + description: 'No resource found at the URI' + content: + application/problem+json: + schema: + "$ref": "#/components/schemas/ProblemDetails" + + 405-MethodNotAllowed: + description: 'Method not allowed for the URI' + content: + application/problem+json: + schema: + "$ref": "#/components/schemas/ProblemDetails" + + 409-Conflict: + description: 'Request could not be processed in the current state of the resource' + content: + application/problem+json: + schema: + "$ref": "#/components/schemas/ProblemDetails" + + 429-TooManyRequests: + description: 'Too many requests have been sent in a given amount of time' + content: + application/problem+json: + schema: + "$ref": "#/components/schemas/ProblemDetails" + + 503-ServiceUnavailable: + description: 'The provider is currently unable to handle the request due to a temporary overload' + content: + application/problem+json: + schema: + "$ref": "#/components/schemas/ProblemDetails" + + 507-InsufficientStorage: + description: 'The method could not be performed on the resource because the provider is unable to store the representation needed to successfully complete the request' + content: + application/problem+json: + schema: + "$ref": "#/components/schemas/ProblemDetails" diff --git a/docs/callout-server.rst b/docs/callout-server.rst index d7e139d..4a9448a 100755 --- a/docs/callout-server.rst +++ b/docs/callout-server.rst @@ -20,7 +20,7 @@ The O-RAN SC external server is an extension for Near-RealTime RIC simulator. It The details of API definitions are being explained below: .. Generates content from EXT_SRV_api.yaml -.. openapi:: ../near-rt-ric-simulator/test/EXT_SRV/api/EXT_SRV_api.yaml +.. openapi:: ../api/EXT_SRV_api.yaml Admin Functions diff --git a/near-rt-ric-simulator/test/STD_2.0.0/build_and_start_with_kafka.sh b/near-rt-ric-simulator/test/STD_2.0.0/build_and_start_with_kafka.sh index c017513..97f2a0f 100755 --- a/near-rt-ric-simulator/test/STD_2.0.0/build_and_start_with_kafka.sh +++ b/near-rt-ric-simulator/test/STD_2.0.0/build_and_start_with_kafka.sh @@ -89,7 +89,7 @@ fi # Runs kafka server in detached mode # In order to tail logs use:: docker logs -f kafkamessagedispatcher if [ ! -z "$URL" ]; then - docker run -d --network host --rm -it -p 7075:7075 -p 7175:7175 -e ALLOW_HTTP=true -e MSG_BROKER_URL=localhost:9092 -e KAFKA_TOPIC_RES=kafkatopicres -e TIME_OUT=30000 --volume "$dirkafkasrv/certificate:/usr/src/app/cert" --name kafkamessagedispatcher kafka_dispatcher + docker run -d --network host --rm -it -p 7075:7075 -p 7175:7175 -e ALLOW_HTTP=true -e MSG_BROKER_URL=localhost:9092 -e TIME_OUT=30 --volume "$dirkafkasrv/certificate:/usr/src/app/cert" --name kafkamessagedispatcher kafka_dispatcher fi # Runs A1 simulator -- 2.16.6