instances

package
v0.9.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchAction added in v0.5.25

func BatchAction(client *golangsdk.ServiceClient, groupID string, opts BatchOpts) (err error)

func Delete

func Delete(client *golangsdk.ServiceClient, opts DeleteOpts) error

Types

type BatchOpts

type BatchOpts struct {
	// Specifies the ECS ID.
	Instances []string `json:"instances_id" required:"true"`
	// Specifies whether to delete an instance when it is removed from an AS group.
	// Options:
	// no (default): The instance will not be deleted.
	// yes: The instance will be deleted.
	// This parameter takes effect only when the action is set to REMOVE.
	IsDeleteEcs string `json:"instance_delete,omitempty"`
	// Specifies an action to be performed on instances in batches. The options are as follows:
	// ADD: adds instances to the AS group.
	// REMOVE: removes instances from the AS group.
	// PROTECT: enables instance protection.
	// UNPROTECT: disables instance protection.
	Action string `json:"action,omitempty"`
}

type DeleteOpts

type DeleteOpts struct {
	InstanceId string
	// Specifies whether an instance is deleted when it is removed from the AS group.
	// Options:
	// no (default): The instance will not be deleted.
	// yes: The instance will be deleted.
	DeleteInstance string `q:"instance_delete"`
}

type Instance

type Instance struct {
	// Specifies the instance ID.
	ID string `json:"instance_id"`
	// Specifies the instance name.
	Name string `json:"instance_name"`
	// Specifies the ID of the AS group to which the instance belongs.
	GroupID string `json:"scaling_group_id"`
	// Specifies the name of the AS group to which the instance belongs.
	// Supports fuzzy search.
	GroupName string `json:"scaling_group_name"`
	// Specifies the instance lifecycle status in the AS group.
	// INSERVICE: The instance is enabled.
	// PENDING: The instance is being added to the AS group.
	// REMOVING: The instance is being removed from the AS group.
	LifeCycleStatus string `json:"life_cycle_state"`
	// Specifies the instance health status.
	// INITIALIZING: The instance is being initialized.
	// NORMAL: The instance is functional.
	// ERROR: The instance is faulty.
	HealthStatus string `json:"health_status"`
	// Specifies the AS configuration name.
	ConfigurationName string `json:"scaling_configuration_name"`
	// Specifies the AS configuration ID.
	// If the returned value is not empty, the instance is an ECS automatically created in a scaling action.
	// If the returned value is empty, the instance is an ECS manually added to the AS group.
	ConfigurationID string `json:"scaling_configuration_id"`
	// Specifies the time when the instance is added to the AS group. The time format complies with UTC.
	CreateTime string `json:"create_time"`
	// Specifies the instance protection status.
	ProtectFromScalingDown bool `json:"protect_from_scaling_down"`
}

type ListOpts

type ListOpts struct {
	// Specifies the AS group ID.
	ScalingGroupId string
	// Specifies the instance lifecycle status in the AS group.
	// INSERVICE: The instance is enabled.
	// PENDING: The instance is being added to the AS group.
	// REMOVING: The instance is being removed from the AS group.
	LifeCycleState string `q:"life_cycle_state,omitempty"`
	// Specifies the instance health status.
	// INITIALIZING: The instance is initializing.
	// NORMAL: The instance is normal.
	// ERROR: The instance is abnormal.
	HealthStatus string `q:"health_status,omitempty"`
	// Specifies the instance protection status.
	// true: Instance protection is enabled.
	// false: Instance protection is disabled.
	ProtectFromScalingDown string `q:"protect_from_scaling_down,omitempty"`
	// Specifies the start line number. The default value is 0. The minimum parameter value is 0.
	StartNumber int32 `q:"start_number,omitempty"`
	// Specifies the number of query records. The default value is 20. The value range is 0 to 100.
	Limit int32 `q:"limit,omitempty"`
}

type ListScalingInstancesResponse added in v0.5.25

type ListScalingInstancesResponse struct {
	TotalNumber           int32      `json:"total_number,omitempty"`
	StartNumber           int32      `json:"start_number,omitempty"`
	Limit                 int32      `json:"limit,omitempty"`
	ScalingGroupInstances []Instance `json:"scaling_group_instances,omitempty"`
}

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) (*ListScalingInstancesResponse, error)

Jump to

Keyboard shortcuts

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