Documentation
¶
Overview ¶
Package actions provides listing and retrieving of senlin actions for the OpenStack Clustering Service.
Example to List Actions
opts := actions.ListOpts{
Limit: 5,
}
err = actions.List(serviceClient, opts).EachPage(func(page pagination.Page) (bool, error) {
actionInfos, err := actions.ExtractActions(page)
if err != nil {
return false, err
}
for _, actionInfo := range actionInfos {
fmt.Printf("%+v\n", actionInfo)
}
return true, nil
})
Example to Get an Action
actionID := "edce3528-864f-41fb-8759-f4707925cc09"
action, err := actions.Get(serviceClient, actionID).Extract()
if err != nil {
panic(err)
}
fmt.Printf("Action %+v: ", action)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List instructs OpenStack to provide a list of actions.
Types ¶
type Action ¶
type Action struct {
Action string `json:"action"`
Cause string `json:"cause"`
CreatedAt time.Time `json:"-"`
Data map[string]interface{} `json:"data"`
DependedBy []string `json:"depended_by"`
DependsOn []string `json:"depends_on"`
StartTime float64 `json:"start_time"`
EndTime float64 `json:"end_time"`
ID string `json:"id"`
Inputs map[string]interface{} `json:"inputs"`
Interval int `json:"interval"`
Name string `json:"name"`
Outputs map[string]interface{} `json:"outputs"`
Owner string `json:"owner"`
Project string `json:"project"`
Status string `json:"status"`
StatusReason string `json:"status_reason"`
Target string `json:"target"`
Timeout int `json:"timeout"`
UpdatedAt time.Time `json:"-"`
User string `json:"user"`
}
Action represents a detailed Action.
func ExtractActions ¶
func ExtractActions(r pagination.Page) ([]Action, error)
ExtractActions returns a slice of Actions from the List operation.
func (*Action) UnmarshalJSON ¶
type ActionPage ¶
type ActionPage struct {
pagination.LinkedPageBase
}
ActionPage contains a single page of all actions from a List call.
func (ActionPage) IsEmpty ¶
func (r ActionPage) IsEmpty() (bool, error)
IsEmpty determines if a ActionPage contains any results.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult is the response of a Get operations. Call its Extract method to interpret it as an Action.
func Get ¶
func Get(client *gophercloud.ServiceClient, id string) (r GetResult)
Get retrieves details of a single action.
type ListOpts ¶
type ListOpts struct {
Limit int `q:"limit"`
Marker string `q:"marker"`
Sort string `q:"sort"`
GlobalProject *bool `q:"global_project"`
Name string `q:"name"`
Target string `q:"target"`
Action string `q:"action"`
Status string `q:"status"`
}
ListOpts represents options used to list actions.
func (ListOpts) ToActionListQuery ¶
ToClusterListQuery builds a query string from ListOpts.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request.