groups

package
v0.5.19 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 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, 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
}

ActionResult 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:"true"`
	SecurityGroup             []SecurityGroupOpts `json:"security_groups,omitempty"`
	VpcID                     string              `json:"vpc_id" required:"true"`
	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"`
	IsDeleteVolume            *bool               `json:"delete_volume,omitempty"`
	EnterpriseProjectID       string              `json:"enterprise_project_id,omitempty"`
	MultiAZPriorityPolicy     string              `json:"multi_az_priority_policy,omitempty"`
}

CreateOpts 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)
}

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

type CreateResult

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

CreateResult is a struct returned by Create request

func Create

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

Create is a method of creating group

func (CreateResult) Extract

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

Extract the ID of AS Group result as a string type.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult contains the body of the deleting group request

func Delete

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

Delete is a method of deleting a group by group id

type GetResult

type GetResult struct {
	golangsdk.Result
}

GetResult contains the body of getting detailed group request

func Get

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

Get 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"`
	DeleteVolume              bool            `json:"delete_volume"`
	CloudLocationID           string          `json:"cloud_location_id"`
	EnterpriseProjectID       string          `json:"enterprise_project_id"`
	ActivityType              string          `json:"activity_type"`
	MultiAZPriorityPolicy     string          `json:"multi_az_priority_policy"`
}

Group represents the struct of one autoscaling group

func ExtractGroups added in v0.3.1

func ExtractGroups(r pagination.Page) ([]Group, error)

ExtractGroups returns a slice of AS Groups contained in a single page of results.

type GroupPage

type GroupPage struct {
	pagination.SinglePageBase
}

func (GroupPage) IsEmpty

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

IsEmpty returns true if a ListResult contains no Volumes.

type IPv6Bandwidth added in v0.3.1

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

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" required:"true"`
}

type ListOpts

type ListOpts struct {
	Name                string `q:"scaling_group_name"`
	ConfigurationID     string `q:"scaling_configuration_id"`
	Status              string `q:"scaling_group_status"`
	StartNumber         int    `q:"start_number"`
	Limit               int    `q:"limit"`
	EnterpriseProjectID string `q:"enterprise_project_id"`
}

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"`
	IPv6Enable    bool          `json:"ipv6_enable"`
	IPv6Bandwidth IPv6Bandwidth `json:"ipv6_bandwidth"`
}

type NetworkOpts

type NetworkOpts struct {
	ID string `json:"id" required:"true"`
}

type SecurityGroup

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

type SecurityGroupOpts

type SecurityGroupOpts struct {
	ID string `json:"id" required:"true"`
}

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"`
	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"`
	IsDeleteVolume            *bool               `json:"delete_volume,omitempty"`
	ConfigurationID           string              `json:"scaling_configuration_id,omitempty"`
	EnterpriseProjectID       string              `json:"enterprise_project_id,omitempty"`
	MultiAZPriorityPolicy     string              `json:"multi_az_priority_policy,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 parameter of update function

type UpdateResult

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

UpdateResult is a struct from which can get the result of Update request

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 the ID of AS Group result as a string type.

Jump to

Keyboard shortcuts

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