groups

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(client *golangsdk.ServiceClient, ops ListOptsBuilder) pagination.Pager

Types

type ActionOpts

type ActionOpts struct {
	Action string `json:"action" required:"true"`
}

func (ActionOpts) ToActionMap

func (opts ActionOpts) ToActionMap() (map[string]interface{}, error)

type ActionOptsBuilder

type ActionOptsBuilder interface {
	ToActionMap() (map[string]interface{}, error)
}

type ActionResult

type ActionResult struct {
	golangsdk.ErrResult
}

this is the action result which is the result of enable or disable operations

func Disable

func Disable(client *golangsdk.ServiceClient, id string) (r ActionResult)

Disable is an operation by which can be able to pause the group

func Enable

func Enable(client *golangsdk.ServiceClient, id string) (r ActionResult)

Enable is an operation by which can make the group enable service

type CreateOpts

type CreateOpts struct {
	Name                      string              `json:"scaling_group_name" required:"true"`
	ConfigurationID           string              `json:"scaling_configuration_id,omitempty"`
	DesireInstanceNumber      int                 `json:"desire_instance_number,omitempty"`
	MinInstanceNumber         int                 `json:"min_instance_number,omitempty"`
	MaxInstanceNumber         int                 `json:"max_instance_number,omitempty"`
	CoolDownTime              int                 `json:"cool_down_time,omitempty"`
	LBListenerID              string              `json:"lb_listener_id,omitempty"`
	LBaaSListeners            []LBaaSListenerOpts `json:"lbaas_listeners,omitempty"`
	AvailableZones            []string            `json:"available_zones,omitempty"`
	Networks                  []NetworkOpts       `json:"networks" required:"ture"`
	SecurityGroup             []SecurityGroupOpts `json:"security_groups" required:"ture"`
	VpcID                     string              `json:"vpc_id" required:"ture"`
	HealthPeriodicAuditMethod string              `json:"health_periodic_audit_method,omitempty"`
	HealthPeriodicAuditTime   int                 `json:"health_periodic_audit_time,omitempty"`
	HealthPeriodicAuditGrace  int                 `json:"health_periodic_audit_grace_period,omitempty"`
	InstanceTerminatePolicy   string              `json:"instance_terminate_policy,omitempty"`
	Notifications             []string            `json:"notifications,omitempty"`
	IsDeletePublicip          bool                `json:"delete_publicip,omitempty"`
}

CreateGroupOps is a struct contains the parameters of creating group

func (CreateOpts) ToGroupCreateMap

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

type CreateOptsBuilder

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

CreateGroupBuilder is an interface from which can build the request of creating group

type CreateResult

type CreateResult struct {
	golangsdk.Result
}

CreateGroupResult is a struct retured by CreateGroup request

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

CreateGroup is a method of creating group

func (CreateResult) Extract

func (r CreateResult) Extract() (string, error)

Extract the create group result as a string type.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteGroupResult contains the body of the deleting group request

func Delete

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

DeleteGroup is a method of deleting a group by group id

type GetResult

type GetResult struct {
	golangsdk.Result
}

GetGroupResult contains the body of getting detailed group request

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

GetGroup is a method of getting the detailed information of the group by id

func (GetResult) Extract

func (r GetResult) Extract() (Group, error)

Extract method will parse the result body into Group struct

type Group

type Group struct {
	Name                      string          `json:"scaling_group_name"`
	ID                        string          `json:"scaling_group_id"`
	Status                    string          `json:"scaling_group_status"`
	ConfigurationID           string          `json:"scaling_configuration_id"`
	ConfigurationName         string          `json:"scaling_configuration_name"`
	ActualInstanceNumber      int             `json:"current_instance_number"`
	DesireInstanceNumber      int             `json:"desire_instance_number"`
	MinInstanceNumber         int             `json:"min_instance_number"`
	MaxInstanceNumber         int             `json:"max_instance_number"`
	CoolDownTime              int             `json:"cool_down_time"`
	LBListenerID              string          `json:"lb_listener_id"`
	LBaaSListeners            []LBaaSListener `json:"lbaas_listeners"`
	AvailableZones            []string        `json:"available_zones"`
	Networks                  []Network       `json:"networks"`
	SecurityGroups            []SecurityGroup `json:"security_groups"`
	CreateTime                string          `json:"create_time"`
	VpcID                     string          `json:"vpc_id"`
	Detail                    string          `json:"detail"`
	IsScaling                 bool            `json:"is_scaling"`
	HealthPeriodicAuditMethod string          `json:"health_periodic_audit_method"`
	HealthPeriodicAuditTime   int             `json:"health_periodic_audit_time"`
	HealthPeriodicAuditGrace  int             `json:"health_periodic_audit_grace_period"`
	InstanceTerminatePolicy   string          `json:"instance_terminate_policy"`
	Notifications             []string        `json:"notifications"`
	DeletePublicip            bool            `json:"delete_publicip"`
	CloudLocationID           string          `json:"cloud_location_id"`
}

Group represents the struct of one autoscaling group

type GroupPage

type GroupPage struct {
	pagination.SinglePageBase
}

func (GroupPage) Extract

func (r GroupPage) Extract() ([]Group, error)

func (GroupPage) IsEmpty

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

IsEmpty returns true if a ListResult contains no Volumes.

type LBaaSListener

type LBaaSListener struct {
	ListenerID   string `json:"listener_id"`
	PoolID       string `json:"pool_id"`
	ProtocolPort int    `json:"protocol_port"`
	Weight       int    `json:"weight"`
}

type LBaaSListenerOpts

type LBaaSListenerOpts struct {
	PoolID       string `json:"pool_id" required:"true"`
	ProtocolPort int    `json:"protocol_port" required:"true"`
	Weight       int    `json:"weight,omitempty"`
}

type ListOpts

type ListOpts struct {
	Name            string `q:"scaling_group_name"`
	ConfigurationID string `q:"scaling_configuration_id"`
	Status          string `q:"scaling_group_status"`
}

func (ListOpts) ToGroupListQuery

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

ToGroupListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

type Network

type Network struct {
	ID string `json:"id"`
}

type NetworkOpts

type NetworkOpts struct {
	ID string `json:"id,omitempty"`
}

type SecurityGroup

type SecurityGroup struct {
	ID string `json:"id"`
}

type SecurityGroupOpts

type SecurityGroupOpts struct {
	ID string `json:"id,omitempty"`
}

type UpdateOpts

type UpdateOpts struct {
	Name                      string              `json:"scaling_group_name,omitempty"`
	DesireInstanceNumber      int                 `json:"desire_instance_number"`
	MinInstanceNumber         int                 `json:"min_instance_number"`
	MaxInstanceNumber         int                 `json:"max_instance_number"`
	CoolDownTime              int                 `json:"cool_down_time,omitempty"`
	LBListenerID              string              `json:"lb_listener_id,omitempty"`
	LBaaSListeners            []LBaaSListenerOpts `json:"lbaas_listeners,omitempty"`
	AvailableZones            []string            `json:"available_zones,omitempty"`
	Networks                  []NetworkOpts       `json:"networks,omitempty"`
	SecurityGroup             []SecurityGroupOpts `json:"security_groups,omitempty"`
	HealthPeriodicAuditMethod string              `json:"health_periodic_audit_method,omitempty"`
	HealthPeriodicAuditTime   int                 `json:"health_periodic_audit_time,omitempty"`
	HealthPeriodicAuditGrace  int                 `json:"health_periodic_audit_grace_period,omitempty"`
	InstanceTerminatePolicy   string              `json:"instance_terminate_policy,omitempty"`
	Notifications             []string            `json:"notifications,omitempty"`
	IsDeletePublicip          bool                `json:"delete_publicip,omitempty"`
	ConfigurationID           string              `json:"scaling_configuration_id,omitempty"`
}

UpdateOpts is a struct which represents the parameters of update function

func (UpdateOpts) ToGroupUpdateMap

func (opts UpdateOpts) ToGroupUpdateMap() (map[string]interface{}, error)

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToGroupUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder is an interface which can build the map paramter of update function

type UpdateResult

type UpdateResult struct {
	golangsdk.Result
}

UpdateResult is a struct from which can get the result of udpate method

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

Update is a method which can be able to update the group via accessing to the autoscaling service with Put method and parameters

func (UpdateResult) Extract

func (r UpdateResult) Extract() (string, error)

Extract will deserialize the result to group id with string

Jump to

Keyboard shortcuts

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