actions

package
v0.0.0-...-cd80d89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

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

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

func (r *Action) UnmarshalJSON(b []byte) error

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.

func (GetResult) Extract

func (r GetResult) Extract() (*Action, error)

Extract interprets any commonResult-based result as an 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

func (opts ListOpts) ToActionListQuery() (string, error)

ToClusterListQuery builds a query string from ListOpts.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToActionListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

Directories

Path Synopsis
clustering_actions_v1
clustering_actions_v1

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL