instances

package
v0.5.23 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchAdd

func BatchAdd(client *golangsdk.ServiceClient, groupID string, instances []string) error

func BatchDelete

func BatchDelete(client *golangsdk.ServiceClient, groupID string, instances []string, deleteEcs string) error

func Delete

func Delete(client *golangsdk.ServiceClient, id string, 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 {
	DeleteInstance bool `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"`
}

func List

func List(client *golangsdk.ServiceClient, groupID string, opts ListOpts) ([]Instance, error)

type ListOpts

type ListOpts struct {
	LifeCycleStatus string `q:"life_cycle_state"`
	HealthStatus    string `q:"health_status"`
}

type ListOptsBuilder

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

Jump to

Keyboard shortcuts

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