instances

package
v0.0.0-...-e794f14 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"},
}

Functions

func Delete

func Delete(c *golangsdk.ServiceClient, id string) error

func ModifyConfiguration

func ModifyConfiguration(c *golangsdk.ServiceClient, instanceId string, opts ModifyRedisConfigOpts) (*golangsdk.Result, error)

func UpdateSsl

func UpdateSsl(client *golangsdk.ServiceClient, id string, opts SslOpts) (*golangsdk.Result, error)

Types

type BackupPlan

type BackupPlan struct {
	TimezoneOffset string `json:"timezone_offset,omitempty"`
	BackupAt       []int  `json:"backup_at" required:"true"`
	PeriodType     string `json:"period_type" required:"true"`
	BeginAt        string `json:"begin_at" required:"true"`
}

type BandWidthInfo

type BandWidthInfo struct {
	BandWidth          int  `json:"bandwidth"`
	BeginTime          int  `json:"begin_time"`
	CurrentTime        int  `json:"current_time"`
	EndTime            int  `json:"end_time"`
	ExpandCount        int  `json:"expand_count"`
	ExpandEffectTime   int  `json:"expand_effect_time"`
	ExpandIntervalTime int  `json:"expand_interval_time"`
	MaxExpandCount     int  `json:"max_expand_count"`
	NextExpandTime     int  `json:"next_expand_time"`
	TaskRunning        bool `json:"task_running"`
}

type Configuration

type Configuration struct {
	ConfigTime   string        `json:"config_time"`
	InstanceId   int           `json:"instance_id"`
	RedisConfig  []RedisConfig `json:"redis_config"`
	ConfigStatus string        `json:"config_status"`
	Status       string        `json:"status"`
}

func GetConfigurations

func GetConfigurations(c *golangsdk.ServiceClient, instanceID string) (*Configuration, error)

type CreateOpts

type CreateOpts struct {
	Name                  string   `json:"name" required:"true"`
	Engine                string   `json:"engine" required:"true"`
	EngineVersion         string   `json:"engine_version,omitempty"`
	Capacity              float64  `json:"capacity" required:"true"`
	SpecCode              string   `json:"spec_code" required:"true"`
	AzCodes               []string `json:"az_codes" required:"true"`
	VpcId                 string   `json:"vpc_id" required:"true"`
	SubnetId              string   `json:"subnet_id" required:"true"`
	SecurityGroupId       string   `json:"security_group_id,omitempty"`
	PublicIpId            string   `json:"publicip_id,omitempty"`
	EnterpriseProjectId   string   `json:"enterprise_project_id,omitempty"`
	EnterpriseProjectName string   `json:"enterprise_project_name,omitempty"`
	Description           string   `json:"description,omitempty"`
	EnableSsl             *bool    `json:"enable_ssl,omitempty"`
	PrivateIp             string   `json:"private_ip,omitempty"`
	// instance number, the value range is 1-100.
	InstanceNum      int                       `json:"instance_num,omitempty"`
	MaintainBegin    string                    `json:"maintain_begin,omitempty"`
	MaintainEnd      string                    `json:"maintain_end,omitempty"`
	Password         string                    `json:"password,omitempty"`
	NoPasswordAccess *bool                     `json:"no_password_access,omitempty"`
	BssParam         DcsBssParam               `json:"bss_param,omitempty"`
	BackupPolicy     *InstanceBackupPolicyOpts `json:"instance_backup_policy,omitempty"`
	Tags             []tags.ResourceTag        `json:"tags,omitempty"`
	AccessUser       string                    `json:"access_user,omitempty"`
	EnablePublicIp   *bool                     `json:"enable_publicip,omitempty"`
	Port             int                       `json:"port,omitempty"`
	RenameCommands   RedisCommand              `json:"rename_commands,omitempty"`
	TemplateId       string                    `json:"template_id,omitempty"`
}

type CreateResponse

type CreateResponse struct {
	OrderId   string           `json:"order_id"`
	Instances []SimpleInstance `json:"instances"`
}

type DcsBackupPolicy

type DcsBackupPolicy struct {
	BackupType           string     `json:"backup_type"`
	SaveDays             int        `json:"save_days"`
	PeriodicalBackupPlan BackupPlan `json:"periodical_backup_plan"`
}

type DcsBssParam

type DcsBssParam struct {
	ChargingMode string `json:"charging_mode" required:"true"`
	PeriodType   string `json:"period_type,omitempty"`
	// period number, the value range is 1-9.
	PeriodNum   int    `json:"period_num,omitempty"`
	IsAutoRenew string `json:"is_auto_renew,omitempty"`
	IsAutoPay   string `json:"is_auto_pay,omitempty"`
}

type DcsBssParamOpts

type DcsBssParamOpts struct {
	IsAutoPay string `json:"is_auto_pay,omitempty"`
}

type DcsInstance

type DcsInstance struct {
	VpcName                   string               `json:"vpc_name"`
	ChargingMode              int                  `json:"charging_mode"`
	VpcId                     string               `json:"vpc_id"`
	UserName                  string               `json:"user_name"`
	CreatedAt                 string               `json:"created_at"`
	LaunchedAt                string               `json:"launched_at"`
	Description               string               `json:"description"`
	SecurityGroupId           string               `json:"security_group_id"`
	SecurityGroupName         string               `json:"security_group_name"`
	MaxMemory                 int                  `json:"max_memory"`
	UsedMemory                int                  `json:"used_memory"`
	Capacity                  float64              `json:"capacity"`
	CapacityMinor             string               `json:"capacity_minor"`
	MaintainBegin             string               `json:"maintain_begin"`
	MaintainEnd               string               `json:"maintain_end"`
	Engine                    string               `json:"engine"`
	NoPasswordAccess          string               `json:"no_password_access"`
	Ip                        string               `json:"ip"`
	BackupPolicy              InstanceBackupPolicy `json:"instance_backup_policy"`
	AzCodes                   []string             `json:"az_codes"`
	AccessUser                string               `json:"access_user"`
	InstanceId                string               `json:"instance_id"`
	Port                      int                  `json:"port"`
	UserId                    string               `json:"user_id"`
	Name                      string               `json:"name"`
	SpecCode                  string               `json:"spec_code"`
	SubnetId                  string               `json:"subnet_id"`
	SubnetName                string               `json:"subnet_name"`
	SubnetCidr                string               `json:"subnet_cidr"`
	EngineVersion             string               `json:"engine_version"`
	OrderId                   string               `json:"order_id"`
	Status                    string               `json:"status"`
	DomainName                string               `json:"domain_name"`
	EnablePublicIp            bool                 `json:"enable_publicip"`
	PublicIpId                string               `json:"publicip_id"`
	PublicIpAddress           string               `json:"publicip_address"`
	EnableSsl                 bool                 `json:"enable_ssl"`
	ServiceUpgrade            bool                 `json:"service_upgrade"`
	ServiceTaskId             string               `json:"service_task_id"`
	EnterpriseProjectId       string               `json:"enterprise_project_id"`
	BackendAddress            string               `json:"backend_addrs"`
	BandWidthDetail           BandWidthInfo        `json:"bandwidth_info"`
	CacheMode                 string               `json:"cache_mode"`
	CpuType                   string               `json:"cpu_type"`
	ReplicaCount              int                  `json:"replica_count"`
	ReadOnlyDomainName        string               `json:"readonly_domain_name"`
	TransparentClientIpEnable bool                 `json:"transparent_client_ip_enable"`
	ShardingCount             int                  `json:"sharding_count"`
	ProductType               string               `json:"product_type"`
}

func Get

type GetSslResponse

type GetSslResponse struct {
	Enable       bool   `json:"enabled"`
	Ip           string `json:"ip"`
	SslValidated bool   `json:"ssl_validated"`
	Port         string `json:"port"`
	DomainName   string `json:"domain_name"`
	SslExpiredAt string `json:"ssl_expired_at"`
}

func GetSsl

func GetSsl(client *golangsdk.ServiceClient, id string) (*GetSslResponse, error)

type InstanceBackupPolicy

type InstanceBackupPolicy struct {
	BackupPolicyId string          `json:"backup_policy_id"`
	Policy         DcsBackupPolicy `json:"policy"`
}

type InstanceBackupPolicyOpts

type InstanceBackupPolicyOpts struct {
	BackupType           string     `json:"backup_type" required:"true"`
	SaveDays             int        `json:"save_days,omitempty"`
	PeriodicalBackupPlan BackupPlan `json:"periodical_backup_plan,omitempty"`
}

type ModifyInstanceOpt

type ModifyInstanceOpt struct {
	Name            string                    `json:"name,omitempty"`
	Description     *string                   `json:"description,omitempty"`
	Port            int                       `json:"port,omitempty"`
	MaintainBegin   string                    `json:"maintain_begin,omitempty"`
	MaintainEnd     string                    `json:"maintain_end,omitempty"`
	SecurityGroupId *string                   `json:"security_group_id,omitempty"`
	BackupPolicy    *InstanceBackupPolicyOpts `json:"instance_backup_policy,omitempty"`
	RenameCommands  *RedisCommand             `json:"rename_commands,omitempty"`
}

type ModifyRedisConfigOpts

type ModifyRedisConfigOpts struct {
	RedisConfig []RedisConfigOpt `json:"redis_config"`
}

type RedisCommand

type RedisCommand struct {
	Command  string `json:"command,omitempty"`
	Keys     string `json:"keys,omitempty"`
	Flushdb  string `json:"flushdb,omitempty"`
	Flushall string `json:"flushall,omitempty"`
	Hgetall  string `json:"hgetall,omitempty"`
}

type RedisConfig

type RedisConfig struct {
	Proxy              bool   `json:"proxy"`
	ParamId            string `json:"param_id"`
	ParamName          string `json:"param_name"`
	DefaultValue       string `json:"default_value"`
	ValueRange         string `json:"value_range"`
	ValueType          string `json:"value_type"`
	Description        string `json:"description"`
	ParamValue         string `json:"param_value"`
	NodeRole           string `json:"node_role"`
	ParamType          string `json:"param_type"`
	UserPermission     string `json:"user_permission"`
	NeedRestart        bool   `json:"need_restart"`
	SupportedVersion   string `json:"supported_version"`
	InternationalKey   string `json:"international_key"`
	NewVersionOnly     bool   `json:"new_version_only"`
	SupportDataVersion string `json:"support_data_version"`
	Customized         bool   `json:"customized"`
}

type RedisConfigOpt

type RedisConfigOpt struct {
	ParamId    string `json:"param_id" required:"true"`
	ParamName  string `json:"param_name" required:"true"`
	ParamValue string `json:"param_value" required:"true"`
}

type ResizeInstanceOpts

type ResizeInstanceOpts struct {
	SpecCode       string          `json:"spec_code" required:"true"`
	NewCapacity    float64         `json:"new_capacity" required:"true"`
	BssParam       DcsBssParamOpts `json:"bss_param,omitempty"`
	ReservedIp     []string        `json:"reserved_ip,omitempty"`
	ChangeType     string          `json:"change_type,omitempty"`
	AvailableZones []string        `json:"available_zones,omitempty"`
	NodeList       []string        `json:"node_list,omitempty"`
}

type ResizePrePaidInstanceOpts

type ResizePrePaidInstanceOpts struct {
	AutoOpenSecurityGroupRule bool    `json:"auto_open_security_group_rule,omitempty"`
	ExecuteImmediately        bool    `json:"execute_immediately,omitempty"`
	NewCapacity               float64 `json:"new_capacity,omitempty"`
	Password                  string  `json:"password,omitempty"`
	SpecCode                  string  `json:"spec_code,omitempty"`
}

type ResizePrePaidResponse

type ResizePrePaidResponse struct {
	OrderId string `json:"order_id"`
}

type ResizeResponse

type ResizeResponse struct {
	OrderId string `json:"order_id"`
}

type RestartOrFlushInstanceOpts

type RestartOrFlushInstanceOpts struct {
	Instances []string `json:"instances,omitempty"`
	Action    string   `json:"action,omitempty"`
}

type RestartResponse

type RestartResponse struct {
	Results []RestartResultResponse `json:"results"`
}

type RestartResultResponse

type RestartResultResponse struct {
	Result   string `json:"result"`
	Instance string `json:"instance"`
}

type SimpleInstance

type SimpleInstance struct {
	InstanceId   string `json:"instance_id,omitempty"`
	InstanceName string `json:"instance_name,omitempty"`
}

type SslOpts

type SslOpts struct {
	Enable *bool `json:"enabled" required:"true"`
}

type UpdatePasswordOpts

type UpdatePasswordOpts struct {
	OldPassword string `json:"old_password,omitempty"`
	NewPassword string `json:"new_password,omitempty"`
}

Jump to

Keyboard shortcuts

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