lifecyclehooks

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	// The lifecycle hook name.
	// The name contains only letters, digits, underscores (_), and hyphens (-), and cannot exceed 32 characters.
	Name string `json:"lifecycle_hook_name" required:"true"`
	// The lifecycle hook type.
	// INSTANCE_TERMINATING: The hook suspends the instance when the instance is terminated.
	// INSTANCE_LAUNCHING: The hook suspends the instance when the instance is started.
	Type string `json:"lifecycle_hook_type" required:"true"`
	// The default lifecycle hook callback operation: ABANDON and CONTINUE.
	// By default, this operation is performed when the timeout duration expires.
	DefaultResult string `json:"default_result,omitempty"`
	// The lifecycle hook timeout duration, which ranges from 300 to 86400 in the unit of second.
	// The default value is 3600.
	Timeout int `json:"default_timeout,omitempty"`
	// The unique topic in SMN.
	// This parameter specifies a notification object for a lifecycle hook.
	NotificationTopicURN string `json:"notification_topic_urn" required:"true"`
	// The customized notification, which contains no more than 256 characters in length.
	// The message cannot contain the following characters: <>&'().
	NotificationMetadata string `json:"notification_metadata,omitempty"`
}

CreateOpts is a struct which will be used to create a lifecycle hook.

func (CreateOpts) ToLifecycleHookCreateMap

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

type CreateOptsBuilder

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

CreateOptsBuilder is an interface by which can serialize the create parameters.

type CreateResult

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

func Create

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

Create is a method which can be able to access to create the hook of autoscaling service.

func (CreateResult) Extract

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

Extract will deserialize the result to Hook object.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

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

Delete is a method which can be able to access to delete the existing hook of the autoscaling service.

type GetResult

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

func Get

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

Get is a method to obtains the hook detail of autoscaling service.

func (GetResult) Extract

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

Extract will deserialize the result to Hook object.

type Hook

type Hook struct {
	// The lifecycle hook name.
	Name string `json:"lifecycle_hook_name"`
	// The lifecycle hook type: INSTANCE_TERMINATING and INSTANCE_LAUNCHING.
	Type string `json:"lifecycle_hook_type"`
	// The default lifecycle hook callback operation: ABANDON and CONTINUE.
	DefaultResult string `json:"default_result"`
	// The lifecycle hook timeout duration in the unit of second.
	Timeout int `json:"default_timeout"`
	// The unique topic in SMN.
	NotificationTopicURN string `json:"notification_topic_urn"`
	// The topic name in SMN.
	NotificationTopicName string `json:"notification_topic_name"`
	// The notification message.
	NotificationMetadata string `json:"notification_metadata"`
	// The UTC-compliant time when the lifecycle hook is created.
	CreateTime string `json:"create_time"`
}

Hook is a struct that represents the result of API calling.

type ListResult

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

func List

func List(client *golangsdk.ServiceClient, groupID string) (r ListResult)

List is a method to obtains a hook array of the autoscaling service.

func (ListResult) Extract

func (r ListResult) Extract() (*[]Hook, error)

Extract will deserialize the result to Hook array.

type UpdateOpts

type UpdateOpts struct {
	// The lifecycle hook type
	Type string `json:"lifecycle_hook_type,omitempty"`
	// The default lifecycle hook callback operation: ABANDON and CONTINUE.
	// By default, this operation is performed when the timeout duration expires.
	DefaultResult string `json:"default_result,omitempty"`
	// The lifecycle hook timeout duration, which ranges from 300 to 86400 in the unit of second.
	// The default value is 3600.
	Timeout int `json:"default_timeout,omitempty"`
	// The unique topic in SMN.
	// This parameter specifies a notification object for a lifecycle hook.
	NotificationTopicURN string `json:"notification_topic_urn,omitempty"`
	// The customized notification, which contains no more than 256 characters in length.
	// The message cannot contain the following characters: <>&'().
	NotificationMetadata string `json:"notification_metadata,omitempty"`
}

UpdateOpts is a struct which will be used to update the existing hook.

func (UpdateOpts) ToLifecycleHookUpdateMap

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

type UpdateOptsBuilder

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

CreateOptsBuilder is an interface by which can serialize the create parameters

type UpdateResult

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

func Update

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

Update is a method which can be able to access to udpate the existing hook of the autoscaling service.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Hook, error)

Extract will deserialize the result to Hook object.

Jump to

Keyboard shortcuts

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