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

Introducing corrections for yamllint #166

Merged
merged 10 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 51 additions & 51 deletions code/API_definitions/geofencing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,49 @@ info:
title: Device geofencing API
description: |
API to create, retrieve and delete event subscriptions to realize geofencing for a user device.

# Introduction

With this API, customers can create subscriptions for their devices to receive notifications when a device enters or exits a specified area.
The area provided in the request is described by a circle determined by coordinates (latitude and longitude) and an accuracy defined by the radius.

The area provided in the request is described by a circle determined by coordinates (latitude and longitude) and an accuracy defined by the radius.

Upon successfully creating a subscription, the API will provide an Event Subscription ID, and it will indicate the subscription's expiration date.

If the geofencing-state of a device changes, the event subscriber will be notified back to the provided Notification-Url given by the subscription-request.

Device geofencing API could be useful in scenarios such as:
- Tracking devices for Presetting of Home-Settings

- Tracking devices for Presetting of Home-Settings
- Tracking of logistics

# Relevant terms and definitions

* **Device**: A device refers to any physical entity that can connect to a network and participate in network communication.

* **Area**: It specifies the geographical surface which a device is planned to enter or exit.

# API Functionality

The API exposes following capabilities:

## Device Geofencing subscription
These endpoints allow to manage event subscription on geofencing device location event.
These endpoints allow to manage event subscription on geofencing device location event.

The CAMARA subscription model is detailed in the CAMARA API design guideline document and follows CloudEvents specification.

It is mandatory in the subscription to provide the event `type` for which the client would like to subscribe.
It is mandatory in the subscription to provide the event `type` for which the client would like to subscribe.

Following event ``type`` are managed for this API:
- ``org.camaraproject.geofencing.v0.area-entered`` - Event triggered when the device enters the given area

- ``org.camaraproject.geofencing.v0.area-left`` - Event triggered when the device leaves the given area
Note: Additionally to these list, ``org.camaraproject.geofencing.v0.subscription-ends`` notification `type` is sent when the subscription ends.
This notification does not require dedicated subscription.

Note: Additionally to these list, ``org.camaraproject.geofencing.v0.subscription-ends`` notification `type` is sent when the subscription ends.
This notification does not require dedicated subscription.

It is used when:
- the subscription expire time (optionally set by the requester) has been reached
- the subscription expire time (optionally set by the requester) has been reached
- the maximum number of subscription events (optionally set by the requester) has been reached
- the API server has to stop sending notification prematurely

Expand All @@ -55,11 +55,11 @@ info:

_**WARNING**: This callback endpoint must be exposed on the consumer side as `POST /{$request.body#/webhook/notificationUrl}`.
Developers may provide a callback URL on which notifications regarding geofencing can be received from the service provider.
If an event occurs the application will send events to the provided webhook - 'notificationUrl'._
If an event occurs the application will send events to the provided webhook - 'notificationUrl'._

# Further info and support
(FAQs will be added in a later version of the documentation)

(FAQs will be added in a later version of the documentation)

termsOfService: http://swagger.io/terms/
contact:
Expand Down Expand Up @@ -111,7 +111,7 @@ paths:
The Device Location server will call this endpoint whenever a device geofencing related event occurs.
operationId: postNotification
parameters:
- $ref: '#/components/parameters/x-correlator'
- $ref: '#/components/parameters/x-correlator'
requestBody:
required: true
content:
Expand All @@ -130,7 +130,7 @@ paths:
description: Successful notification
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
$ref: '#/components/headers/x-correlator'
"400":
$ref: "#/components/responses/Generic400"
"401":
Expand Down Expand Up @@ -503,7 +503,7 @@ components:
type: string
description: |
area-entered - Event triggered when the device enters the given area

area-left - Event triggered when the device leaves the given area
enum:
- org.camaraproject.geofencing.v0.area-entered
Expand All @@ -513,9 +513,9 @@ components:
type: string
description: |
area-entered - Event triggered when the device enters the given area

area-left - Event triggered when the device leaves the given area

subscription-ends - Event triggered when the subscription ends
enum:
- org.camaraproject.geofencing.v0.area-entered
Expand All @@ -542,9 +542,9 @@ components:
$ref: "#/components/schemas/SubscriptionDetail"
subscriptionExpireTime:
type: string
format: date-time
description: The date time when the location-tracking has to be terminated.
It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
format: date-time
description: The date time when the location-tracking has to be terminated.
It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
Recommended format is yyyy-MM-dd'T'HH:mm:ss.SSSZ (i.e. which allows 2023-07-03T14:27:08.312+02:00 or 2023-07-03T12:27:08.312Z)
subscriptionMaxEvents:
type: integer
Expand All @@ -568,26 +568,26 @@ components:
type: string
format: date-time
description: The date time when the subscription started.
It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
Recommended format is yyyy-MM-dd'T'HH:mm:ss.SSSZ (i.e. which allows 2023-07-03T14:27:08.312+02:00 or 2023-07-03T12:27:08.312Z)
expiresAt:
type: string
format: date-time
description: The date time when the subscription will expire or expired.
It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
description: The date time when the subscription will expire or expired.
It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
Recommended format is yyyy-MM-dd'T'HH:mm:ss.SSSZ (i.e. which allows 2023-07-03T14:27:08.312+02:00 or 2023-07-03T12:27:08.312Z)
required:
- subscriptionId
- subscriptionId

EventTime:
format: date-time
type: string
description: |
Timestamp of when the occurrence happened.
If the time of the occurrence cannot be determined then this attribute MAY be set to some other time (such as the current time) by the CloudEvents producer,
however all producers for the same source MUST be consistent in this respect. In other words,
either they all use the actual time of the occurrence or they all use the same algorithm to determine the value used.
It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
Timestamp of when the occurrence happened.
If the time of the occurrence cannot be determined then this attribute MAY be set to some other time (such as the current time) by the CloudEvents producer,
however all producers for the same source MUST be consistent in this respect. In other words,
either they all use the actual time of the occurrence or they all use the same algorithm to determine the value used.
It must follow [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) and must have time zone.
Recommended format is yyyy-MM-dd'T'HH:mm:ss.SSSZ (i.e. which allows 2023-07-03T14:27:08.312+02:00 or 2023-07-03T12:27:08.312Z)

CloudEvent:
Expand Down Expand Up @@ -748,7 +748,7 @@ components:
status: 400
code: INVALID_ARGUMENT
message: "Invalid argument"

Generic401:
description: Unauthenticated
headers:
Expand All @@ -762,7 +762,7 @@ components:
status: 401
code: UNAUTHENTICATED
message: "Authorization failed: ..."

Generic403:
description: Permission denied
headers:
Expand All @@ -776,7 +776,7 @@ components:
status: 403
code: PERMISSION_DENIED
message: "Operation not allowed: ..."

Generic404:
description: Not found
headers:
Expand All @@ -790,7 +790,7 @@ components:
status: 404
code: NOT_FOUND
message: "The specified resource is not found"

Generic409:
description: Conflict
headers:
Expand All @@ -804,7 +804,7 @@ components:
status: 409
code: Conflict
message: "There is conflict in the request"

Generic500:
description: Internal server error
headers:
Expand All @@ -818,7 +818,7 @@ components:
status: 500
code: INTERNAL
message: "Internal server error"

Generic503:
description: Service unavailable
headers:
Expand Down
38 changes: 18 additions & 20 deletions code/API_definitions/location-retrieval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ openapi: 3.0.3
info:
title: Location retrieval API
description: |
This API provides the ability to retrieve a device location.
This API provides the ability to retrieve a device location.

# Introduction

With this API, customers can retrieve the area where a certain user device is localized.
With this API, customers can retrieve the area where a certain user device is localized.
The area provided in the response could be described:
- by a circle determined by coordinates (latitude and longitude) and a radius.
- by a circle determined by coordinates (latitude and longitude) and a radius.
- by a simple polygon delimited by segments connecting consecutively an array of coordinates (points). The last point connects to the first point to delimit a closed shape bounded with straight sides.

The retrieved shape depends on the network conditions at the subscriber's location and any of the supported shapes could be received.

The requester could optionally ask for a freshness of the localization information by providing a maxAge ("I want a location not older than 600 seconds")

The result accuracy depends on the network's ability and accuracy to locate the device.
Additionally to location information, the answer will also provide indication about the location time.
The result accuracy depends on the network's ability and accuracy to locate the device.

Additionally to location information, the answer will also provide indication about the location time.

Location retrieval API could be useful in scenarios such as:

Expand Down Expand Up @@ -51,7 +51,7 @@ info:

# Further info and support

(FAQs will be added in a later version of the documentation)
(FAQs will be added in a later version of the documentation)
termsOfService: http://swagger.io/terms/
contact:
email: project-email@sample.com
Expand Down Expand Up @@ -119,7 +119,7 @@ paths:
$ref: '#/components/responses/Generic503'
security:
- openId:
- location-retrieval:read
- location-retrieval:read

components:
securitySchemes:
Expand Down Expand Up @@ -229,22 +229,20 @@ components:
format: ipv6
example: 2001:db8:85a3:8d3:1319:8a2e:370:7344



Location:
type: object
description: Device location
required:
- lastLocationTime
- area
properties:
lastLocationTime:
lastLocationTime:
description: Last date and time when the device was localized. It must follow RFC 3339 and must have time zone. Recommended format is yyyy-MM-dd'T'HH:mm:ss.SSSZ (i.e. which allows 2023-07-03T14:27:08.312+02:00 or 2023-07-03T12:27:08.312Z)
type: string
format: date-time
area:
$ref: '#/components/schemas/Area'

Area:
type: object
properties:
Expand All @@ -270,14 +268,14 @@ components:

Circle:
description: Circular area
allOf:
allOf:
- $ref: "#/components/schemas/Area"
- type: object
required:
- center
- radius
properties:
center:
center:
$ref: "#/components/schemas/Point"
radius:
type: number
Expand All @@ -304,15 +302,15 @@ components:
Point:
type: object
description: Coordinates (latitude, longitude) defining a location in a map
required:
required:
- latitude
- longitude
properties:
properties:
latitude:
$ref: "#/components/schemas/Latitude"
longitude:
$ref: "#/components/schemas/Longitude"
example:
example:
latitude: 50.735851
longitude: 7.10066

Expand All @@ -322,7 +320,7 @@ components:
format: double
minimum: -90
maximum: 90

Longitude:
description: Longitude component of location
type: number
Expand Down Expand Up @@ -440,7 +438,7 @@ components:
lastLocationTime: 2023-10-17T13:18:23.682Z
area:
areaType: CIRCLE
center:
center:
latitude: 45.754114
longitude: 4.860374
radius: 800
Expand Down
Loading