Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List sessions endpoint for quality-on-demand #325

Merged
merged 12 commits into from
Aug 7, 2024
127 changes: 127 additions & 0 deletions code/API_definitions/quality-on-demand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,65 @@ paths:
"503":
$ref: "#/components/responses/Generic503"

/retrieve-sessions:
post:
tags:
- QoS Sessions
summary: Get QoS session information for a device
description: |
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 (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: retrieveSessionsByDevice
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
jlurien marked this conversation as resolved.
Show resolved Hide resolved
responses:
jlurien marked this conversation as resolved.
Show resolved Hide resolved
"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:
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":
$ref: "#/components/responses/Generic401"
"403":
$ref: "#/components/responses/Generic403"
"404":
$ref: "#/components/responses/Generic404"
jlurien marked this conversation as resolved.
Show resolved Hide resolved
"422":
$ref: "#/components/responses/Generic422"
"429":
$ref: "#/components/responses/Generic429"
"500":
$ref: "#/components/responses/Generic500"
"503":
$ref: "#/components/responses/Generic503"
security:
- openId:
- "quality-on-demand:sessions:retrieve-by-device"

components:
securitySchemes:
openId:
Expand Down Expand Up @@ -871,6 +930,20 @@ components:
- code
- message

RetrieveSessionsInput:
description: Parameters to get QoS session information by device
type: object
properties:
device:
$ref: "#/components/schemas/Device"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a session was created using, for example, IP address / port, should we be allowed to search for it by other parameters, such as MSISDN? Would we just leave this up to implementations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is hard to limit that in an API. It depends on how implementations attach device info to the session and are able to work with or exchange different type of identifiers. They may locate the session or not depending on this.

But the concept of Device as property of current SessionInfo triggers many questions that we probably need to tackle for future releases. So far we ask the device to be returned as part of sessionInfo in responses, but we have not stated explicitly if the identifiers in the response must always be the same identifiers that were indicated in the creation request. Moreover, IP addresses may be reassigned and they may no longer identify the same device at all moments. Also, if we decide to map to a permanent identifier, such a MSISDN, and we return it, we may be disclosing private and unnecessary information to the client.


RetrieveSessionsOutput:
description: QoS session information for a given device
type: array
items:
$ref: "#/components/schemas/SessionInfo"
minItems: 0

responses:
Generic400:
description: Invalid input
Expand Down Expand Up @@ -928,6 +1001,38 @@ components:
code: NOT_FOUND
message: "Session Id does not exist"

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:
Expand Down Expand Up @@ -1066,3 +1171,25 @@ 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:
hdamker marked this conversation as resolved.
Show resolved Hide resolved
- 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

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: []