The REST API is used to create a stream event subscription. The API will create the new event based on the criteria provided. Event-stream identifier is supported with query only.
The web service API uses the POST method to create a stream event subscription. You must provide authentication credentials by using the login API before accessing the data. For information about the authentication process, see Web services authentication.
The generic format of the URL to create a stream event subscription is as follows:
http|https://<serverHost>:<port>/bppmws/api/stream/subscribe?
dataType=event
You can provide the following parameters to create a stream event subscriptions in the JSON format along with the URL.
When you provide input parameters for any web service request, you must specify the content-type parameter in the header of the web service request as follows:
content-type application/json
Attributes | Description |
---|---|
dataType | Type of data to be streamed. The supported type is |
subscriptionName | Unique name for the subscription. |
destination | The details of requested destination. |
criteria | A criteria defines the following fields:
|
criterias | One or more criteria used to select data. Specifying at least a single criteria is mandatory. |
{ "subscriptionName": "Prod_Critical_events", "criterias": [ { "resourceType": "cell", "condition": "name EQUALS \"pncell_vm-w28-rds1304\"", "criterias": [ { "resourceType": "event", "condition": "severity EQUALS \"CRITICAL\"" } ] } ], "destination": { "type": "REST", "url": "http://{HOSTNAME}:8080/TestStreamingClient/notify", "username": "admin", "password": "YWRtaW4=" } }
A sample JSON response is as follows:
{ "response": [ {"subscriptionId": "e6a9bb54-da25-102b-9a03-2db401e887ec"} ], "statusCode": "200", "statusMsg": "OK", "responseTimeStamp": "2012-06-20T08:36:24" }
The web service API uses the DELETE method to unsubscribe a stream event subscription. You must provide authentication credentials by using the login API before accessing the data. For information about the authentication process, see Web services authentication.
The generic format of the URL to delete a stream event subscription is as follows:
http|https://<serverHost>:<port>/bppmws/api/stream/<subscriptionID>/unsubscribe
A sample JSON response is as follows:
{ "response": [ {"subscriptionId": ["e6a9bb54-da25-102b-9a03-2db401e887ec"]} ], "statusCode": "200", "statusMsg": "OK", "responseTimeStamp": "2013-06-20T08:36:24" }
List all Subscriptions REST API (POST method) is used to list all the stream event subscriptions specified in the URL.
You must provide authentication credentials by using the login API before accessing the data. For information about authentication, see Web services authentication.
The generic format of the URL is as follows:
http|https://<serverHost>:<port>/bppmws/api/stream/
list
You must provide a blank {} JSON body as POST body. In addition, you must specify the content-type parameter in the header of the web service request as follows:
content-type application/json
Entry | Description |
---|---|
http|https | Type of protocol to send the request. BMC Infrastructure Management web services support both HTTP and HTTPS protocols. |
serverHost | Host name of the BMC Infrastructure Management Server |
port | Port number through which communication is established. The default port number is 80 if you use the HTTP protocol and 443 if you use the HTTPS protocol. |
The response to the Subscriptions REST API (POST method) depends on the query parameters that you pass.
A sample JSON response is as follows:
{ "response": [ {"subscriptionId": ["e6a9bb54-da25-102b-9a03-2db401e887ec"]}, {"subscriptionId": ["f6a9bb54-da25-102b-9a03-2db401e887ec"]}, {"subscriptionId": ["g6a9bb54-da25-102b-9a03-2db401e887ec"]} ], "statusCode": "200", "statusMsg": "OK", "responseTimeStamp": "2013-06-20T08:36:24" }
List Subscription REST API (GET method) is used to get details about the stream event subscription specified in the URL. It uses the subscriptionID to get the details.
You must provide authentication credentials by using the login API before accessing the data. For information about authentication, see Web services authentication.
The generic format of the URL is as follows:
http|https://<serverHost>:<port>/bppmws/api/stream/
<subscriptionID>/list
Entry | Description |
---|---|
http|https | Type of protocol to send the request. BMC Infrastructure Management web services support both HTTP and HTTPS protocols. |
serverHost | Host name of the BMC Infrastructure Management Server |
port | Port number through which communication is established. The default port number is 80 if you use the HTTP protocol and 443 if you use the HTTPS protocol. |
subscriptionID | The subscription identification returned by the stream/subscribe API. |
The response to the List Subscription REST API (GET method) depends on the query parameters that you pass.
A sample JSON response is as follows:
{ "response": [ { "subscriptionName": "Prod_Critical_events", "criterias": [ { "resourceType": "cell", "condition": "name EQUALS \"pncell_vm-w28-rds1304\"", "criterias": [ { "resourceType": "event", "condition": "severity EQUALS \"CRITICAL\"" } ] } ], "destination": { "type": "REST", "url": "http://{HOSTNAME}:8080/TestStreamingClient/notify", "username": "admin", "password": "YWRtaW4=" } } ], "statusCode": "200", "statusMsg": "OK", "responseTimeStamp": "2013-06-20T08:36:24" }