Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractEventsInto ¶
func ExtractEventsInto(r pagination.Page, v interface{}) error
func List ¶
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List retrieves a list of Events.
Types ¶
type DateFilter ¶
type DateFilter string
DateFilter represents a valid filter to use for filtering events by their date during a list.
const ( DateFilterGT DateFilter = "gt" DateFilterGTE DateFilter = "gte" DateFilterLT DateFilter = "lt" DateFilterLTE DateFilter = "lte" )
type DateQuery ¶
type DateQuery struct { Date time.Time Filter DateFilter }
DateQuery represents a date field to be used for listing events. If no filter is specified, the query will act as if "equal" is used.
type Event ¶
Event represents a Hermes Event.
func ExtractEvents ¶
func ExtractEvents(r pagination.Page) ([]Event, error)
ExtractEvents accepts a Page struct, specifically an EventPage struct, and extracts the elements into a slice of Event structs. In other words, a generic collection is mapped into a relevant slice.
type EventPage ¶
type EventPage struct {
pagination.LinkedPageBase
}
EventPage is a single page of events results.
func (EventPage) NextPageURL ¶
NextPageURL extracts the "next" link from the links section of the result.
type GetOpts ¶
type GetOpts struct { // The project ID to retrieve event for. ProjectID string `q:"project_id"` // The domain ID to retrieve event for. DomainID string `q:"domain_id"` }
GetOpts enables retrieving events by a specific project or domain.
func (GetOpts) ToEventsQuery ¶
ToEventsQuery formats a GetOpts into a query string.
type GetOptsBuilder ¶
GetOptsBuilder allows extensions to add additional parameters to the Get request.
type GetResult ¶
type GetResult struct {
gophercloud.Result
}
func Get ¶
func Get(c *gophercloud.ServiceClient, id string, opts GetOptsBuilder) (r GetResult)
Get retrieves a specific event based on its unique ID.
func (GetResult) Extract ¶
Extract is a function that accepts a result and extracts an event resource.
func (GetResult) ExtractInto ¶
type ListOpts ¶
type ListOpts struct { ObserverType string `q:"observer_type"` TargetID string `q:"target_id"` TargetType string `q:"target_type"` InitiatorID string `q:"initiator_id"` // Not available for sort InitiatorType string `q:"initiator_type"` InitiatorName string `q:"initiator_name"` Action string `q:"action"` Outcome string `q:"outcome"` RequestPath string `q:"request_path"` Time []DateQuery DomainID string `q:"domain_id"` ProjectID string `q:"project_id"` // Search is over the entire event body. Search string `q:"search"` // Sort will sort the results in the requested order. Sort string `q:"sort"` Limit int `q:"limit"` Offset int `q:"offset"` }
ListOpts allows the filtering of paginated collections through the API. Filtering is achieved by passing in filter value. Page and PerPage are used for pagination.
func (ListOpts) ToEventListQuery ¶
ToEventListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.