Ce contenu n'est pas disponible dans la langue sélectionnée.
25.4. Methods
25.4.1. Searching Events Copier lienLien copié sur presse-papiers!
events collection provides search queries similar to other resource collections. An additional feature when searching the events collection is the ability to search from a certain event. This queries all of events since a specified event.
from parameter added before the search query. This from argument references an event id code.
Example 25.3. Searching from an event
GET /api/events;from=1012?search=type%3D30 HTTP/1.1 Accept: application/xml
GET /api/events;from=1012?search=type%3D30 HTTP/1.1
Accept: application/xml
type set to 30 since id="1012"
Example 25.4. Searching using a specific event severity
GET /api/events?search=severity>normal HTTP/1.1 Accept: application/xml
GET /api/events?search=severity>normal HTTP/1.1
Accept: application/xml
normal. Severity levels include normal, warning, error and alert.
25.4.2. Paginating Events Copier lienLien copié sur presse-papiers!
page command in a search query.
page value in combination with the sortby clause:
sortby time asc page 1
sortby clause defines the base element to order of the results and whether the results are ascending or descending. For search queries of events, set the base element to time and the order to ascending (asc) so the API displays all events from the creation of your virtualization environment.
page condition defines the page number. One page equals the default number of events to list. Pagination begins at page 1. To view more pages, increase the page value:
sortby time asc page 2
sortby time asc page 3
sortby time asc page 4
Example 25.5. Paginating events
event resources. The URL-encoded request is:
GET /api/events?search=sortby%20time%20asc%20page%201 HTTP/1.1 Accept: application/xml
GET /api/events?search=sortby%20time%20asc%20page%201 HTTP/1.1
Accept: application/xml
page value to view the next page of results.
GET /api/events?search=sortby%20time%20asc%20page%202 HTTP/1.1 Accept: application/xml
GET /api/events?search=sortby%20time%20asc%20page%202 HTTP/1.1
Accept: application/xml
from argument to set the starting id.
GET /api/events?search=sortby%20time%20asc%20page%202&from=30 HTTP/1.1 Accept: application/xml
GET /api/events?search=sortby%20time%20asc%20page%202&from=30 HTTP/1.1
Accept: application/xml
25.4.3. Adding Events Copier lienLien copié sur presse-papiers!
POST request to the events collection. A new event requires the description, severity, origin, and custom_id elements. Custom events can also include flood_rate, user id, and the id codes of any resources relevant to the event. host and storage_domain elements can contain the external_status element to set an external health status.
Example 25.6. Adding a custom event to the event list
25.4.4. Removing Events Copier lienLien copié sur presse-papiers!
DELETE request.
Example 25.7. Removing an event
DELETE /api/events/1705 HTTP/1.1 HTTP/1.1 204 No Content
DELETE /api/events/1705 HTTP/1.1
HTTP/1.1 204 No Content