runs

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractRunsInto

func ExtractRunsInto(r pagination.Page, v interface{}) error

func List

func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

List returns a Pager which allows you to iterate over a collection of runs. It accepts a ListOpts struct.

Types

type CreateOpts

type CreateOpts struct {
	AutomationID string `json:"automation_id" required:"true"`
	Selector     string `json:"selector" required:"true"`
}

CreateOpts represents the attributes used when creating a new run.

func (CreateOpts) ToRunCreateMap

func (opts CreateOpts) ToRunCreateMap() (map[string]interface{}, error)

ToRunCreateMap builds a request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToRunCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Run.

func Create

func Create(ctx context.Context, c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create accepts a CreateOpts struct and creates a new run using the values provided.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Run, error)

Extract is a function that accepts a result and extracts a run resource.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Run.

func Get

func Get(ctx context.Context, c *gophercloud.ServiceClient, id string) (r GetResult)

Get retrieves a specific run based on its unique ID.

func (GetResult) Extract

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

Extract is a function that accepts a result and extracts a run resource.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type ListOpts

type ListOpts struct {
	Page    int `q:"page"`
	PerPage int `q:"per_page"`
}

ListOpts allows the listing of paginated collections through the API. Page and PerPage are used for pagination.

func (ListOpts) ToRunListQuery

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

ToRunListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

type Owner

type Owner struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	DomainID   string `json:"domain_id"`
	DomainName string `json:"domain_name"`
}

Owner represents a Lyra Run Owner.

type Run

type Run struct {
	ID                   string      `json:"id"`
	AutomationID         string      `json:"automation_id"`
	AutomationName       string      `json:"automation_name"`
	Selector             string      `json:"selector"`
	RepositoryRevision   string      `json:"repository_revision"`
	AutomationAttributes interface{} `json:"automation_attributes"`
	// State could be: preparing, executing, failed, completed
	State     string    `json:"state"`
	Log       string    `json:"log"`
	Jobs      []string  `json:"jobs"`
	Owner     Owner     `json:"owner"`
	ProjectID string    `json:"project_id"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
}

Run represents a Lyra Run.

func ExtractRuns

func ExtractRuns(r pagination.Page) ([]Run, error)

ExtractRuns accepts a Page struct, specifically a RunPage struct, and extracts the elements into a slice of Run structs. In other words, a generic collection is mapped into a relevant slice.

func (*Run) UnmarshalJSON

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

type RunPage

type RunPage struct {
	pagination.MarkerPageBase
}

RunPage is the page returned by a pager when traversing over a collection of runs.

func (RunPage) IsEmpty

func (r RunPage) IsEmpty() (bool, error)

IsEmpty checks whether a RunPage struct is empty.

func (RunPage) LastMarker

func (r RunPage) LastMarker() (string, error)

LastMarker returns the next page in a ListResult.

func (RunPage) NextPageURL

func (r RunPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of runs has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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