From d50bbc599e34e2ad2e491ac779b747ef16cfc63c Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Fri, 19 Jul 2024 12:13:05 +0200 Subject: [PATCH 1/9] Update quality-on-demand.yaml --- code/API_definitions/quality-on-demand.yaml | 119 ++++++++++++++++++-- 1 file changed, 111 insertions(+), 8 deletions(-) diff --git a/code/API_definitions/quality-on-demand.yaml b/code/API_definitions/quality-on-demand.yaml index a2d158dbb9..c14eac028f 100644 --- a/code/API_definitions/quality-on-demand.yaml +++ b/code/API_definitions/quality-on-demand.yaml @@ -312,7 +312,7 @@ paths: "403": $ref: "#/components/responses/Generic403" "404": - $ref: "#/components/responses/SessionNotFound404" + $ref: "#/components/responses/Generic404" "500": $ref: "#/components/responses/Generic500" "503": @@ -358,7 +358,7 @@ paths: "403": $ref: "#/components/responses/Generic403" "404": - $ref: "#/components/responses/SessionNotFound404" + $ref: "#/components/responses/Generic404" "500": $ref: "#/components/responses/Generic500" "503": @@ -436,12 +436,64 @@ paths: "403": $ref: "#/components/responses/Generic403" "404": - $ref: "#/components/responses/SessionNotFound404" + $ref: "#/components/responses/Generic404" "500": $ref: "#/components/responses/Generic500" "503": $ref: "#/components/responses/Generic503" + /sessions/retrieve: + post: + tags: + - QoS Sessions + summary: Get all QoS session information for a given device + description: | + Querying for QoS session resource information details for a given device + + **NOTES:** + - The access token may be either 2-legged or 3-legged. If a 3-legged access token is used, the end user associated with the session must also be associated with the access token. + - If no QoS session is found for the device, an empty array is returned. + operationId: retrieveSessions + parameters: + - $ref: "#/components/parameters/x-correlator" + requestBody: + description: Parameters to get QoS session information by device + content: + application/json: + schema: + $ref: "#/components/schemas/RetrieveSessionsInput" + required: true + responses: + "200": + description: Returns the QoS sessions information for a given device. A device may have multiple sessions, thus the response is an array. An empty array is returned if no sessions are found. + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/RetrieveSessionsOutput" + examples: + PROVISIONING_AVAILABLE: + $ref: "#/components/examples/RETRIEVE_SESSIONS_EXAMPLE" + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "404": + $ref: "#/components/responses/Generic404" + "422": + $ref: "#/components/responses/Generic422" + "500": + $ref: "#/components/responses/Generic500" + "503": + $ref: "#/components/responses/Generic503" + security: + - openId: + - "quality-on-demand:sessions:read" + components: securitySchemes: openId: @@ -872,6 +924,22 @@ components: - code - message + RetrieveSessionsInput: + description: Parameters to get QoS session information by device + type: object + required: + - device + properties: + device: + $ref: "#/components/schemas/Device" + + RetrieveSessionsOutput: + description: QoS session information for a given device + type: array + items: + $ref: "#/components/schemas/SessionInfo" + minItems: 0 + responses: Generic400: description: Invalid input @@ -915,8 +983,26 @@ components: code: PERMISSION_DENIED message: "Operation not allowed: ..." - SessionNotFound404: - description: Session not found + Generic404: + description: Not found + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorInfo" + examples: + GENERIC_404_NOT_FOUND: + summary: Generic Not Found + description: Resource is not found + value: + status: 404 + code: NOT_FOUND + message: "{{resource}} is not found" + + Generic422: + description: Unprocessable entity headers: x-correlator: $ref: '#/components/headers/x-correlator' @@ -925,9 +1011,9 @@ components: schema: $ref: "#/components/schemas/ErrorInfo" example: - status: 404 - code: NOT_FOUND - message: "Session Id does not exist" + status: 422 + code: UNPROCESSABLE_ENTITY + message: "Value not acceptable: ..." Generic500: description: Internal server error @@ -1024,3 +1110,20 @@ components: sessionId: '123e4567-e89b-12d3-a456-426614174000' qosStatus: 'UNAVAILABLE' statusInfo: 'DURATION_EXPIRED' + + RETRIEVE_SESSIONS_EXAMPLE: + summary: List of QoS sessions for the device + description: A single QoS session for the device is available + value: + - duration: 3600 + device: + phoneNumber: "+123456789" + applicationServer: + ipv4Address: 0.0.0.0/0 + qosProfile: QOS_L + webhook: + notificationUrl: https://application-server.com + sessionId: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + startedAt: "2024-06-01T12:00:00Z" + expiresAt: "2024-06-01T13:00:00Z" + qosStatus: AVAILABLE From 25f06b93ded7ac1aaff5e9b3306b9bb033ebfd50 Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Fri, 26 Jul 2024 11:09:00 +0200 Subject: [PATCH 2/9] Update quality-on-demand.yaml - Renamed path to /retrieve-sessions - Independent scope: quality-on-demand:sessions-retrieve-by-device - Specify usage of 2-legged token for same clientId --- code/API_definitions/quality-on-demand.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/API_definitions/quality-on-demand.yaml b/code/API_definitions/quality-on-demand.yaml index c14eac028f..59e2913699 100644 --- a/code/API_definitions/quality-on-demand.yaml +++ b/code/API_definitions/quality-on-demand.yaml @@ -442,7 +442,7 @@ paths: "503": $ref: "#/components/responses/Generic503" - /sessions/retrieve: + /retrieve-sessions: post: tags: - QoS Sessions @@ -452,6 +452,7 @@ paths: **NOTES:** - The access token may be either 2-legged or 3-legged. If a 3-legged access token is used, the end user associated with the session must also be associated with the access token. + - If a 2-legged access token is used, all returned sessions must have been created by the same API client given in the access token. - If no QoS session is found for the device, an empty array is returned. operationId: retrieveSessions parameters: @@ -492,7 +493,7 @@ paths: $ref: "#/components/responses/Generic503" security: - openId: - - "quality-on-demand:sessions:read" + - "quality-on-demand:sessions:retrieve-by-device" components: securitySchemes: From 9e8df7ca5d81cd51abdb9dfd6fc3da4c716ccd95 Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Fri, 26 Jul 2024 11:26:25 +0200 Subject: [PATCH 3/9] Update quality-on-demand.yaml --- code/API_definitions/quality-on-demand.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/API_definitions/quality-on-demand.yaml b/code/API_definitions/quality-on-demand.yaml index 4b2feee574..cfc20ac892 100644 --- a/code/API_definitions/quality-on-demand.yaml +++ b/code/API_definitions/quality-on-demand.yaml @@ -981,6 +981,20 @@ components: code: PERMISSION_DENIED message: "Operation not allowed: ..." + SessionNotFound404: + description: Session not found + headers: + x-correlator: + $ref: '#/components/headers/x-correlator' + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorInfo" + example: + status: 404 + code: NOT_FOUND + message: "Session Id does not exist" + Generic404: description: Not found headers: From 543b4b3a80a9875e974927d22607bb621808c050 Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Thu, 1 Aug 2024 21:24:27 +0200 Subject: [PATCH 4/9] Align operation with PR #326 --- code/API_definitions/quality-on-demand.yaml | 25 ++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/code/API_definitions/quality-on-demand.yaml b/code/API_definitions/quality-on-demand.yaml index 821aefdfc3..16de56f76a 100644 --- a/code/API_definitions/quality-on-demand.yaml +++ b/code/API_definitions/quality-on-demand.yaml @@ -445,14 +445,16 @@ paths: post: tags: - QoS Sessions - summary: Get all QoS session information for a given device + summary: Get QoS session information for a device description: | - Querying for QoS session resource information details for a given device + Querying for QoS session resource information details for a device **NOTES:** - - The access token may be either 2-legged or 3-legged. If a 3-legged access token is used, the end user associated with the session must also be associated with the access token. - - If a 2-legged access token is used, all returned sessions must have been created by the same API client given in the access token. - - If no QoS session is found for the device, an empty array is returned. + - The access token may be either 2-legged or 3-legged. + - If a 3-legged access token is used, the end user (and device) associated with the session must also be associated with the access token. In this case it is recommended NOT to include the `device` parameter in the request (see "Handling of device information" within the API description for details). + - If a 2-legged access token is used, the device parameter must be provided and identify a device. + - The session must have been created by the same API client given in the access token + - If no QoS session is found for the requested device, an empty array is returned. operationId: retrieveSessions parameters: - $ref: "#/components/parameters/x-correlator" @@ -474,8 +476,10 @@ paths: schema: $ref: "#/components/schemas/RetrieveSessionsOutput" examples: - PROVISIONING_AVAILABLE: + RETRIEVE_SESSIONS_ONE_ITEM: $ref: "#/components/examples/RETRIEVE_SESSIONS_EXAMPLE" + RETRIEVE_SESSIONS_NO_ITEMS: + $ref: "#/components/examples/RETRIEVE_SESSIONS_EMPTY_EXAMPLE" "400": $ref: "#/components/responses/Generic400" "401": @@ -486,6 +490,8 @@ paths: $ref: "#/components/responses/Generic404" "422": $ref: "#/components/responses/Generic422" + "429": + $ref: "#/components/responses/Generic429" "500": $ref: "#/components/responses/Generic500" "503": @@ -927,8 +933,6 @@ components: RetrieveSessionsInput: description: Parameters to get QoS session information by device type: object - required: - - device properties: device: $ref: "#/components/schemas/Device" @@ -1184,3 +1188,8 @@ components: startedAt: "2024-06-01T12:00:00Z" expiresAt: "2024-06-01T13:00:00Z" qosStatus: AVAILABLE + + RETRIEVE_SESSIONS_EMPTY_EXAMPLE: + summary: No sessions found for the device + description: An empty array is returned when no sessions are found for the device + value: [] From bc7164da75d9a772b53adbc5e228c0f4cc38ec30 Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Fri, 2 Aug 2024 11:17:09 +0200 Subject: [PATCH 5/9] Update code/API_definitions/quality-on-demand.yaml --- code/API_definitions/quality-on-demand.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/quality-on-demand.yaml b/code/API_definitions/quality-on-demand.yaml index 16de56f76a..c09245ea6d 100644 --- a/code/API_definitions/quality-on-demand.yaml +++ b/code/API_definitions/quality-on-demand.yaml @@ -455,7 +455,7 @@ paths: - If a 2-legged access token is used, the device parameter must be provided and identify a device. - The session must have been created by the same API client given in the access token - If no QoS session is found for the requested device, an empty array is returned. - operationId: retrieveSessions + operationId: retrieveSessionsByDevice parameters: - $ref: "#/components/parameters/x-correlator" requestBody: From b1ad7640d33e95815d575d4782d521332136572a Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Fri, 2 Aug 2024 11:26:27 +0200 Subject: [PATCH 6/9] Update code/API_definitions/quality-on-demand.yaml --- code/API_definitions/quality-on-demand.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/code/API_definitions/quality-on-demand.yaml b/code/API_definitions/quality-on-demand.yaml index c09245ea6d..e14a7f9502 100644 --- a/code/API_definitions/quality-on-demand.yaml +++ b/code/API_definitions/quality-on-demand.yaml @@ -464,7 +464,6 @@ paths: application/json: schema: $ref: "#/components/schemas/RetrieveSessionsInput" - required: true responses: "200": description: Returns the QoS sessions information for a given device. A device may have multiple sessions, thus the response is an array. An empty array is returned if no sessions are found. From e18fd3184020f79c7551cdf9514006836535e2d3 Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Fri, 2 Aug 2024 14:39:06 +0200 Subject: [PATCH 7/9] Update code/API_definitions/quality-on-demand.yaml --- code/API_definitions/quality-on-demand.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/code/API_definitions/quality-on-demand.yaml b/code/API_definitions/quality-on-demand.yaml index e14a7f9502..c09245ea6d 100644 --- a/code/API_definitions/quality-on-demand.yaml +++ b/code/API_definitions/quality-on-demand.yaml @@ -464,6 +464,7 @@ paths: application/json: schema: $ref: "#/components/schemas/RetrieveSessionsInput" + required: true responses: "200": description: Returns the QoS sessions information for a given device. A device may have multiple sessions, thus the response is an array. An empty array is returned if no sessions are found. From 02d66a73ee0c450e80d4b0f23dc389b44c4d8c75 Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Mon, 5 Aug 2024 15:02:38 +0200 Subject: [PATCH 8/9] Update code/API_definitions/quality-on-demand.yaml Co-authored-by: Herbert Damker --- code/API_definitions/quality-on-demand.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/quality-on-demand.yaml b/code/API_definitions/quality-on-demand.yaml index c09245ea6d..c1984045b7 100644 --- a/code/API_definitions/quality-on-demand.yaml +++ b/code/API_definitions/quality-on-demand.yaml @@ -487,7 +487,7 @@ paths: "403": $ref: "#/components/responses/Generic403" "404": - $ref: "#/components/responses/Generic404" + $ref: "#/components/responses/GenericDevice404" "422": $ref: "#/components/responses/Generic422" "429": From 46b9988b99d96bcc1cac374dabf3dab4e67ba5dd Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Tue, 6 Aug 2024 10:57:43 +0200 Subject: [PATCH 9/9] Update quality-on-demand.yaml Remove duplicated responses --- code/API_definitions/quality-on-demand.yaml | 32 --------------------- 1 file changed, 32 deletions(-) diff --git a/code/API_definitions/quality-on-demand.yaml b/code/API_definitions/quality-on-demand.yaml index 5d9541e2a8..2433ecf147 100644 --- a/code/API_definitions/quality-on-demand.yaml +++ b/code/API_definitions/quality-on-demand.yaml @@ -1013,38 +1013,6 @@ components: code: DEVICE_NOT_FOUND message: Device identifier not found. - Generic404: - description: Not found - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorInfo" - examples: - GENERIC_404_NOT_FOUND: - summary: Generic Not Found - description: Resource is not found - value: - status: 404 - code: NOT_FOUND - message: "{{resource}} is not found" - - Generic422: - description: Unprocessable entity - headers: - x-correlator: - $ref: '#/components/headers/x-correlator' - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorInfo" - example: - status: 422 - code: UNPROCESSABLE_ENTITY - message: "Value not acceptable: ..." - SessionInConflict409: description: Conflict headers: