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

Add handling when the requested geofence area cannot be covered #224

40 changes: 40 additions & 0 deletions code/API_definitions/geofencing-subscriptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ info:
- the subscription was deleted by the requester
- the Access Token `sinkCredential` (optionally set by the requester) expiration time has been reached
- the API server has to stop sending notification prematurely
- the specified geofence-`area` cannot be covered or is too small to be managed

### Notification callback

Expand Down Expand Up @@ -139,6 +140,8 @@ paths:
$ref: "#/components/examples/CIRCLE_AREA_LEFT"
SUBSCRIPTION_ENDS:
$ref: "#/components/examples/SUBSCRIPTION_ENDS"
SUBSCRIPTION_UNPROCESSABLE:
$ref: "#/components/examples/SUBSCRIPTION_UNPROCESSABLE"
responses:
"204":
description: Successful notification
Expand Down Expand Up @@ -912,20 +915,25 @@ components:
$ref: "#/components/schemas/Area"
terminationReason:
$ref: "#/components/schemas/TerminationReason"
terminationDescription:
description: Explanation why a subscription ended or had to end.
type: string
subscriptionId:
$ref: "#/components/schemas/SubscriptionId"

TerminationReason:
type: string
description: |
- NETWORK_TERMINATED - API server stopped sending notification
- SUBSCRIPTION_UNPROCESSABLE - Subscription cannot be processed due to some reason, e.g. because the specified area cannot be managed. Useful for asynchronous subscription creation.
- SUBSCRIPTION_EXPIRED - Subscription expire time (optionally set by the requester) has been reached
- SUBSCRIPTION_DELETED - Subscription was deleted by the requester
- MAX_EVENTS_REACHED - Maximum number of events (optionally set by the requester) has been reached
- ACCESS_TOKEN_EXPIRED - Access Token sinkCredential (optionally set by the requester) expiration time has been reached
enum:
- MAX_EVENTS_REACHED
- NETWORK_TERMINATED
- SUBSCRIPTION_UNPROCESSABLE
- SUBSCRIPTION_EXPIRED
- SUBSCRIPTION_DELETED
- ACCESS_TOKEN_EXPIRED
Expand Down Expand Up @@ -1214,6 +1222,11 @@ components:
status: 422
code: DEVICE_NOT_APPLICABLE
message: The service is not available for the provided device.
AreaNotCovered:
value:
status: 422
code: "AREA_NOT_COVERED"
message: "The specified area cannot be covered or is too small to be valid"
Generic429:
description: Too Many Requests
headers:
Expand Down Expand Up @@ -1361,4 +1374,31 @@ components:
subscriptionId: 987654321
device:
phoneNumber: +123456789
area:
areaType: CIRCLE
center:
latitude: 50.735851
longitude: 7.10066
radius: 2000
terminationReason: SUBSCRIPTION_EXPIRED

SUBSCRIPTION_UNPROCESSABLE:
description: The cloud event when the subscription process was aborted.
value:
id: "123655"
source: https://notificationSendServer12.supertelco.com
type: org.camaraproject.geofencing-subscriptions.v0.subscription-ends
specversion: "1.0"
datacontenttype: application/json
time: 2023-03-22T05:40:23.682Z
data:
device:
phoneNumber: +123456789
area:
areaType: CIRCLE
center:
latitude: 50.735851
longitude: 7.10066
radius: 2000
terminationReason: SUBSCRIPTION_UNPROCESSABLE
terminationDescription: The requested area cannot be covered by the network.