-
Notifications
You must be signed in to change notification settings - Fork 3
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
CNF-13067: O-RAN V3 Rest Api: Status Notification #71
Conversation
c30f8a7
to
3db84e4
Compare
@@ -67,26 +67,19 @@ func (s *Server) createSubscription(w http.ResponseWriter, r *http.Request) { | |||
localmetrics.UpdateSubscriptionCount(localmetrics.FAILCREATE, 1) | |||
return | |||
} | |||
if subExists, ok := s.pubSubAPI.HasSubscription(sub.GetResource()); ok { | |||
clientIDs := s.subscriberAPI.GetClientIDByResource(sub.GetResource()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why Plural clientID's?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be one clientID for the resource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns clientIDs []uuid.UUID
. I did not change the logic.
https://github.com/redhat-cne/sdk-go/blob/main/v1/subscriber/subscriber.go#L254
ce.SetDataContentType(cloudevents.ApplicationJSON) | ||
ce.SetSpecVersion(cloudevents.VersionV03) | ||
ce := cloudevents.NewEvent(cloudevents.VersionV1) | ||
ce.SetSpecVersion(cloudevents.VersionV1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not setting content type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In O-RAN V3.0 spec, Event Data Model (chapter 7.2.2) does not have datacontenttype
and subject
, so I removed them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subject is used by cloudEvent proxy it is internally used
https://github.com/redhat-cne/cloud-event-proxy/blob/d9e98a115ad764a2d15a4ab5b36594b2228d333c/examples/simplehttp/common/subscribe.go#L48
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also it is used by cloudevents specs https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed ce.SetSubject() from simplehttp. I think we are fine here. The subject is not actually used in internal API. The ProcessOutChannel() only uses Status
and Action
.
https://github.com/redhat-cne/cloud-event-proxy/blob/main/cmd/main.go#L219
c297afc
to
00cbdce
Compare
Please add description to this PR |
@@ -49,7 +49,7 @@ type Subscriber struct { | |||
SubStore *store.PubSubStore `json:"subStore" omit:"empty"` | |||
// EndPointURI - A URI describing the subscriber link . | |||
// +required | |||
EndPointURI *types.URI `json:"endPointURI" omit:"empty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible the internal API direct call failure in older version ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no. tested with old version. The subscription was successful.
@@ -84,8 +84,8 @@ func (s *Subscriber) FailedCount() int { | |||
// String returns a pretty-printed representation of the Event. | |||
func (s *Subscriber) String() string { | |||
b := strings.Builder{} | |||
b.WriteString(" EndPointURI: " + s.GetEndPointURI() + "\n") | |||
b.WriteString(" ID: " + s.GetClientID().String() + "\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no. tested with old version. The subscription was successful.
done |
b1356a1
to
becd572
Compare
Signed-off-by: Jack Ding <jackding@gmail.com>
Signed-off-by: Jack Ding <jackding@gmail.com>
More details in doc https://docs.google.com/document/d/1aIgGWhFDDz9aI7mIZm_nlkb99UrV7hv5gS5m_XShCt4/edit