From 2e4c86f9a015694e66a901614438e48f341a4350 Mon Sep 17 00:00:00 2001 From: Randy Levensalor Date: Wed, 10 Jul 2024 08:31:35 -0600 Subject: [PATCH 1/4] Adding query by device for QoS Profile --- code/API_definitions/qos-profiles.yaml | 109 ++++++++++++++++++++ code/API_definitions/quality-on-demand.yaml | 1 + 2 files changed, 110 insertions(+) diff --git a/code/API_definitions/qos-profiles.yaml b/code/API_definitions/qos-profiles.yaml index e8a2c52346..16045323fd 100644 --- a/code/API_definitions/qos-profiles.yaml +++ b/code/API_definitions/qos-profiles.yaml @@ -60,6 +60,11 @@ paths: schema: $ref: '#/components/schemas/QosProfileStatusEnum' required: false + - device: + in: query + description: Qos Profile status + schema: + $ref: "#/components/schemas/Device" - $ref: "#/components/parameters/x-correlator" responses: "200": @@ -73,6 +78,34 @@ paths: type: array items: $ref: "#/components/schemas/QosProfile" + "400": + description: Invalid input for getQosProfiles operation + headers: + x-correlator: + $ref: '#/components/headers/x-correlator' + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorInfo" + examples: + Generic400: + summary: Some parameter combinations or parameter values provided are not schema compliant + value: + status: 400 + code: INVALID_ARGUMENT + message: "Schema validation failed at ..." + InconsistentDeviceProperties: + summary: Device parameters provided identify different devices + value: + status: 400 + code: INVALID_ARGUMENT + message: "Multiple inconsistent parameters specified: device" + CannotIdentifyDevice: + summary: No device can be identified from provided parameters + value: + status: 400 + code: INVALID_ARGUMENT + message: "Unable to identify device from specified parameters: device" "401": $ref: "#/components/responses/Generic401" "403": @@ -362,6 +395,82 @@ components: - Mbps - Gbps - Tbps + Device: + description: | + End-user equipment able to connect to a mobile network. Examples of devices include smartphones or IoT sensors/actuators. + + The developer can choose to provide the below specified device identifiers: + + * `ipv4Address` + * `ipv6Address` + * `phoneNumber` + * `networkAccessIdentifier` + + NOTE: the MNO might support only a subset of these options. The API invoker can provide multiple identifiers to be compatible across different MNOs. In this case the identifiers MUST belong to the same device + type: object + properties: + phoneNumber: + $ref: "#/components/schemas/PhoneNumber" + networkAccessIdentifier: + $ref: "#/components/schemas/NetworkAccessIdentifier" + ipv4Address: + $ref: "#/components/schemas/DeviceIpv4Addr" + ipv6Address: + $ref: "#/components/schemas/DeviceIpv6Address" + minProperties: 1 + maxProperties: 4 + + NetworkAccessIdentifier: + description: A public identifier addressing a subscription in a mobile network. In 3GPP terminology, it corresponds to the GPSI formatted with the External Identifier ({Local Identifier}@{Domain Identifier}). Unlike the telephone number, the network access identifier is not subjected to portability ruling in force, and is individually managed by each operator. + type: string + example: "123456789@domain.com" + + PhoneNumber: + description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with '+'. + type: string + pattern: '^\+[1-9][0-9]{4,14}$' + example: "+123456789" + + DeviceIpv4Addr: + type: object + description: | + The device should be identified by either the public (observed) IP address and port as seen by the application server, or the private (local) and any public (observed) IP addresses in use by the device (this information can be obtained by various means, for example from some DNS servers). + + If the allocated and observed IP addresses are the same (i.e. NAT is not in use) then the same address should be specified for both publicAddress and privateAddress. + + If NAT64 is in use, the device should be identified by its publicAddress and publicPort, or separately by its allocated IPv6 address (field ipv6Address of the Device object) + + In all cases, publicAddress must be specified, along with at least one of either privateAddress or publicPort, dependent upon which is known. In general, mobile devices cannot be identified by their public IPv4 address alone. + properties: + publicAddress: + $ref: "#/components/schemas/SingleIpv4Addr" + privateAddress: + $ref: "#/components/schemas/SingleIpv4Addr" + publicPort: + $ref: "#/components/schemas/Port" + anyOf: + - required: [publicAddress, privateAddress] + - required: [publicAddress, publicPort] + example: + { + "publicAddress": "203.0.113.0", + "publicPort": 59765 + } + + SingleIpv4Addr: + description: A single IPv4 address with no subnet mask + type: string + format: ipv4 + example: "203.0.113.0" + + DeviceIpv6Address: + description: | + The device should be identified by the observed IPv6 address, or by any single IPv6 address from within the subnet allocated to the device (e.g. adding ::0 to the /64 prefix). + + The session shall apply to all IP flows between the device subnet and the specified application server, unless further restricted by the optional parameters devicePorts or applicationServerPorts. + type: string + format: ipv6 + example: 2001:db8:85a3:8d3:1319:8a2e:370:7344 ErrorInfo: description: Common schema for errors diff --git a/code/API_definitions/quality-on-demand.yaml b/code/API_definitions/quality-on-demand.yaml index 7973f2eb69..90837cbaf0 100644 --- a/code/API_definitions/quality-on-demand.yaml +++ b/code/API_definitions/quality-on-demand.yaml @@ -745,6 +745,7 @@ components: ipv6Address: $ref: "#/components/schemas/DeviceIpv6Address" minProperties: 1 + maxProperties: 4 ApplicationServer: description: | From b44cc6e7c493f7ece7f8517cf6b2b86c6de0b1e4 Mon Sep 17 00:00:00 2001 From: Randy Levensalor Date: Wed, 10 Jul 2024 09:46:23 -0600 Subject: [PATCH 2/4] Fixing errors --- code/API_definitions/qos-profiles.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/API_definitions/qos-profiles.yaml b/code/API_definitions/qos-profiles.yaml index 16045323fd..47b2ede543 100644 --- a/code/API_definitions/qos-profiles.yaml +++ b/code/API_definitions/qos-profiles.yaml @@ -60,9 +60,9 @@ paths: schema: $ref: '#/components/schemas/QosProfileStatusEnum' required: false - - device: + - name: device in: query - description: Qos Profile status + description: Device identifier schema: $ref: "#/components/schemas/Device" - $ref: "#/components/parameters/x-correlator" @@ -457,6 +457,12 @@ components: "publicPort": 59765 } + Port: + description: TCP or UDP port number + type: integer + minimum: 0 + maximum: 65535 + SingleIpv4Addr: description: A single IPv4 address with no subnet mask type: string From b94e38a1ab74228f6cce32b326b4ae7700939b67 Mon Sep 17 00:00:00 2001 From: Randy Levensalor Date: Wed, 10 Jul 2024 09:58:07 -0600 Subject: [PATCH 3/4] Updating docuentation --- code/API_definitions/qos-profiles.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/API_definitions/qos-profiles.yaml b/code/API_definitions/qos-profiles.yaml index 47b2ede543..463a53cd61 100644 --- a/code/API_definitions/qos-profiles.yaml +++ b/code/API_definitions/qos-profiles.yaml @@ -45,7 +45,8 @@ paths: summary: "Get All QoS Profiles" description: | Returns all QoS Profiles that match the given criteria. - If no criteria is given, all QoS Profiles are returned. + If the client credentials specify a device, the QoS Profiles returned are those that are applicable to the device. + If no criteria is given and the credentials don't specify a device, all QoS Profiles are returned. operationId: getQosProfiles parameters: - name: name From e63f62f75e607dbb929eb9363839e0bc8cbbaaa5 Mon Sep 17 00:00:00 2001 From: Randy Levensalor Date: Wed, 10 Jul 2024 13:32:30 -0600 Subject: [PATCH 4/4] Adding a post call for device based qos query --- code/API_definitions/qos-profiles.yaml | 69 ++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/code/API_definitions/qos-profiles.yaml b/code/API_definitions/qos-profiles.yaml index 463a53cd61..6da2216c07 100644 --- a/code/API_definitions/qos-profiles.yaml +++ b/code/API_definitions/qos-profiles.yaml @@ -61,12 +61,56 @@ paths: schema: $ref: '#/components/schemas/QosProfileStatusEnum' required: false - - name: device - in: query - description: Device identifier - schema: - $ref: "#/components/schemas/Device" - $ref: "#/components/parameters/x-correlator" + responses: + "200": + description: Contains information about QoS Profiles + headers: + x-correlator: + $ref: '#/components/headers/x-correlator' + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/QosProfile" + "400": + description: Invalid input for getQosProfiles operation + headers: + x-correlator: + $ref: '#/components/headers/x-correlator' + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorInfo" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "404": + $ref: "#/components/responses/QosProfilesNotFound404" + "500": + $ref: "#/components/responses/QoSProfile500" + "503": + $ref: "#/components/responses/Generic503" + + /qos-profiles-by-device: + post: + tags: + - QoS Profiles + summary: Get QoS profiles avaialable for a given device + description: | + Return all QoS Profiles for a given device. + operationId: qosProfilesDevice + parameters: + - $ref: "#/components/parameters/x-correlator" + requestBody: + description: Parameters to query QoS Profiles for a given device + content: + application/json: + schema: + $ref: "#/components/schemas/QosProfileDeviceRequest" + required: true responses: "200": description: Contains information about QoS Profiles @@ -396,6 +440,21 @@ components: - Mbps - Gbps - Tbps + + QosProfileDeviceRequest: + description: | + Request object for QoS Profiles for a given device + type: object + properties: + device: + $ref: "#/components/schemas/Device" + name: + $ref: "#/components/schemas/QosProfileName" + status: + $ref: '#/components/schemas/QosProfileStatusEnum' + required: + - device + Device: description: | End-user equipment able to connect to a mobile network. Examples of devices include smartphones or IoT sensors/actuators.