instances

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *golangsdk.ServiceClient, groupID string, opts ListOptsBuilder) pagination.Pager

List is a method by which can be able to access the list function that can get instances of a group

Types

type BatchOpts

type BatchOpts struct {
	Instances   []string `json:"instances_id" required:"true"`
	IsDeleteEcs string   `json:"instance_delete,omitempty"`
	Action      string   `json:"action,omitempty"`
}

BatchOpts is a struct which represents parameters of batch operations

func (BatchOpts) ToInstanceBatchMap

func (opts BatchOpts) ToInstanceBatchMap() (map[string]interface{}, error)

type BatchOptsBuilder

type BatchOptsBuilder interface {
	ToInstanceBatchMap() (map[string]interface{}, error)
}

BatchOptsBuilder is an interface which can build the query body of batch operation

type BatchResult

type BatchResult struct {
	golangsdk.ErrResult
}

BatchResult is a struct which contains the result of batch operations

func BatchAdd

func BatchAdd(client *golangsdk.ServiceClient, groupID string, instances []string) (r BatchResult)

BatchAdd is a method by which can add numbers of instances into a group

func BatchDelete

func BatchDelete(client *golangsdk.ServiceClient, groupID string, instances []string, deleteEcs string) (r BatchResult)

BatchDelete is a method by which can delete numbers of instances from a group

type DeleteOpts

type DeleteOpts struct {
	DeleteInstance bool `q:"instance_delete"`
}

func (DeleteOpts) ToInstanceDeleteQuery

func (opts DeleteOpts) ToInstanceDeleteQuery() (string, error)

type DeleteOptsBuilder

type DeleteOptsBuilder interface {
	ToInstanceDeleteQuery() (string, error)
}

DeleteOptsBuilder is an interface by whick can be able to build the query string of instance deletion

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult is a struct which contains the result of deletion instance

func Delete

func Delete(client *golangsdk.ServiceClient, id string, opts DeleteOptsBuilder) (r DeleteResult)

Delete is a method by which can be able to delete an instance from a group

type Instance

type Instance struct {
	ID                string `json:"instance_id"`
	Name              string `json:"instance_name"`
	GroupID           string `json:"scaling_group_id"`
	GroupName         string `json:"scaling_group_name"`
	LifeCycleStatus   string `json:"life_cycle_state"`
	HealthStatus      string `json:"health_status"`
	ConfigurationName string `json:"scaling_configuration_name"`
	ConfigurationID   string `json:"scaling_configuration_id"`
	CreateTime        string `json:"create_time"`
}

Instance is a struct which represents all the infromation of a instance

type InstancePage

type InstancePage struct {
	pagination.SinglePageBase
}

InstancePage is a struct which can do the page function

func (InstancePage) Extract

func (r InstancePage) Extract() ([]Instance, error)

func (InstancePage) IsEmpty

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

IsEmpty returns true if a instances number equal to 0.

type ListOpts

type ListOpts struct {
	LifeCycleStatus string `q:"life_cycle_state"`
	HealthStatus    string `q:"health_status"`
}

func (ListOpts) ToInstancesListQuery

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

type ListOptsBuilder

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

ListOptsBuilder is an interface by which can be able to build the query string of the list function

Jump to

Keyboard shortcuts

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