@@ -293,11 +293,12 @@ info:
293
293
\
294
294
**Notification:**
295
295
Developers can specify a callback URL on which notifications
296
- regarding the requested intent can be received. For example to be notified
297
- when the requested optimal routing is active. It is also provided back
298
- the identificator for the selected EAS instace ("selected_appInstanceId")
299
- from which the Client Application can retrive the destination IP address
300
- of its backend server, to properly configure the service data flow. This
296
+ regarding the requested intent can be received. The notification will be
297
+ sent as a CloudEvent compliant message. For example to be notified when the
298
+ requested optimal routing is active. It is also provided back the
299
+ identificator for the selected EAS instace ("selected_appInstanceId")
300
+ from which the Client Application can retrive the destination IP address of
301
+ its backend server, to properly configure the service data flow. This
301
302
information can be retrived using the CAMARA API: [Edge
302
303
Application Management](https://github.com/camaraproject/EdgeCloud/blob\
303
304
/main/code/API_definitions/Edge-Application-Management.yaml).
@@ -681,6 +682,11 @@ components:
681
682
to the TrafficInfluence resource
682
683
' traffic-influence:traffic-influences:update ' : Grants update
683
684
access to the TrafficInfluence resource
685
+ notificationsBearerAuth :
686
+ description : Bearer authentication for notifications
687
+ type : http
688
+ scheme : bearer
689
+ bearerFormat : " {$request.body#sinkCredential.credentialType}"
684
690
parameters :
685
691
x-correlator :
686
692
name : x-correlator
@@ -698,9 +704,8 @@ components:
698
704
# ########################################################################
699
705
callbacks :
700
706
onTrafficInfluenceChanged :
701
- # when data is sent, it will be sent to the `callbackUrl` provided
702
- # when making the subscription PLUS the suffix `/event`
703
- ' {$request.body.notificationUri}/event ' :
707
+ # when data is sent, it will be sent to the callback url provided
708
+ ' {$request.body.notificationSink.sink} ' :
704
709
post :
705
710
tags :
706
711
- Traffic Influence CALLBACK Operation
@@ -709,16 +714,18 @@ components:
709
714
description : Creating, modifying or delating a Traffic Influece
710
715
resourece is an asycronous task. For this reason a notification
711
716
channel via callback to a specified URL is provided.
712
- operationId : postTrafficInfluence
717
+ operationId : trafficInfluenceCloudEvent
713
718
parameters :
714
719
- $ref : ' #/components/parameters/x-correlator'
720
+ security :
721
+ - notificationsBearerAuth : []
715
722
requestBody :
716
723
description : subscription payload which contains the updated
717
724
traffic influence instance
718
725
content :
719
- application/json :
726
+ application/cloudevents+ json :
720
727
schema :
721
- $ref : ' #/components/schemas/TrafficInfluenceNotification '
728
+ $ref : ' #/components/schemas/CloudEvent '
722
729
responses :
723
730
' 202 ' :
724
731
description : Your server implementation should return this HTTP
@@ -820,6 +827,8 @@ components:
820
827
readOnly : true
821
828
state :
822
829
readOnly : true
830
+ notificationSink :
831
+ $ref : ' #/components/schemas/NotificationSink'
823
832
PostTrafficInfluenceDevice :
824
833
description : iherits from TrafficInfluence restricting the access
825
834
(readonly) to "trafficInfluenceID" and "state", to be used by the API
@@ -833,6 +842,8 @@ components:
833
842
readOnly : true
834
843
state :
835
844
readOnly : true
845
+ notificationSink :
846
+ $ref : ' #/components/schemas/NotificationSink'
836
847
PatchTrafficInfluence :
837
848
description : inherits from TrafficInfluence and restricts the access to
838
849
certain parameters.
@@ -848,6 +859,75 @@ components:
848
859
readOnly : true
849
860
state :
850
861
readOnly : true
862
+ notificationSink :
863
+ $ref : ' #/components/schemas/NotificationSink'
864
+ CloudEvent :
865
+ description : The notification callback
866
+ required :
867
+ - id
868
+ - source
869
+ - specversion
870
+ - type
871
+ - time
872
+ properties :
873
+ id :
874
+ type : string
875
+ description : identifier of this event, that must be unique in the source context.
876
+ minLength : 1
877
+ source :
878
+ $ref : ' #/components/schemas/Source'
879
+ type :
880
+ type : string
881
+ description : ' type of event as defined in each CAMARA API'
882
+ example : ' org.camaraproject.iot.dta-status-changed-event'
883
+ minLength : 25
884
+ specversion :
885
+ type : string
886
+ description : Version of the specification to which this event conforms (must be 1.0 if it conforms to cloudevents 1.0.2 version)
887
+ enum :
888
+ - " 1.0"
889
+ datacontenttype :
890
+ type : string
891
+ description : ' media-type that describes the event payload encoding, must be "application/json" for CAMARA APIs'
892
+ enum :
893
+ - application/json
894
+ data :
895
+ type : object
896
+ description : Event details payload described in each CAMARA API and referenced by its type
897
+ allOf :
898
+ - $ref : ' #/components/schemas/TrafficInfluenceNotification'
899
+ time :
900
+ $ref : " #/components/schemas/DateTime"
901
+ NotificationSink :
902
+ description : " "
903
+ type : object
904
+ required :
905
+ - sink
906
+ properties :
907
+ sink :
908
+ description : ' https callback address where the notification must be POST-ed'
909
+ type : string
910
+ sinkCredentials :
911
+ description : Sink credential provides authorization information necessary to enable delivery of events to a target
912
+ type : object
913
+ properties :
914
+ credentialtype :
915
+ type : string
916
+ description : Type of the credential - MUST be set to ACCESSTOKEN for now
917
+ enum :
918
+ - " ACCESSTOKEN"
919
+ accessToken :
920
+ type : string
921
+ description : Access Token granting access to the POST operation to create notification
922
+ accessTokenExpireUtc :
923
+ type : string
924
+ format : date-time
925
+ description : An absolute UTC instant at which the access token shall be considered expired.
926
+ accessTokenType :
927
+ type : string
928
+ description : Type of access token - MUST be set to bearer for now
929
+ enum :
930
+ - " bearer"
851
931
TrafficInfluenceNotification :
852
932
type : object
853
933
description : Notifican channel for changes in the TrafficInfluence
@@ -859,6 +939,28 @@ components:
859
939
properties :
860
940
selected_appInstanceId :
861
941
$ref : ' #/components/schemas/AppInstanceId'
942
+ DateTime :
943
+ type : string
944
+ format : date-time
945
+ description : |
946
+ Timestamp of when the occurrence happened. Must adhere to RFC 3339.
947
+ WARN: This optional field in CloudEvents specification is required in CAMARA APIs implementation.
948
+ example : ' 2018-04-05T17:31:00Z'
949
+ Source :
950
+ type : string
951
+ format : uri-reference
952
+ minLength : 1
953
+ description : |
954
+ Identifies the context in which an event happened - be a non-empty `URI-reference` like:
955
+ - URI with a DNS authority:
956
+ * https://github.com/cloudevents
957
+
958
+ - Universally-unique URN with a UUID:
959
+ * urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66
960
+ - Application-specific identifier:
961
+ * /cloudevents/spec/pull/123
962
+ * 1-555-123-4567
963
+ example : " https://notificationSendServer12.supertelco.com"
862
964
# #######################################################################
863
965
# Types #
864
966
# #######################################################################
0 commit comments