openapi: 3.0.3
info:
description: |
The Quality-On-Demand (QoD) Provisioning API offers a programmable interface for developers to request the assignment of a certain QoS Profile to a certain device, indefinitely.
This API sets up the configuration in the network so the requested QoS profile is applied to an specified device, at any time while the provisioning is available. The device traffic will be treated with a certain QoS profile by the network whenever the device is connected to the network, until the provisioning is deleted.
# Relevant terms and definitions
* **QoS profiles and QoS profile labels**:
Latency, throughput or priority requirements of the application mapped to relevant QoS profile values. The set of QoS Profiles that a network operator is offering may be retrieved via the `qos-profiles` API (cf. https://github.com/camaraproject/QualityOnDemand/) or will be agreed during the onboarding with the API service provider.
* **Identifier for the device**:
At least one identifier for the device (user equipment) out of four options: IPv4 address, IPv6 address, Phone number, or Network Access Identifier assigned by the network operator for the device, at the request time. After the provisioning request is accepted, the device may get different IP addresses, but the provisioning will still apply to the device that was identified during the request process. Note: Network Access Identifier is defined for future use and will not be supported with v0.1 of the API.
* **Notification URL and token**:
Developers may provide a callback URL (`sink`) on which notifications about all status change events (eg. provisioning termination) can be received from the service provider. This is an optional parameter. The notification will be sent as a CloudEvent compliant message. If `sink` is included, it is RECOMMENDED for the client to provide as well the `sinkCredential` property to protect the notification endpoint. In the current version,`sinkCredential.credentialType` MUST be set to `ACCESSTOKEN` if provided.
# Resources and Operations overview
The API defines four operations:
- An operation to setup a new QoD provisioning for a given device.
- An operation to get the information about a specific QoD provisioning, identified by its `provisioningId`.
- An operation to get the QoD provisioning for a given device.
- An operation to terminate a QoD provisioning, identified by its `provisioningId`.
# Authorization and Authentication
[Camara Security and Interoperability Profile](https://github.com/camaraproject/IdentityAndConsentManagement/blob/main/documentation/CAMARA-Security-Interoperability.md) provides details on how a client requests an access token.
Which specific authorization flows are to be used will be determined during onboarding process, happening between the API Client and the Telco Operator exposing the API, taking into account the declared purpose for accessing the API, while also being subject to the prevailing legal framework dictated by local legislation.
It is important to remark that in cases where personal user data is processed by the API, and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of 3-legged access tokens becomes mandatory. This measure ensures that the API remains in strict compliance with user privacy preferences and regulatory obligations, upholding the principles of transparency and user-centric data control.
# Identifying a device from the access token
This specification defines the `device` object field as optional in API requests, specifically in cases where the API is accessed using a 3-legged access token, and the device can be uniquely identified by the token. This approach simplifies API usage for API consumers by relying on the device information associated with the access token used to invoke the API.
## Handling of device information:
### Optional device object for 3-legged tokens:
- When using a 3-legged access token, the device associated with the access token must be considered as the device for the API request. This means that the device object is not required in the request, and if included it must identify the same device, therefore **it is recommended NOT to include it in these scenarios** to simplify the API usage and avoid additional validations.
### Validation mechanism:
- The server will extract the device identification from the access token, if available.
- If the API request additionally includes a `device` object when using a 3-legged access token, the API will validate that the device identifier provided matches the one associated with the access token.
- If there is a mismatch, the API will respond with a 403 - INVALID_TOKEN_CONTEXT error, indicating that the device information in the request does not match the token.
### Error handling for unidentifiable devices:
- If the `device` object is not included in the request and the device information cannot be derived from the 3-legged access token, the server will return a 422 `UNIDENTIFIABLE_DEVICE` error.
### Restrictions for tokens without an associated authenticated identifier:
- For scenarios which do not have a single device identifier associated to the token during the authentication flow, e.g. 2-legged access tokens, the `device` object MUST be provided in the API request. This ensures that the device identification is explicit and valid for each API call made with these tokens.
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
title: QoD Provisioning API
version: 0.1.0
x-camara-commonalities: 0.4.0
externalDocs:
description: Project documentation at CAMARA
url: https://github.com/camaraproject/QualityOnDemand
servers:
- url: "{apiRoot}/qod-provisioning/v0.1"
variables:
apiRoot:
default: http://localhost:9091
description: "API root, defined by the service provider, e.g. `api.example.com`\
\ or `api.example.com/somepath`"
tags:
- description: Manage the permanent provisioning of QoD
name: QoD Provisioning
paths:
/device-qos:
post:
callbacks:
notifications:
'{$request.body#/sink}':
post:
description: |
Important: this endpoint is to be implemented by the API consumer.
The QoD server will call this endpoint whenever any QoD provisioning change related event occurs.
Currently only `PROVISIONING_STATUS_CHANGED` event is defined.
operationId: postProvisioningNotification
parameters:
- description: Correlation id for the different services
explode: false
in: header
name: x-correlator
required: false
schema:
type: string
style: simple
requestBody:
content:
application/cloudevents+json:
examples:
PROVISIONING_STATUS_CHANGED_EXAMPLE:
$ref: '#/components/examples/PROVISIONING_STATUS_CHANGED_EXAMPLE'
schema:
$ref: '#/components/schemas/CloudEvent'
required: true
responses:
"204":
description: Successful notification
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"400":
content:
application/json:
examples:
GENERIC_400_INVALID_ARGUMENT:
description: Invalid Argument. Generic Syntax Exception
value:
status: 400
code: INVALID_ARGUMENT
message: "Client specified an invalid argument, request\
\ body or query param."
GENERIC_400_OUT_OF_RANGE:
description: Out of Range. Specific Syntax Exception used
when a given field has a pre-defined range or a invalid
filter criteria combination is requested
value:
status: 400
code: OUT_OF_RANGE
message: Client specified an invalid range.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Bad Request
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"401":
content:
application/json:
examples:
GENERIC_401_UNAUTHENTICATED:
description: Request cannot be authenticated
value:
status: 401
code: UNAUTHENTICATED
message: "Request not authenticated due to missing, invalid,\
\ or expired credentials."
GENERIC_401_AUTHENTICATION_REQUIRED:
description: "New authentication is needed, authentication\
\ is no longer valid"
value:
status: 401
code: AUTHENTICATION_REQUIRED
message: New authentication is required.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Unauthorized
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"403":
content:
application/json:
examples:
GENERIC_403_PERMISSION_DENIED:
description: Permission denied. OAuth2 token access does
not have the required scope or when the user fails operational
security
value:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to
perform this action.
GENERIC_403_INVALID_TOKEN_CONTEXT:
description: Reflect some inconsistency between information
in some field of the API and the related OAuth2 Token
value:
status: 403
code: INVALID_TOKEN_CONTEXT
message: "{{field}} is not consistent with access token."
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Forbidden
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"410":
content:
application/json:
examples:
GENERIC_410_GONE:
description: Use in notifications flow to allow API Consumer
to indicate that its callback is no longer available
value:
status: 410
code: GONE
message: Access to the target resource is no longer available.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Gone
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"429":
content:
application/json:
examples:
GENERIC_429_QUOTA_EXCEEDED:
description: Request is rejected due to exceeding a business
quota limit
value:
status: 429
code: QUOTA_EXCEEDED
message: Either out of resource quota or reaching rate
limiting.
GENERIC_429_TOO_MANY_REQUESTS:
description: API Server request limit is overpassed
value:
status: 429
code: TOO_MANY_REQUESTS
message: Either out of resource quota or reaching rate
limiting.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Too Many Requests
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"500":
content:
application/json:
examples:
GENERIC_500_INTERNAL:
description: Problem in Server side. Regular Server Exception
value:
status: 500
code: INTERNAL
message: Unknown server error. Typically a server bug.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Internal server error
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"503":
content:
application/json:
examples:
GENERIC_503_UNAVAILABLE:
description: Service is not available. Temporary situation
usually related to maintenance process in the server side
value:
status: 503
code: UNAVAILABLE
message: Service Unavailable.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Service unavailable
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
security:
- {}
- notificationsBearerAuth: []
summary: Provisioning notifications callback
x-callback-request: true
description: |
Triggers a new provisioning in the operator to assign certain QoS Profile to certain device.
- If the provisioning is completed synchronously, the response will be 201 with `status` = `AVAILABLE`.
- If the provisioning request is accepted but not yet completed, the response will be 201 with `status` = `REQUESTED`.
- If the operator determines synchronously that the provisioning request cannot be fulfilled, the response will be 201 with `status` = `UNAVAILABLE`.
- If the request includes the `sink` and `sinkCredential` properties, the client will receive a `status-changed` event with the outcome of the process. The event will be sent also for synchronous operations.
**NOTES:**
- When the provisioning status becomes `UNAVAILABLE`, the QoD provisioning resource is not immediately released, but will get deleted automatically, at earliest 360 seconds after.
This behavior allows clients which are not receiving notification events but are polling, to get the provisioning status information. Before a client can attempt to create a new QoD provisioning for the same device, they must release the provisioning resources with an explicit `delete` operation if not yet automatically deleted.
- The access token may be either 2-legged or 3-legged.
- If a 3-legged access token which is associated with a device is used, 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.
operationId: createProvisioning
parameters:
- description: Correlation id for the different services
explode: false
in: header
name: x-correlator
required: false
schema:
type: string
style: simple
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateProvisioning'
description: Parameters to create a new provisioning
required: true
responses:
"201":
content:
application/json:
schema:
$ref: '#/components/schemas/ProvisioningInfo'
description: Provisioning created
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"400":
content:
application/json:
examples:
GENERIC_400_INVALID_ARGUMENT:
description: Invalid Argument. Generic Syntax Exception
value:
status: 400
code: INVALID_ARGUMENT
message: "Client specified an invalid argument, request body or\
\ query param."
GENERIC_400_OUT_OF_RANGE:
description: Out of Range. Specific Syntax Exception used when a
given field has a pre-defined range or a invalid filter criteria
combination is requested
value:
status: 400
code: OUT_OF_RANGE
message: Client specified an invalid range.
GENERIC_400_INVALID_CREDENTIAL:
value:
status: 400
code: INVALID_CREDENTIAL
message: Only Access token is supported
GENERIC_400_INVALID_TOKEN:
value:
status: 400
code: INVALID_TOKEN
message: Only bearer token is supported
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Bad Request with additional errors for implicit notifications
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"401":
content:
application/json:
examples:
GENERIC_401_UNAUTHENTICATED:
description: Request cannot be authenticated
value:
status: 401
code: UNAUTHENTICATED
message: "Request not authenticated due to missing, invalid, or\
\ expired credentials."
GENERIC_401_AUTHENTICATION_REQUIRED:
description: "New authentication is needed, authentication is no\
\ longer valid"
value:
status: 401
code: AUTHENTICATION_REQUIRED
message: New authentication is required.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Unauthorized
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"403":
content:
application/json:
examples:
GENERIC_403_PERMISSION_DENIED:
description: Permission denied. OAuth2 token access does not have
the required scope or when the user fails operational security
value:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform
this action.
GENERIC_403_INVALID_TOKEN_CONTEXT:
description: Reflect some inconsistency between information in some
field of the API and the related OAuth2 Token
value:
status: 403
code: INVALID_TOKEN_CONTEXT
message: "{{field}} is not consistent with access token."
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Forbidden
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"404":
content:
application/json:
examples:
GENERIC_404_NOT_FOUND:
description: Resource is not found
value:
status: 404
code: NOT_FOUND
message: The specified resource is not found.
GENERIC_404_DEVICE_NOT_FOUND:
description: Device identifier not found
value:
status: 404
code: DEVICE_NOT_FOUND
message: Device identifier not found.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Not found
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"409":
content:
application/json:
examples:
PROVISIONING_409_CONFLICT:
description: The requested provisioning conflicts with an existing
one
value:
status: 409
code: CONFLICT
message: There is another existing provisioning for the same device
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Provisioning conflict
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"422":
content:
application/json:
examples:
GENERIC_422_UNPROCESSABLE_ENTITY:
description: The request was well-formed but was unable to be processed
due to semantic errors or not applicable values. This is the generic
error code for 422 responses.
value:
status: 422
code: UNPROCESSABLE_ENTITY
message: "Value not acceptable: ..."
GENERIC_422_DEVICE_IDENTIFIERS_MISMATCH:
description: Inconsistency between device identifiers not pointing
to the same device
value:
status: 422
code: DEVICE_IDENTIFIERS_MISMATCH
message: Provided device identifiers are not consistent.
GENERIC_422_DEVICE_NOT_APPLICABLE:
description: Service is not available for the provided device
value:
status: 422
code: DEVICE_NOT_APPLICABLE
message: The service is not available for the provided device.
GENERIC_422_UNSUPPORTED_DEVICE_IDENTIFIERS:
description: Message may list the supported device identifiers
value:
status: 422
code: UNSUPPORTED_DEVICE_IDENTIFIERS
message: "Supported device supported are: ..."
GENERIC_422_UNIDENTIFIABLE_DEVICE:
description: Service is not available for the provided device
value:
status: 422
code: UNIDENTIFIABLE_DEVICE
message: The device cannot be identified.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Unprocessable entity
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"429":
content:
application/json:
examples:
GENERIC_429_QUOTA_EXCEEDED:
description: Request is rejected due to exceeding a business quota
limit
value:
status: 429
code: QUOTA_EXCEEDED
message: Either out of resource quota or reaching rate limiting.
GENERIC_429_TOO_MANY_REQUESTS:
description: API Server request limit is overpassed
value:
status: 429
code: TOO_MANY_REQUESTS
message: Either out of resource quota or reaching rate limiting.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Too Many Requests
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"500":
content:
application/json:
examples:
GENERIC_500_INTERNAL:
description: Problem in Server side. Regular Server Exception
value:
status: 500
code: INTERNAL
message: Unknown server error. Typically a server bug.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Internal server error
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"503":
content:
application/json:
examples:
GENERIC_503_UNAVAILABLE:
description: Service is not available. Temporary situation usually
related to maintenance process in the server side
value:
status: 503
code: UNAVAILABLE
message: Service Unavailable.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Service unavailable
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
security:
- openId:
- qod-provisioning:device-qos:create
summary: Sets a new provisioning of QoS for a device
tags:
- QoD Provisioning
/device-qos/{provisioningId}:
delete:
description: |
Release resources related to QoS provisioning.
If the notification callback is provided and the provisioning status was `AVAILABLE`, when the deletion is completed, the client will receive in addition to the response a `PROVISIONING_STATUS_CHANGED` event with
- `status` as `UNAVAILABLE` and
- `statusInfo` as `DELETE_REQUESTED`
There will be no notification event if the `status` was already `UNAVAILABLE`.
**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 QoD provisioning must also be associated with the access token.
- The QoD provisioning must have been created by the same API client given in the access token.
operationId: deleteProvisioning
parameters:
- description: Provisioning ID that was obtained from the createProvision operation
explode: false
in: path
name: provisioningId
required: true
schema:
$ref: '#/components/schemas/ProvisioningId'
style: simple
- description: Correlation id for the different services
explode: false
in: header
name: x-correlator
required: false
schema:
type: string
style: simple
responses:
"204":
description: Provisioning deleted
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"202":
content:
application/json:
schema:
$ref: '#/components/schemas/ProvisioningInfo'
description: Deletion request accepted to be processed. It applies for an
async deletion process. `status` in the response will be `AVAILABLE` with
`statusInfo` set to `DELETE_REQUESTED`.
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"400":
content:
application/json:
examples:
GENERIC_400_INVALID_ARGUMENT:
description: Invalid Argument. Generic Syntax Exception
value:
status: 400
code: INVALID_ARGUMENT
message: "Client specified an invalid argument, request body or\
\ query param."
GENERIC_400_OUT_OF_RANGE:
description: Out of Range. Specific Syntax Exception used when a
given field has a pre-defined range or a invalid filter criteria
combination is requested
value:
status: 400
code: OUT_OF_RANGE
message: Client specified an invalid range.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Bad Request
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"401":
content:
application/json:
examples:
GENERIC_401_UNAUTHENTICATED:
description: Request cannot be authenticated
value:
status: 401
code: UNAUTHENTICATED
message: "Request not authenticated due to missing, invalid, or\
\ expired credentials."
GENERIC_401_AUTHENTICATION_REQUIRED:
description: "New authentication is needed, authentication is no\
\ longer valid"
value:
status: 401
code: AUTHENTICATION_REQUIRED
message: New authentication is required.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Unauthorized
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"403":
content:
application/json:
examples:
GENERIC_403_PERMISSION_DENIED:
description: Permission denied. OAuth2 token access does not have
the required scope or when the user fails operational security
value:
status: 403
code: PERMISSION_DENIED
message: Client does not have sufficient permissions to perform
this action.
GENERIC_403_INVALID_TOKEN_CONTEXT:
description: Reflect some inconsistency between information in some
field of the API and the related OAuth2 Token
value:
status: 403
code: INVALID_TOKEN_CONTEXT
message: "{{field}} is not consistent with access token."
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Forbidden
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
"404":
content:
application/json:
examples:
GENERIC_404_NOT_FOUND:
description: Resource is not found
value:
status: 404
code: NOT_FOUND
message: The specified resource is not found.
schema:
$ref: '#/components/schemas/ErrorInfo'
description: Not found
headers:
x-cor
# --- truncated at 32 KB (85 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/etsi/refs/heads/main/openapi/camara/openslice-camara-qod-provisioning.yaml