HPE OneView
cancel
Showing results for 
Search instead for 
Did you mean: 

REST API to get Active alerts

 
SOLVED
Go to solution
BradV
Trusted Contributor

REST API to get Active alerts

Trying to just pull out the active alerts using the following: 

ACTIVE=$(curl --insecure \
              --header "X-API-Version: ${currentVersion}" \
              --header "auth: ${sessionID}" \
              --request GET ${OneView}/rest/alerts?start=0&count=-1&filter="alertState EQ 'Active'")

However, getting back a lot with alertState set to "Cleared."  Is something wrong with my syntax?

2 REPLIES 2
BhaskarV
HPE Pro
Solution

Re: REST API to get Active alerts

Hi @BradV 

Small correction to your APU invocation. You may want to use the below with curl, the URL Encoded values for the special characters such as single quote and double quotes.
GET http://localhost/rest/alerts?start=0&coun=-1&filter=%22alertState+EQ+%27Active%27%22

Will let the alerts team respond on the functional issue you are asking about.

Regards,
Bhaskar



I am a HPE Employee
BradV
Trusted Contributor

Re: REST API to get Active alerts

Yes.  That worked better.  :)

Is that in the documentation?  The REST API reference for version 800 and the /rest/alerts does not mention it (unless I missed it?).

 

Thanks!