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

Subscription & events for Commonalities 0.5.0 #313

Merged
merged 45 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c29aecc
Update event-subscription-template.yaml
bigludo7 Oct 10, 2024
1a24c53
Update API-design-guidelines.md
bigludo7 Oct 10, 2024
fc41bbe
Update API-design-guidelines.md
bigludo7 Oct 10, 2024
8bd8ef5
Update event-subscription-template.yaml
bigludo7 Oct 10, 2024
6030436
Update API-design-guidelines.md
bigludo7 Oct 10, 2024
fef315b
Update API-design-guidelines.md
bigludo7 Oct 10, 2024
f05f4d3
Update event-subscription-template.yaml
bigludo7 Oct 10, 2024
5156577
Update event-subscription-template.yaml
bigludo7 Oct 17, 2024
aa621fd
Update API-design-guidelines.md
bigludo7 Oct 17, 2024
8b8dab8
Update API-design-guidelines.md
bigludo7 Oct 17, 2024
e1c6ca8
Update artifacts/camara-cloudevents/event-subscription-template.yaml
bigludo7 Oct 18, 2024
2826855
Update artifacts/camara-cloudevents/event-subscription-template.yaml
bigludo7 Oct 18, 2024
f488c6d
Update documentation/API-design-guidelines.md
bigludo7 Oct 18, 2024
b00788b
Update documentation/API-design-guidelines.md
bigludo7 Oct 18, 2024
20343b3
Update documentation/API-design-guidelines.md
bigludo7 Oct 18, 2024
cd24b80
Update documentation/API-design-guidelines.md
bigludo7 Oct 18, 2024
53c052b
Update documentation/API-design-guidelines.md
bigludo7 Oct 18, 2024
9a61691
Update documentation/API-design-guidelines.md
bigludo7 Oct 18, 2024
cdc1ecd
Update documentation/API-design-guidelines.md
bigludo7 Oct 18, 2024
d0b4fc3
Update API-design-guidelines.md
bigludo7 Oct 18, 2024
e7d5444
Update API-design-guidelines.md
bigludo7 Oct 18, 2024
5d00751
Update API-design-guidelines.md
bigludo7 Oct 18, 2024
ee2a79f
Update documentation/API-design-guidelines.md
bigludo7 Oct 22, 2024
7db3e2c
Update documentation/API-design-guidelines.md
bigludo7 Oct 22, 2024
0acd0af
Update documentation/API-design-guidelines.md
bigludo7 Oct 22, 2024
93ee9ae
Update API-design-guidelines.md
bigludo7 Oct 22, 2024
754f3fd
Update event-subscription-template.yaml
bigludo7 Oct 29, 2024
c9c187e
Update event-subscription-template.yaml
bigludo7 Oct 29, 2024
cc80891
Update event-subscription-template.yaml
bigludo7 Oct 29, 2024
e61feaf
Update artifacts/camara-cloudevents/event-subscription-template.yaml
bigludo7 Oct 29, 2024
abf4e75
Update event-subscription-template.yaml
bigludo7 Oct 30, 2024
c9c344e
Update event-subscription-template.yaml
bigludo7 Nov 6, 2024
b435e82
Update event-subscription-template.yaml
bigludo7 Nov 12, 2024
8c4fd0a
Update event-subscription-template.yaml (issue326)
bigludo7 Nov 18, 2024
ac994a5
Update artifacts/camara-cloudevents/event-subscription-template.yaml
bigludo7 Nov 21, 2024
f3d5e46
Update documentation/API-design-guidelines.md
bigludo7 Nov 22, 2024
2e08ef7
Update documentation/API-design-guidelines.md
bigludo7 Nov 22, 2024
5636116
Update documentation/API-design-guidelines.md
bigludo7 Nov 22, 2024
cfe5135
Update documentation/API-design-guidelines.md
bigludo7 Nov 24, 2024
9cf747a
Update documentation/API-design-guidelines.md
bigludo7 Nov 24, 2024
2b278aa
Update documentation/API-design-guidelines.md
bigludo7 Nov 24, 2024
dc5f9fa
Update documentation/API-design-guidelines.md
bigludo7 Nov 24, 2024
35737cf
Fixe title 11
bigludo7 Nov 24, 2024
07d4ff4
Update API-design-guidelines.md
rartych Nov 25, 2024
54e561d
Update API-design-guidelines.md
rartych Nov 25, 2024
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
116 changes: 31 additions & 85 deletions artifacts/camara-cloudevents/event-subscription-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ info:
description: |
This file is a template for CAMARA API explicit subscription endpoint and for Notification model. Additional information are provided in API Design Guidelines document.
Note on ``security`` - ``openId`` scope: The value in this yaml `api-name:event-type:grant-level` must be replaced accordingly to the format defined in the guideline document.
Note on event name convention: the event type name MUST follow: ``org.camaraproject.<api-name>.<api-version>.<event-name>``
Note on ``security`` - ``openId`` scope: The value in this yaml `api-name:event-type1:grant-level` must be replaced accordingly to the format defined in the guideline document.
license:
name: Apache 2.0
Expand All @@ -16,14 +18,12 @@ externalDocs:
description: Product documentation at CAMARA
url: https://github.com/camaraproject/
servers:
- url: "{apiRoot}/{apiName}/v0.1"
- url: "{apiRoot}/api-name/vx.y"
# api-name and version should valued accordingly to the API
variables:
apiRoot:
default: http://localhost:9091
description: API root
apiName:
default: camaraAPI
description: apiName will be replaced in WG by its value and not modelled as a variable
description: API root, defined by the service provider, e.g. `api.example.com` or `api.example.com/somepath`
tags:
- name: <apiName> Subscription
description: Operations to manage event subscriptions on event-type event
Expand All @@ -40,7 +40,8 @@ paths:
- $ref: "#/components/parameters/x-correlator"
security:
- openId:
- api-name:event-type:grant-level
- api-name:event-type1:grant-level
- api-name:event-type2:grant-level
requestBody:
content:
application/json:
Expand Down Expand Up @@ -81,10 +82,6 @@ paths:
$ref: "#/components/responses/Generic410"
"429":
$ref: "#/components/responses/Generic429"
"500":
$ref: "#/components/responses/Generic500"
"503":
$ref: "#/components/responses/Generic503"
security:
- {}
- notificationsBearerAuth: []
Expand Down Expand Up @@ -116,16 +113,10 @@ paths:
$ref: "#/components/responses/SubscriptionPermissionDenied403"
"409":
$ref: "#/components/responses/Generic409"
"415":
$ref: "#/components/responses/Generic415"
"422":
$ref: "#/components/responses/CreateSubscriptionUnprocessableEntity422"
"429":
$ref: "#/components/responses/Generic429"
"500":
$ref: "#/components/responses/Generic500"
"503":
$ref: "#/components/responses/Generic503"
get:
tags:
- <apiName> Subscription
Expand Down Expand Up @@ -156,10 +147,6 @@ paths:
$ref: "#/components/responses/Generic401"
"403":
$ref: "#/components/responses/Generic403"
"500":
$ref: "#/components/responses/Generic500"
"503":
$ref: "#/components/responses/Generic503"
/subscriptions/{subscriptionId}:
get:
tags:
Expand Down Expand Up @@ -191,10 +178,6 @@ paths:
$ref: "#/components/responses/Generic403"
"404":
$ref: "#/components/responses/Generic404"
"500":
$ref: "#/components/responses/Generic500"
"503":
$ref: "#/components/responses/Generic503"
delete:
tags:
- <apiName> Subscription
Expand Down Expand Up @@ -230,10 +213,6 @@ paths:
$ref: "#/components/responses/Generic403"
"404":
$ref: "#/components/responses/Generic404"
"500":
$ref: "#/components/responses/Generic500"
"503":
$ref: "#/components/responses/Generic503"
components:
securitySchemes:
openId:
Expand Down Expand Up @@ -301,13 +280,12 @@ components:
types:
description: |
Camara Event types eligible to be delivered by this subscription.
Note: for the Commonalities meta-release v0.4 we enforce to have only event type per subscription then for following meta-release use of array MUST be decided
at API project level.
Note: for the current Commonalities version (v0.5) only one event type per subscription is allowed, yet in the following releases use of array of event types SHALL be specified without changing this definition.
type: array
minItems: 1
maxItems: 1
items:
type: string
$ref: "#/components/schemas/SubscriptionEventType"
config:
$ref: "#/components/schemas/Config"
discriminator:
Expand Down Expand Up @@ -453,13 +431,22 @@ components:
EventTypeNotification:
type: string
description: |
event-type - Event triggered when an event-type event occurred
event-type - Event triggered when an event-type event occurred. Several event-type could be defined.
subscription-ends: Event triggered when the subscription ends
enum:
- org.camaraproject.api-name.v0.event-type
- org.camaraproject.api-name.v0.event-type1
- org.camaraproject.api-name.v0.event-type2
- org.camaraproject.api-name.v0.subscription-ends

SubscriptionEventType:
type: string
description: |
event-type that could be subscribed through this subscription. Several event-type could be defined.
enum:
- org.camaraproject.api-name.v0.event-type1
- org.camaraproject.api-name.v0.event-type2

Subscription:
description: Represents a event-type subscription.
type: object
Expand Down Expand Up @@ -572,7 +559,8 @@ components:
discriminator:
propertyName: "type"
mapping:
org.camaraproject.api-name.v0.event-type: "#/components/schemas/Event-typeEvent"
org.camaraproject.api-name.v0.event-type1: "#/components/schemas/EventApiSpecific1"
org.camaraproject.api-name.v0.event-type2: "#/components/schemas/EventApiSpecific2"
org.camaraproject.api-name.v0.subscription-ends: "#/components/schemas/EventSubscriptionEnds"

Source:
Expand All @@ -597,8 +585,14 @@ components:
description: Timestamp of when the occurrence happened. Must adhere to RFC 3339.
example: "2018-04-05T17:31:00Z"

Event-typeEvent:
description: event structure for event-type event
EventApiSpecific1:
description: event structure for event-type event 1
allOf:
- $ref: "#/components/schemas/CloudEvent"
- type: object

EventApiSpecific2:
description: event structure for event-type event 2
allOf:
- $ref: "#/components/schemas/CloudEvent"
- type: object
Expand Down Expand Up @@ -965,22 +959,6 @@ components:
status: 410
code: GONE
message: Access to the target resource is no longer available.
Generic415:
description: Unsupported Media Type
headers:
X-Correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
GENERIC_415_UNSUPPORTED_MEDIA_TYPE:
description: Payload format of the request is in an unsupported format by the Server. Should not happen
value:
status: 415
code: UNSUPPORTED_MEDIA_TYPE
message: The server refuses to accept the request because the payload format is in an unsupported format
CreateSubscriptionUnprocessableEntity422:
description: Unprocessable Entity
headers:
Expand Down Expand Up @@ -1030,38 +1008,6 @@ components:
status: 429
code: TOO_MANY_REQUESTS
message: Either out of resource quota or reaching rate limiting.
Generic500:
description: Server error
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
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.
Generic503:
description: Service unavailable. Typically the server is down.
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
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.
SubscriptionIdRequired:
description: Problem with the client request
headers:
Expand Down
Loading