From ccb0ddfda09db835ad541506b7ad431cb431951f Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Tue, 28 Jul 2026 11:09:50 +0100 Subject: [PATCH 1/3] Use cloud events for notifications --- .../predictive-connectivity-data.yaml | 171 ++++++++++++------ 1 file changed, 111 insertions(+), 60 deletions(-) diff --git a/code/API_definitions/predictive-connectivity-data.yaml b/code/API_definitions/predictive-connectivity-data.yaml index 3334cc3..ab62b49 100644 --- a/code/API_definitions/predictive-connectivity-data.yaml +++ b/code/API_definitions/predictive-connectivity-data.yaml @@ -263,26 +263,26 @@ paths: $ref: '../common/CAMARA_common.yaml#/components/responses/Generic429' callbacks: connectivityCallback: - '{$request.body#/sink}': + "{$request.body#/sink}": post: summary: Callback for asynchronous connectivity data retrieval description: >- This callback is invoked to provide the result of an asynchronous connectivity data retrieval request. - operationId: connectivityCallback + operationId: sendConnectivityData parameters: - $ref: "../common/CAMARA_common.yaml#/components/parameters/x-correlator" requestBody: + required: true content: - application/json: + application/cloudevents+json: schema: - $ref: '#/components/schemas/ConnectivityDataAsyncResponse' + $ref: "#/components/schemas/ApiNotificationEvent" examples: ConnectivityDataSupportedAreaAsyncResponseExample: $ref: "#/components/examples/ConnectivityDataSupportedAreaAsyncResponseExample" ConnectivityDataOperationNotCompletedExample: $ref: "#/components/examples/ConnectivityDataOperationNotCompletedExample" - required: true responses: "204": description: Successful notification @@ -309,6 +309,43 @@ components: notificationsBearerAuth: $ref: "../common/CAMARA_event_common.yaml#/components/securitySchemes/notificationsBearerAuth" schemas: + ApiEventType: + type: string + description: | + The list of events that can be sent by the API + enum: + - org.camaraproject.predictive-connectivity-data.v0.connectivity-data-available + - org.camaraproject.predictive-connectivity-data.v0.connectivity-data-not-available + EventConnectivityDataAvailable: + description: Event structure for event type connectivity-data-available, containing the connectivity data + allOf: + - $ref: "#/components/schemas/ApiNotificationEvent" + - type: object + properties: + data: + $ref: "#/components/schemas/ConnectivityDataAsyncResponse" + EventConnectivityDataNotAvailable: + description: Event structure for event type connectivity-data-not-available + allOf: + - $ref: "#/components/schemas/ApiNotificationEvent" + - type: object + properties: + data: + $ref: "#/components/schemas/ConnectivityDataAsyncResponse" + ApiNotificationEvent: + description: | + Callback that includes the connectivity data + allOf: + - $ref: "../common/CAMARA_event_common.yaml#/components/schemas/CloudEvent" + - type: object + properties: + type: + $ref: "#/components/schemas/ApiEventType" + discriminator: + propertyName: "type" + mapping: + org.camaraproject.predictive-connectivity-data.v0.connectivity-data-available: "#/components/schemas/EventConnectivityDataAvailable" + org.camaraproject.predictive-connectivity-data.v0.connectivity-data-not-available: "#/components/schemas/EventConnectivityDataNotAvailable" RetrieveConnectivityRequest: type: object description: Request object for retrieving connectivity data in a specified area. @@ -906,64 +943,78 @@ components: ConnectivityDataSupportedAreaAsyncResponseExample: description: Connectivity data supported area async response example value: - layerThickness: 30 - timedConnectivityData: - - startTime: "2024-01-03T11:00:00Z" - endTime: "2024-01-03T12:00:00Z" - cellConnectivityData: - - geohash: ezdmemd - layerConnectivities: - - GC - - GC - - GC - - GC - - GC - - NC - - NC - - NC - - geohash: ezdmemc - layerConnectivities: - - GC - - GC - - GC - - GC - - GC - - NC - - NC - - NC - - startTime: "2024-01-03T12:00:00Z" - endTime: "2024-01-03T13:00:00Z" - cellConnectivityData: - - geohash: ezdmemd - layerConnectivities: - - GC - - GC - - GC - - GC - - GC - - NC - - NC - - NC - - geohash: ezdmemc - layerConnectivities: - - GC - - GC - - GC - - GC - - GC - - NC - - NC - - NC - status: SUPPORTED_AREA - operationId: 2322f362-eaab-4cf3-86d2-efcbdf3a7cb4 + id: 123654, + source: "https://notificationSendServer12.example.com", + type: "org.camaraproject.predictive-connectivity-data.v0.connectivity-data-available", + specversion: "1.0", + datacontenttype: "application/json", + time: "2023-01-17T13:18:23.682Z" + data: + layerThickness: 30 + timedConnectivityData: + - startTime: "2024-01-03T11:00:00Z" + endTime: "2024-01-03T12:00:00Z" + cellConnectivityData: + - geohash: ezdmemd + layerConnectivities: + - GC + - GC + - GC + - GC + - GC + - NC + - NC + - NC + - geohash: ezdmemc + layerConnectivities: + - GC + - GC + - GC + - GC + - GC + - NC + - NC + - NC + - startTime: "2024-01-03T12:00:00Z" + endTime: "2024-01-03T13:00:00Z" + cellConnectivityData: + - geohash: ezdmemd + layerConnectivities: + - GC + - GC + - GC + - GC + - GC + - NC + - NC + - NC + - geohash: ezdmemc + layerConnectivities: + - GC + - GC + - GC + - GC + - GC + - NC + - NC + - NC + status: SUPPORTED_AREA + operationId: 2322f362-eaab-4cf3-86d2-efcbdf3a7cb4 ConnectivityDataOperationNotCompletedExample: description: Connectivity data operation not completed example value: - layerThickness: 30 - timedConnectivityData: [] - status: OPERATION_NOT_COMPLETED - statusInfo: Some error happened during the processing of the request - operationId: 2322f362-eaab-4cf3-86d2-efcbdf3a7cb4 + id: 123654, + source: "https://notificationSendServer12.example.com", + type: "org.camaraproject.predictive-connectivity-data.v0.connectivity-data-not-available", + specversion: "1.0", + datacontenttype: "application/json", + time: "2023-01-17T13:18:23.682Z" + data: + layerThickness: 30 + timedConnectivityData: [] + status: OPERATION_NOT_COMPLETED + statusInfo: Some error happened during the processing of the request + operationId: 2322f362-eaab-4cf3-86d2-efcbdf3a7cb4 ConnectivityDataWithSignalStrengthResponseExample: description: Connectivity data with signal strength response example value: From c21dd8ff6aa5fd90cc74465a90653c87720dc318 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Tue, 28 Jul 2026 11:11:56 +0100 Subject: [PATCH 2/3] Remove trailing commas from examples --- .../predictive-connectivity-data.yaml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code/API_definitions/predictive-connectivity-data.yaml b/code/API_definitions/predictive-connectivity-data.yaml index ab62b49..77efb3a 100644 --- a/code/API_definitions/predictive-connectivity-data.yaml +++ b/code/API_definitions/predictive-connectivity-data.yaml @@ -943,11 +943,11 @@ components: ConnectivityDataSupportedAreaAsyncResponseExample: description: Connectivity data supported area async response example value: - id: 123654, - source: "https://notificationSendServer12.example.com", - type: "org.camaraproject.predictive-connectivity-data.v0.connectivity-data-available", - specversion: "1.0", - datacontenttype: "application/json", + id: 123654 + source: "https://notificationSendServer12.example.com" + type: "org.camaraproject.predictive-connectivity-data.v0.connectivity-data-available" + specversion: "1.0" + datacontenttype: "application/json" time: "2023-01-17T13:18:23.682Z" data: layerThickness: 30 @@ -1003,11 +1003,11 @@ components: ConnectivityDataOperationNotCompletedExample: description: Connectivity data operation not completed example value: - id: 123654, - source: "https://notificationSendServer12.example.com", - type: "org.camaraproject.predictive-connectivity-data.v0.connectivity-data-not-available", - specversion: "1.0", - datacontenttype: "application/json", + id: 123654 + source: "https://notificationSendServer12.example.com" + type: "org.camaraproject.predictive-connectivity-data.v0.connectivity-data-not-available" + specversion: "1.0" + datacontenttype: "application/json" time: "2023-01-17T13:18:23.682Z" data: layerThickness: 30 From 17a9a8d722907fcf658bbbccd96d303d2e8ad215 Mon Sep 17 00:00:00 2001 From: Eric Murray Date: Tue, 28 Jul 2026 11:27:58 +0100 Subject: [PATCH 3/3] Change id to string in connectivity data examples Updated id field to be a string in examples. --- code/API_definitions/predictive-connectivity-data.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/API_definitions/predictive-connectivity-data.yaml b/code/API_definitions/predictive-connectivity-data.yaml index 77efb3a..84319fa 100644 --- a/code/API_definitions/predictive-connectivity-data.yaml +++ b/code/API_definitions/predictive-connectivity-data.yaml @@ -943,7 +943,7 @@ components: ConnectivityDataSupportedAreaAsyncResponseExample: description: Connectivity data supported area async response example value: - id: 123654 + id: "123654" source: "https://notificationSendServer12.example.com" type: "org.camaraproject.predictive-connectivity-data.v0.connectivity-data-available" specversion: "1.0" @@ -1003,7 +1003,7 @@ components: ConnectivityDataOperationNotCompletedExample: description: Connectivity data operation not completed example value: - id: 123654 + id: "123654" source: "https://notificationSendServer12.example.com" type: "org.camaraproject.predictive-connectivity-data.v0.connectivity-data-not-available" specversion: "1.0"