jdcloud

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: MPL-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_SECURITY_GROUP_COUNT = 5
	MAX_RECONNECT_COUNT      = 3

	MAX_NI_RECONNECT  = 6
	MAX_EIP_RECONNECT = 10

	REQUEST_COMPLETED  = 0
	RESOURCE_EXISTS    = 0
	RESOURCE_EMPTY     = 0
	RESOURCE_NOT_FOUND = 404
	REQUEST_INVALID    = 400
	REQUEST_INVALID_2  = 403

	MAX_DISK_COUNT          = 1
	DISK_AVAILABLE          = "available"
	DISK_DELETED            = "deleted"
	DISK_DELETING           = "deleting"
	DISK_CREATING           = "creating"
	DISK_ATTACHING          = "attaching"
	DISK_DETACHING          = "detaching"
	DISK_INUSE              = "in-use"
	DISK_TIMEOUT            = 60
	DISK_ATTACHMENT_TIMEOUT = 60
	DISK_ATTACHED           = "attached"
	DISK_DETACHED           = "detached"

	DISK_CONCURRENT_ATTACHMENT_ERROR   = "Conflict with underlay task"
	REQUEST_SERVER_ERROR               = 500
	DISK_CONCURRENT_ATTACHMENT_ERROR_2 = "Unknown server error"
	DISK_ALREADY_ATTACHED              = "already attached"

	MAX_EIP_COUNT     = 1
	MAX_SYSDISK_COUNT = 1
	DISKTYPE_CLOUD    = "cloud"
	MAX_VM_COUNT      = 1
	VM_TIMEOUT        = 600
	VM_PENDING        = "pending"
	VM_STARTING       = "starting"
	VM_RUNNING        = "running"
	VM_STOPPING       = "stopping"
	VM_STOPPED        = "stopped"
	VM_STOPPED_2      = ""
	VM_REBOOTING      = "rebooting"
	VM_REBUILDING     = "rebuilding"
	VM_RESIZING       = "resizing"
	VM_DELETING       = "deleting"
	VM_TERMINATED     = "terminated"
	VM_ERROR          = "error"
	VM_DELETED        = ""

	KEYPAIRS_PERM = 0600
	KEYPAIRS_PRIV = 0400

	RDS_TIMEOUT       = 300
	RDS_READY         = "RUNNING"
	RDS_CREATING      = "BUILDING"
	RDS_UNCERTAIN     = ""
	RDS_DELETING      = "DELETING"
	RDS_DELETED       = "DELETED"
	RDS_UPDATING      = "MIGRATING"
	RDS_MAX_RECONNECT = 6
	CONNECT_FAILED    = "Client.Timeout exceeded"

	DEFAULT_DEVICE_INDEX                  = 1
	DEFAULT_NETWORK_INTERFACE_AUTO_DELETE = true
	DEFAULT_SANITY_CHECK                  = 1
	MIN_DISK_SIZE                         = 20
	MAX_DISK_SIZE                         = 3000
)

Variables

This section is empty.

Functions

func DeleteVmInstance

func DeleteVmInstance(d *schema.ResourceData, m interface{}, id string) error

func GetIntAddr

func GetIntAddr(d *schema.ResourceData, key string) *int

func GetStringAddr

func GetStringAddr(d *schema.ResourceData, key string) *string

func Provider

func Provider() *schema.Provider

func QueryInstanceDetail

func QueryInstanceDetail(d *schema.ResourceData, m interface{}, instanceId string) (r *apis.DescribeInstanceResponse, e error)

func RetryWithParamsSpecified

func RetryWithParamsSpecified(frequency, timeout time.Duration, f resource.RetryFunc) error

Nothing special, we modified the refresh frequency here This function is used rather than resource.Retry since under some bad network condition 500 ms is too short for a request to return

func StartVmInstance

func StartVmInstance(d *schema.ResourceData, m interface{}) error

func StopVmInstance

func StopVmInstance(d *schema.ResourceData, m interface{}, instanceId string) error

Types

type JDCloudConfig

type JDCloudConfig struct {
	AccessKey  string
	SecretKey  string
	Region     string
	Credential *core.Credential
}

Jump to

Keyboard shortcuts

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