The REST-API specification below is generated by Swagger tools. Please refer to the Developers Guide on how to use Swagger to generate specs and documentations.
Starting from release v1.21.0, the REST API implemented in this repo is compliant with O-RAN O-Cloud Notification API Specification for Event Consumers 4.0.
The specification of release v1.0.0 and older can be found here.
2.0.0
Method | URI | Name | Summary |
---|---|---|---|
GET | /api/ocloudNotifications/v2/{ResourceAddress}/CurrentState | get current state | Pulls the event status notifications for specified ResourceAddress. |
Method | URI | Name | Summary |
---|---|---|---|
GET | /api/ocloudNotifications/v2/health | get health | (Extensions to O-RAN API) Returns the health status of API. |
Method | URI | Name | Summary |
---|---|---|---|
GET | /api/ocloudNotifications/v2/publishers | get publishers | (Extensions to O-RAN API) Get publishers. |
Method | URI | Name | Summary |
---|---|---|---|
POST | /api/ocloudNotifications/v2/subscriptions | create subscription | Creates a subscription resource for the Event Consumer. |
DELETE | /api/ocloudNotifications/v2/subscriptions | delete all subscriptions | (Extensions to O-RAN API) Delete all subscriptions. |
DELETE | /api/ocloudNotifications/v2/subscriptions/{subscriptionId} | delete subscription | Delete a specific subscription. |
GET | /api/ocloudNotifications/v2/subscriptions/{subscriptionId} | get subscription by ID | Returns details for a specific subscription. |
GET | /api/ocloudNotifications/v2/subscriptions | get subscriptions | Retrieves a list of subscriptions. |
POST /api/ocloudNotifications/v2/subscriptions
Creates a new subscription for the required event by passing the appropriate payload.
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
SubscriptionInfo | body |
SubscriptionInfo | models.SubscriptionInfo |
The payload will include an event notification request, endpointUri and ResourceAddress. The SubscriptionId and UriLocation are ignored in the POST body (these will be sent to the client after the resource is created). |
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
201 | Created | Shall be returned when the subscription resource is created successfully. | schema | |
400 | Bad Request | Bad request. For example, the endpoint URI is not correctly formatted. | schema | |
404 | Not Found | Not Found. Subscription resource is not available. | schema | |
409 | Conflict | Conflict. The subscription resource already exists. | schema |
Status: Created
Status: Bad Request
Status: Not Found
Status: Conflict
DELETE /api/ocloudNotifications/v2/subscriptions
Delete all subscriptions.
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
204 | No Content | Deleted all subscriptions. | schema |
Status: No Content
DELETE /api/ocloudNotifications/v2/subscriptions/{subscriptionId}
Deletes an individual subscription resource object and its associated properties.
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
subscriptionId | path |
string | string |
✓ | Identifier for subscription resource, created after a successful subscription. |
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
204 | No Content | Success. | schema | |
404 | Not Found | Not Found. Subscription resources are not available (not created). | schema |
Status: No Content
Status: Not Found
GET /api/ocloudNotifications/v2/{ResourceAddress}/CurrentState
As a result of successful execution of this method the Event Consumer will receive the current event status notifications of the node that the Event Consumer resides on.
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
ResourceAddress | path |
string | string |
✓ | Identifier for subscription resource |
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
200 | OK | Return the pull event status | schema | |
404 | Not Found | Not Found. Event notification resource is not available on this node. | schema |
Status: OK
Status: Not Found
GET /api/ocloudNotifications/v2/health
Returns the health status for the ocloudNotifications REST API.
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
200 | OK | OK | schema |
Status: OK
GET /api/ocloudNotifications/v2/publishers
Returns a list of publisher details for the cluster node.
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
200 | OK | schema | ||
404 | Not Found | Publishers not found | schema |
Status: OK
Status: Not Found
GET /api/ocloudNotifications/v2/subscriptions/{subscriptionId}
Returns details for the subscription with ID subscriptionId.
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
subscriptionId | path |
string | string |
✓ | Identifier for subscription resource, created after a successful subscription. |
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
200 | OK | Returns the subscription resource object and its associated properties. | schema | |
404 | Not Found | Not Found. Subscription resources are not available (not created). | schema |
Status: OK
Status: Not Found
GET /api/ocloudNotifications/v2/subscriptions
Get a list of subscription object(s) and their associated properties.
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
200 | OK | Returns the subscription resources and their associated properties that already exist. | schema | |
400 | Bad Request | Bad request by the client. | schema |
Status: OK
Status: Bad Request
Array of JSON objects defining the information for the event.
Example:
{
"version": "v1.0",
"values": [{
"ResourceAddress": "/sync/sync-status/sync-state",
"data_type": "notification",
"value_type": "enumeration",
"value": "ACQUIRING-SYNC"
}, {
"ResourceAddress": "/sync/sync-status/sync-state",
"data_type": "metric",
"value_type": "decimal64.3",
"value": 100.3
}
}]
}
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Values | []DataValue | []*DataValue |
||||
Version | string | string |
1.0 |
A json array of values defining the event.
Example:
{
"ResourceAddress": "/cluster/node/ptp",
"data_type": "notification",
"value_type": "enumeration",
"value": "ACQUIRING-SYNC"
}
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
DataType | string | string |
Type of value object. ( notification | metric) | ||
Resource | string | string |
The resource address specifies the Event Producer with a hierarchical path. Currently hierarchical paths with wild cards are not supported. | /east-edge-10/Node3/sync/sync-status/sync-state |
||
Value | interface{} | interface{} |
value in value_type format. | HOLDOVER |
||
ValueType | string | string |
The type format of the value property. | enumeration |
Event Data Model specifies the event Status Notification data model supported by the API. The current model supports JSON encoding of the CloudEvents.io specification for the event payload.
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
ID | string | string |
Identifies the event. The Event Producer SHALL ensure that source + id is unique for each distinct event | e0dcb68b-2541-4d21-ab73-a222e42373c2 |
||
Source | string | string |
Identifies the context in which an event happened. | /sync/sync-status/sync-state |
||
SpecVersion | string | string |
The version of the CloudEvents specification which the event uses. This enables the interpretation of the context. | 1.0 |
||
Time | string | string |
Time at which the event occurred. | 2021-03-05T20:59:00.999999999Z |
||
Type | string | string |
This attribute contains a value describing the type of event related to the originating occurrence. | event.sync.sync-status.synchronization-state-change |
||
data | Data | Data |
SubscriptionInfo defines data types used for subscription.
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
EndPointURI | string | string |
Endpoint URI (a.k.a callback URI), e.g. http://localhost:8080/resourcestatus/ptp | http://event-receiver/endpoint |
||
ID | string | string |
Identifier for the created subscription resource. | d1dd1770-e718-401e-ba32-cef05a286164 |
||
Resource | string | string |
The resource address specifies the Event Producer with a hierarchical path. Format /{clusterName}/{siteName}(/optional/hierarchy/..)/{nodeName}/{(/optional/hierarchy)/resource} |
/east-edge-10/vdu3/o-ran-sync/sync-group/sync-status/sync-state |
||
URILocation | string | string |
The URI location for querying the subscription created. | http://localhost:9043/api/ocloudNotifications/v2/publishers/d1dd1770-e718-401e-ba32-cef05a286164 |
Cloud native events rest API comes with following metrics collectors .
- Number of events published by the rest api.
- Number of active subscriptions.
- Number of active publishers.