lifecyclehooks

package
v1.0.20 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallBackURL

func CallBackURL(c *gophercloud.ServiceClient, scalingGroupId string) string

func CreateURL

func CreateURL(c *gophercloud.ServiceClient, scalingGroupId string) string

func DeleteURL

func DeleteURL(c *gophercloud.ServiceClient, scalingGroupId string, lifecycleHookName string) string

func GetURL

func GetURL(c *gophercloud.ServiceClient, scalingGroupId string, lifecycleHookName string) string

func ListURL

func ListURL(c *gophercloud.ServiceClient, scalingGroupId string) string

func ListWithSuspensionURL

func ListWithSuspensionURL(c *gophercloud.ServiceClient, scalingGroupId string) string

func UpdateURL

func UpdateURL(c *gophercloud.ServiceClient, scalingGroupId string, lifecycleHookName string) string

Types

type CallBackOpts

type CallBackOpts struct {

	// Specifies the lifecycle action key.When specifying a lifecycle
	// callback object, this field is mandatory if the instance_id field is not used. If
	// both this field and the instance_id field are used, preferentially use this field for
	// callback.
	LifecycleActionKey string `json:"lifecycle_action_key,omitempty"`

	// Specifies the instance ID.When specifying a lifecycle callback
	// object, this field is mandatory if the lifecycle_action_key field is not used.
	InstanceId string `json:"instance_id,omitempty"`

	// Specifies the lifecycle hook name.When specifying a lifecycle
	// callback object, this field is mandatory if the lifecycle_action_key field is not
	// used.
	LifecycleHookName string `json:"lifecycle_hook_name,omitempty"`

	// Specifies the lifecycle callback action.ABANDON: terminates the
	// instance.CONTINUE: continues the instance.EXTEND: extends the timeout duration, one
	// hour each time.
	LifecycleActionResult string `json:"lifecycle_action_result" required:"true"`
}

func (CallBackOpts) ToLifecyclehooksCallBackMap

func (opts CallBackOpts) ToLifecyclehooksCallBackMap() (map[string]interface{}, error)

type CallBackOptsBuilder

type CallBackOptsBuilder interface {
	ToLifecyclehooksCallBackMap() (map[string]interface{}, error)
}

type CallBackResult

type CallBackResult struct {
	gophercloud.ErrResult
}

func CallBack

func CallBack(client *gophercloud.ServiceClient, scalingGroupId string, opts CallBackOptsBuilder) (r CallBackResult)

type CreateOpts

type CreateOpts struct {

	// Specifies the lifecycle hook name. The name can contain
	// letters, digits, underscores (_), and hyphens (-), and must be between 1 and 32
	// characters in length.
	LifecycleHookName string `json:"lifecycle_hook_name" required:"true"`

	// Specifies the lifecycle hook
	// type.INSTANCE_TERMINATING,INSTANCE_LAUNCHING,The INSTANCE_TERMINATING hook suspends
	// an instance when the instance terminates. The INSTANCE_LAUNCHING hook suspends an
	// instance when the instance starts.
	LifecycleHookType string `json:"lifecycle_hook_type" required:"true"`

	// Specifies the default lifecycle hook callback operation. By
	// default, this operation is performed when the timeout duration
	// expires.ABANDON,CONTINUE,If an instance is starting, CONTINUE indicates that your
	// customized operations are successful and the instance can be used. ABANDON indicates
	// that your customized operations failed, and the instance will be terminated. In such
	// a case, the scaling action fails, and you must create a new instance.If an instance
	// is stopping, both ABANDON and CONTINUE allow instance termination. The difference
	// between the two states is as follows: ABANDON stops other lifecycle hooks, but
	// CONTINUE allows the completion of other lifecycle hooks.The default value of this
	// field is ABANDON.
	DefaultResult string `json:"default_result,omitempty"`

	// Specifies the lifecycle hook timeout duration, which ranges
	// from 300 to 86400 in the unit of second. The default value is 3600.By default, this
	// parameter specifies the instance waiting duration. You can prolong the timeout
	// duration or perform the CONTINUE or ABANDON operation before the timeout duration
	// expires.
	DefaultTimeout *int `json:"default_timeout,omitempty"`

	// Specifies a unique topic in SMN.This parameter specifies a
	// notification object for a lifecycle hook. When an instance is suspended by the
	// lifecycle hook, the SMN service sends a notification to the object. This notification
	// contains the basic instance information, your customized notification content, and
	// the token for controlling lifecycle operations.
	NotificationTopicUrn string `json:"notification_topic_urn" required:"true"`

	// Specifies a customized notification, which contains no more
	// than 256 characters in length. The message cannot contain the following characters: <
	// > & ' ( ).After a notification object is configured, the SMN service sends your
	// customized notification to the object.
	NotificationMetadata string `json:"notification_metadata,omitempty"`
}

func (CreateOpts) ToLifecyclehooksCreateMap

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

type CreateOptsBuilder

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

type CreateResponse

type CreateResponse struct {

	// Specifies the lifecycle hook name.
	LifecycleHookName string `json:"lifecycle_hook_name"`

	// Specifies the lifecycle hook
	// type.INSTANCE_TERMINATING,INSTANCE_LAUNCHING
	LifecycleHookType string `json:"lifecycle_hook_type"`

	// Specifies the default lifecycle hook callback
	// operation.ABANDON,CONTINUE
	DefaultResult string `json:"default_result"`

	// Specifies the lifecycle hook timeout duration in the unit of
	// second.
	DefaultTimeout int `json:"default_timeout"`

	// Specifies a unique topic in SMN.
	NotificationTopicUrn string `json:"notification_topic_urn"`

	// Specifies the topic name in SMN.
	NotificationTopicName string `json:"notification_topic_name"`

	// Specifies the customized notification.
	NotificationMetadata string `json:"notification_metadata"`

	// Specifies the time when the lifecycle hook is created. The time
	// is UTC-compliant.
	CreateTime string `json:"create_time"`
}

type CreateResult

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

func Create

func Create(client *gophercloud.ServiceClient, scalingGroupId string, opts CreateOptsBuilder) (r CreateResult)

func (CreateResult) Extract

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

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

func Delete

func Delete(client *gophercloud.ServiceClient, scalingGroupId string, lifecycleHookName string) (r DeleteResult)

type GetResponse

type GetResponse struct {

	// Specifies the lifecycle hook name.
	LifecycleHookName string `json:"lifecycle_hook_name"`

	// Specifies the lifecycle hook
	// type.INSTANCE_TERMINATING,INSTANCE_LAUNCHING
	LifecycleHookType string `json:"lifecycle_hook_type"`

	// Specifies the default lifecycle hook callback
	// operation.ABANDON,CONTINUE
	DefaultResult string `json:"default_result"`

	// Specifies the lifecycle hook timeout duration in the unit of
	// second.
	DefaultTimeout int `json:"default_timeout"`

	// Specifies a unique topic in SMN.
	NotificationTopicUrn string `json:"notification_topic_urn"`

	// Specifies the topic name in SMN.
	NotificationTopicName string `json:"notification_topic_name"`

	// Specifies the customized notification.
	NotificationMetadata string `json:"notification_metadata"`

	// Specifies the time when the lifecycle hook is created. The time
	// is UTC-compliant.
	CreateTime string `json:"create_time"`
}

type GetResult

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

func Get

func Get(client *gophercloud.ServiceClient, scalingGroupId string, lifecycleHookName string) (r GetResult)

func (GetResult) Extract

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

type InstanceHangingInfo

type InstanceHangingInfo struct {

	// Specifies the lifecycle hook name.
	LifecycleHookName string `json:"lifecycle_hook_name"`

	// Specifies the lifecycle action key, which determines the
	// lifecycle callback object.
	LifecycleActionKey string `json:"lifecycle_action_key"`

	// Specifies the AS instance ID.
	InstanceId string `json:"instance_id"`

	// Specifies the AS group ID.
	ScalingGroupId string `json:"scaling_group_id"`

	// Specifies the lifecycle hook status.HANGING: suspends the
	// instance.CONTINUE: continues the instance.ABANDON: terminates the instance.
	LifecycleHookStatus string `json:"lifecycle_hook_status"`

	// Specifies the timeout duration in the format of
	// "YYYY-MM-DDThh:mm:ssZ". The time is UTC-compliant.
	Timeout string `json:"timeout"`

	// Specifies the default lifecycle hook callback operation.
	DefaultResult string `json:"default_result"`
}

type LifecycleHook

type LifecycleHook struct {

	// Specifies the lifecycle hook name.
	LifecycleHookName string `json:"lifecycle_hook_name"`

	// Specifies the lifecycle hook
	// type.INSTANCE_TERMINATING,INSTANCE_LAUNCHING
	LifecycleHookType string `json:"lifecycle_hook_type"`

	// Specifies the default lifecycle hook callback
	// operation.ABANDON,CONTINUE
	DefaultResult string `json:"default_result"`

	// Specifies the lifecycle hook timeout duration in the unit of
	// second.
	DefaultTimeout int `json:"default_timeout"`

	// Specifies a unique topic in SMN.
	NotificationTopicUrn string `json:"notification_topic_urn"`

	// Specifies the topic name in SMN.
	NotificationTopicName string `json:"notification_topic_name"`

	// Specifies the customized notification.
	NotificationMetadata string `json:"notification_metadata"`

	// Specifies the time when the lifecycle hook is created. The time
	// is UTC-compliant.
	CreateTime string `json:"create_time"`
}

type ListResponse

type ListResponse struct {

	// Specifies lifecycle hooks.
	LifecycleHooks []LifecycleHook `json:"lifecycle_hooks"`
}

type ListResult

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

func List

func List(client *gophercloud.ServiceClient, scalingGroupId string) (r ListResult)

func (ListResult) Extract

func (r ListResult) Extract() (*ListResponse, error)

type ListWithSuspensionOpts

type ListWithSuspensionOpts struct {

	// Specifies the AS instance ID.
	InstanceId string `q:"instance_id"`
}

func (ListWithSuspensionOpts) ToListWithSuspensionQuery

func (opts ListWithSuspensionOpts) ToListWithSuspensionQuery() (string, error)

type ListWithSuspensionOptsBuilder

type ListWithSuspensionOptsBuilder interface {
	ToListWithSuspensionQuery() (string, error)
}

type ListWithSuspensionResponse

type ListWithSuspensionResponse struct {

	// Specifies lifecycle hook information about an AS instance.
	InstanceHangingInfo []InstanceHangingInfo `json:"instance_hanging_info"`
}

type ListWithSuspensionResult

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

func ListWithSuspension

func ListWithSuspension(client *gophercloud.ServiceClient, scalingGroupId string, opts ListWithSuspensionOptsBuilder) (r ListWithSuspensionResult)

func (ListWithSuspensionResult) Extract

type UpdateOpts

type UpdateOpts struct {

	// Specifies the lifecycle hook
	// type.INSTANCE_TERMINATING,INSTANCE_LAUNCHING,The INSTANCE_TERMINATING hook suspends
	// an instance when the instance terminates. The INSTANCE_LAUNCHING hook suspends an
	// instance when the instance starts.
	LifecycleHookType string `json:"lifecycle_hook_type,omitempty"`

	// Specifies the default lifecycle hook callback operation. By
	// default, this operation is performed when the timeout duration
	// expires.ABANDON,CONTINUE,If an instance is starting, CONTINUE indicates that your
	// customized operations are successful and the instance can be used. ABANDON indicates
	// that your customized operations failed, and the instance will be terminated. In such
	// a case, the scaling action fails, and you must create a new instance.If an instance
	// is stopping, both ABANDON and CONTINUE allow instance termination. The difference
	// between the two states is as follows: ABANDON stops other lifecycle hooks, but
	// CONTINUE allows the completion of other lifecycle hooks.The default value of this
	// field is ABANDON.
	DefaultResult string `json:"default_result,omitempty"`

	// Specifies the lifecycle hook timeout duration, which ranges
	// from 300 to 86400 in the unit of second. The default value is 3600.By default, this
	// parameter specifies the instance waiting duration. You can prolong the timeout
	// duration or perform the CONTINUE or ABANDON operation before the timeout duration
	// expires.
	DefaultTimeout *int `json:"default_timeout,omitempty"`

	// Specifies a unique topic in SMN.This parameter specifies a
	// notification object for a lifecycle hook. When an instance is suspended by the
	// lifecycle hook, the SMN service sends a notification to the object. This notification
	// contains the basic instance information, your customized notification content, and
	// the token for controlling lifecycle operations.
	NotificationTopicUrn string `json:"notification_topic_urn,omitempty"`

	// Specifies a customized notification, which contains no more
	// than 256 characters in length. The message cannot contain the following characters: <
	// > & ' ( ).After a notification object is configured, the SMN service sends your
	// customized notification to the object.
	NotificationMetadata string `json:"notification_metadata,omitempty"`
}

func (UpdateOpts) ToLifecyclehooksUpdateMap

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

type UpdateOptsBuilder

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

type UpdateResponse

type UpdateResponse struct {

	// Specifies the lifecycle hook name.
	LifecycleHookName string `json:"lifecycle_hook_name"`

	// Specifies the lifecycle hook
	// type.INSTANCE_TERMINATING,INSTANCE_LAUNCHING
	LifecycleHookType string `json:"lifecycle_hook_type"`

	// Specifies the default lifecycle hook callback
	// operation.ABANDON,CONTINUE
	DefaultResult string `json:"default_result"`

	// Specifies the lifecycle hook timeout duration in the unit of
	// second.
	DefaultTimeout int `json:"default_timeout"`

	// Specifies a unique topic in SMN.
	NotificationTopicUrn string `json:"notification_topic_urn"`

	// Specifies the topic name in SMN.
	NotificationTopicName string `json:"notification_topic_name"`

	// Specifies the customized notification.
	NotificationMetadata string `json:"notification_metadata"`

	// Specifies the time when the lifecycle hook is created. The time
	// is UTC-compliant.
	CreateTime string `json:"create_time"`
}

type UpdateResult

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

func Update

func Update(client *gophercloud.ServiceClient, scalingGroupId string, lifecycleHookName string, opts UpdateOptsBuilder) (r UpdateResult)

func (UpdateResult) Extract

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

Jump to

Keyboard shortcuts

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