From 0399eddd26fa08a06d2c2042cfc88b58721545c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Hunyadi?= <67875049+akoshunyadi@users.noreply.github.com> Date: Tue, 30 May 2023 15:43:19 +0200 Subject: [PATCH 1/8] Aligned notifications with guideline Update of the notification event related fields based on the API design guideline --- code/API_definitions/qod-api.yaml | 104 ++++++++++++++++++++---------- 1 file changed, 69 insertions(+), 35 deletions(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 2af7802f3a..31cbaa61b6 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -200,7 +200,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/Notification" + $ref: "#/components/schemas/EventNotification" responses: "204": description: Successful notification @@ -295,15 +295,22 @@ components: $ref: "#/components/schemas/PortsSpec" qosProfile: $ref: "#/components/schemas/QosProfile" - notificationUrl: - type: string - format: uri - example: "https://application-server.com" - description: Allows asynchronous delivery of session related events - notificationAuthToken: - type: string - example: "c8974e592c2fa383d4a3960714" - description: Authentication token for callback API + webhook: + type: object + required: + - notificationUrl + properties: + notificationUrl: + type: string + format: uri + example: "https://application-server.com" + description: Allows asynchronous delivery of session related events + notificationAuthToken: + type: string + minLength: 20 + maxLength: 256 + example: "c8974e592c2fa383d4a3960714" + description: Authentication token for callback API required: - device - applicationServer @@ -358,43 +365,75 @@ components: * `QOS_S` - Qualifier for the requested QoS profile _S_ * `QOS_M` - Qualifier for the requested QoS profile _M_ * `QOS_L` - Qualifier for the requested QoS profile _L_ - - Notification: + + EventNotification: type: object required: - - sessionId - - eventReports + - event properties: - sessionId: - $ref: "#/components/schemas/SessionId" - eventReports: - type: array - items: - $ref: "#/components/schemas/EventReport" - minItems: 1 - description: Contains the reported event and applicable information - - EventReport: + event: + $ref: "#/components/schemas/Event" + + Event: + type: object + required: + - eventType + - eventTime + - eventDetail + properties: + eventid: + $ref: "#/components/schemas/EventId" + eventType: + $ref: "#/components/schemas/EventType" + eventTime: + $ref: "#/components/schemas/EventTime" + eventDetail: + $ref: "#/components/schemas/EventDetail" + description: Notification event + + EventId: + type: string + format: uuid + example: 5698d710-9b1b-4695-a958-7b228f08128c + description: Unique identifier of the event + + EventType: + type: string + enum: + - QOS_STATUS_CHANGED + description: Type of the event + + EventTime: + type: string + format: date-time + example: 2023-05-30T10:18:28Z + description: Date time when the event occurred + + EventDetail: oneOf: - - $ref: '#/components/schemas/QosStatusChangedEventReport' + - $ref: '#/components/schemas/QosStatusChangedEventDetails' discriminator: propertyName: eventType mapping: - QOS_STATUS_CHANGED: "#/components/schemas/QosStatusChangedEventReport" - - QosStatusChangedEventReport: + QOS_STATUS_CHANGED: "#/components/schemas/QosStatusChangedEventDetails" + description: Event details depending on the event type + + QosStatusChangedEventDetails: type: object required: - eventType + - sessionId - qosStatus properties: eventType: - $ref: "#/components/schemas/SessionEventType" + $ref: "#/components/schemas/EventType" + sessionId: + $ref: "#/components/schemas/SessionId" qosStatus: $ref: "#/components/schemas/QosStatus" statusInfo: $ref: "#/components/schemas/StatusInfo" - + StatusInfo: type: string enum: @@ -405,11 +444,6 @@ components: * `DURATION_EXPIRED` - Session terminated due to requested duration expired * `NETWORK_TERMINATED` - Network terminated the session before the requested duration expired - SessionEventType: - type: string - enum: - - QOS_STATUS_CHANGED - Device: type: object minProperties: 1 From 9380aadb73a8c4a2f8c59173adaa7f3ffbb28926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Hunyadi?= <67875049+akoshunyadi@users.noreply.github.com> Date: Fri, 2 Jun 2023 15:37:10 +0200 Subject: [PATCH 2/8] Notification description fixed --- code/API_definitions/qod-api.yaml | 66 +++++++++++++++---------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 31cbaa61b6..09f10a0926 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -40,8 +40,37 @@ paths: required: true callbacks: notifications: - "{$request.body#/notificationUrl}/notifications": - $ref: "#/paths/~1notifications" + "{$request.body#/webhook/notificationUrl}/notifications": + post: + tags: + - Session notifications callback + summary: "Session notifications callback" + description: | + Important: this endpoint is to be implemented by the API consumer. + The QoD server will call this endpoint whenever any network related event occurs. + Currently only QOS_STATUS_CHANGED event is defined. + operationId: postNotification + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/EventNotification" + responses: + "204": + description: Successful notification + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "500": + $ref: "#/components/responses/Generic500" + "503": + $ref: "#/components/responses/Generic503" + security: + - apiKey: [] responses: "201": description: Session created @@ -184,38 +213,7 @@ paths: "500": $ref: "#/components/responses/Generic500" "503": - $ref: "#/components/responses/Generic503" - /notifications: - post: - tags: - - Session notifications callback - summary: "Session notifications callback" - description: | - Important: this endpoint is to be implemented by the API consumer. - The QoD server will call this endpoint whenever any network related event occurs. - Currently only QOS_STATUS_CHANGED event is defined. - operationId: postNotification - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/EventNotification" - responses: - "204": - description: Successful notification - "400": - $ref: "#/components/responses/Generic400" - "401": - $ref: "#/components/responses/Generic401" - "403": - $ref: "#/components/responses/Generic403" - "500": - $ref: "#/components/responses/Generic500" - "503": - $ref: "#/components/responses/Generic503" - security: - - apiKey: [] + $ref: "#/components/responses/Generic503" components: securitySchemes: oAuth2ClientCredentials: From 90ffa1ae5c35869de813c056409884e83b439dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Hunyadi?= <67875049+akoshunyadi@users.noreply.github.com> Date: Mon, 5 Jun 2023 10:35:29 +0200 Subject: [PATCH 3/8] apiKey removed --- code/API_definitions/qod-api.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 09f10a0926..42864a90eb 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -68,9 +68,7 @@ paths: "500": $ref: "#/components/responses/Generic500" "503": - $ref: "#/components/responses/Generic503" - security: - - apiKey: [] + $ref: "#/components/responses/Generic503" responses: "201": description: Session created From 12760ebcba1c3c9946d90df37897f854ddfab211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Hunyadi?= <67875049+akoshunyadi@users.noreply.github.com> Date: Mon, 5 Jun 2023 10:52:10 +0200 Subject: [PATCH 4/8] apiKey removed #2 --- code/API_definitions/qod-api.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 42864a90eb..e7e2a65960 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -220,12 +220,7 @@ components: flows: clientCredentials: tokenUrl: "{tokenUrl}" - scopes: {} - apiKey: - type: apiKey - description: API key to authorize requests - name: apikey - in: query + scopes: {} schemas: SessionId: type: string From 85202a59435fa6c6cef447cce8b803449edd5af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Hunyadi?= <67875049+akoshunyadi@users.noreply.github.com> Date: Mon, 5 Jun 2023 12:17:58 +0200 Subject: [PATCH 5/8] Event structure fixed --- code/API_definitions/qod-api.yaml | 65 ++++++++++++++++--------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index e7e2a65960..7caac18981 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -366,20 +366,12 @@ components: $ref: "#/components/schemas/Event" Event: - type: object - required: - - eventType - - eventTime - - eventDetail - properties: - eventid: - $ref: "#/components/schemas/EventId" - eventType: - $ref: "#/components/schemas/EventType" - eventTime: - $ref: "#/components/schemas/EventTime" - eventDetail: - $ref: "#/components/schemas/EventDetail" + anyOf: + - $ref: "#/components/schemas/QosStatusChangedEvent" + discriminator: + propertyName: eventType + mapping: + QOS_STATUS_CHANGED: "#/components/schemas/QosStatusChangedEvent" description: Notification event EventId: @@ -400,31 +392,40 @@ components: example: 2023-05-30T10:18:28Z description: Date time when the event occurred - EventDetail: - oneOf: - - $ref: '#/components/schemas/QosStatusChangedEventDetails' - discriminator: - propertyName: eventType - mapping: - QOS_STATUS_CHANGED: "#/components/schemas/QosStatusChangedEventDetails" - description: Event details depending on the event type - - QosStatusChangedEventDetails: + EventBase: type: object required: - eventType - - sessionId - - qosStatus + - eventTime properties: + eventid: + $ref: "#/components/schemas/EventId" eventType: $ref: "#/components/schemas/EventType" - sessionId: - $ref: "#/components/schemas/SessionId" - qosStatus: - $ref: "#/components/schemas/QosStatus" - statusInfo: - $ref: "#/components/schemas/StatusInfo" + eventTime: + $ref: "#/components/schemas/EventTime" + QosStatusChangedEvent: + allOf: + - $ref: "#/components/schemas/EventBase" + - type: object + properties: + eventDetail: + type: object + description: Event details depending on the event type + required: + - sessionId + - qosStatus + properties: + sessionId: + $ref: "#/components/schemas/SessionId" + qosStatus: + $ref: "#/components/schemas/QosStatus" + statusInfo: + $ref: "#/components/schemas/StatusInfo" + required: + - eventDetail + StatusInfo: type: string enum: From 73bb600c3c7189ad62dfec6ca30db383efb1630f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Hunyadi?= <67875049+akoshunyadi@users.noreply.github.com> Date: Tue, 6 Jun 2023 18:20:21 +0200 Subject: [PATCH 6/8] Removed fixed added path 'notifications' --- code/API_definitions/qod-api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 7caac18981..813a54228f 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -40,7 +40,7 @@ paths: required: true callbacks: notifications: - "{$request.body#/webhook/notificationUrl}/notifications": + "{$request.body#/webhook/notificationUrl}": post: tags: - Session notifications callback From 7f90c27cdfc08b10b8df5ebe99cd1f09d2e6e1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Hunyadi?= <67875049+akoshunyadi@users.noreply.github.com> Date: Mon, 12 Jun 2023 11:32:43 +0200 Subject: [PATCH 7/8] Bearerauth added --- code/API_definitions/qod-api.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 5ed93dedc6..466d6d6374 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -68,7 +68,9 @@ paths: "500": $ref: "#/components/responses/Generic500" "503": - $ref: "#/components/responses/Generic503" + $ref: "#/components/responses/Generic503" + security: + - notificationsBearerAuth: [] responses: "201": description: Session created @@ -293,7 +295,11 @@ components: flows: clientCredentials: tokenUrl: "{tokenUrl}" - scopes: {} + scopes: {} + notificationsBearerAuth: + type: http + scheme: bearer + bearerFormat: "{$request.body#/webhook/notificationAuthToken}" schemas: SessionId: type: string From ea6024dc8d39b7f8d0947936d972901cc977d46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Hunyadi?= <67875049+akoshunyadi@users.noreply.github.com> Date: Tue, 13 Jun 2023 11:29:37 +0200 Subject: [PATCH 8/8] Added no auth Co-authored-by: Jose Luis Urien --- code/API_definitions/qod-api.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/code/API_definitions/qod-api.yaml b/code/API_definitions/qod-api.yaml index 466d6d6374..e67bfa7079 100644 --- a/code/API_definitions/qod-api.yaml +++ b/code/API_definitions/qod-api.yaml @@ -70,6 +70,7 @@ paths: "503": $ref: "#/components/responses/Generic503" security: + - {} - notificationsBearerAuth: [] responses: "201":