rds

package
v0.0.0-...-f8f9ceb Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ECSDefaultEndpoint is the default API endpoint of RDS services
	RDSDefaultEndpoint = "https://rds.aliyuncs.com"
	RDSAPIVersion      = "2014-08-15"
	RDSServiceCode     = "rds"
)
View Source
const (
	Creating  = InstanceStatus("Creating") // For backward compatability
	Running   = InstanceStatus("Running")
	Deleting  = InstanceStatus("Deleting")
	Rebooting = InstanceStatus("Rebooting")

	Restoring                 = InstanceStatus("Restoring")
	Importing                 = InstanceStatus("Importing")
	DBInstanceNetTypeChanging = InstanceStatus("DBInstanceNetTypeChanging")
)

Constants of InstanceStatus

View Source
const (
	Prepaid  = DBPayType("Prepaid")
	Postpaid = DBPayType("Postpaid")
)
View Source
const (
	Rds   = CommodityCode("rds")
	Bards = CommodityCode("bards")
	Rords = CommodityCode("rords")
)
View Source
const (
	MySQL     = Engine("MySQL")
	SQLServer = Engine("SQLServer")
	PPAS      = Engine("PPAS")
	PG        = Engine("PG")
)
View Source
const (
	Performance = ConnectionMode("Performance")
	Safty       = ConnectionMode("Safty")
)
View Source
const (
	Unavailable = AccountStatus("Unavailable")
	Available   = AccountStatus("Available")
)
View Source
const (
	ReadOnly  = AccountPrivilege("ReadOnly")
	ReadWrite = AccountPrivilege("ReadWrite")
)
View Source
const (
	Inner   = IPType("Inner")
	Private = IPType("Private")
	Public  = IPType("Public")
)
View Source
const DefaultResource = "buy"

default resource value for create order

View Source
const DefaultWaitForInterval = 10
View Source
const InstanceDefaultTimeout = 120

Default timeout value for WaitForInstance method

Variables

View Source
var BACKUP_TIME = []string{
	"00:00Z-01:00Z", "01:00Z-02:00Z", "02:00Z-03:00Z", "03:00Z-04:00Z", "04:00Z-05:00Z",
	"05:00Z-06:00Z", "06:00Z-07:00Z", "07:00Z-08:00Z", "08:00Z-09:00Z", "09:00Z-10:00Z",
	"10:00Z-11:00Z", "11:00Z-12:00Z", "12:00Z-13:00Z", "13:00Z-14:00Z", "14:00Z-15:00Z",
	"15:00Z-16:00Z", "16:00Z-17:00Z", "17:00Z-18:00Z", "18:00Z-19:00Z", "19:00Z-20:00Z",
	"20:00Z-21:00Z", "21:00Z-22:00Z", "22:00Z-23:00Z", "23:00Z-24:00Z",
}
View Source
var CHARACTER_SET_NAME = []string{
	"utf8", "gbk", "latin1", "utf8mb4",
	"Chinese_PRC_CI_AS", "Chinese_PRC_CS_AS", "SQL_Latin1_General_CP1_CI_AS", "SQL_Latin1_General_CP1_CS_AS", "Chinese_PRC_BIN",
}
View Source
var WEEK_ENUM = []string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}

Functions

This section is empty.

Types

type AccountPrivilege

type AccountPrivilege string

type AccountPrivilegeInfo

type AccountPrivilegeInfo struct {
	Account          string
	AccountPrivilege string
}

type AccountStatus

type AccountStatus string

type AccountType

type AccountType struct {
	Normal string
	Super  string
}

type AllocateInstancePublicConnectionArgs

type AllocateInstancePublicConnectionArgs struct {
	DBInstanceId           string
	ConnectionStringPrefix string
	Port                   string
}

type AllocateInstancePublicConnectionResponse

type AllocateInstancePublicConnectionResponse struct {
	common.Response
}

type BackupPolicy

type BackupPolicy struct {
	PreferredBackupTime      string // HH:mmZ - HH:mm Z
	PreferredBackupPeriod    string // Monday - Sunday
	BackupRetentionPeriod    int    // 7 - 730
	BackupLog                string // enum Enable | Disabled
	LogBackupRetentionPeriod string
}

type Client

type Client struct {
	common.Client
}

func NewClient

func NewClient(accessKeyId, accessKeySecret string) *Client

NewClient creates a new instance of RDS client

func NewClientWithEndpoint

func NewClientWithEndpoint(endpoint string, accessKeyId, accessKeySecret string) *Client

func NewClientWithRegion

func NewClientWithRegion(endpoint string, accessKeyId, accessKeySecret string, regionID common.Region) *Client

func NewRDSClient

func NewRDSClient(accessKeyId, accessKeySecret string, regionID common.Region) *Client

func (*Client) AllocateInstancePublicConnection

func (client *Client) AllocateInstancePublicConnection(args *AllocateInstancePublicConnectionArgs) (resp *AllocateInstancePublicConnectionResponse, err error)

AllocateInstancePublicConnection allocate public connection

You can read doc at https://help.aliyun.com/document_detail/26234.html?spm=5176.doc26265.6.708.PdsJnL

func (*Client) CreateAccount

func (client *Client) CreateAccount(args *CreateAccountArgs) (resp *CreateAccountResponse, err error)

CreateAccount create rds account

You can read doc at https://help.aliyun.com/document_detail/26263.html?spm=5176.doc26240.6.736.ZDihok

func (*Client) CreateDatabase

func (client *Client) CreateDatabase(args *CreateDatabaseArgs) (resp *CreateDatabaseResponse, err error)

CreateDatabase create rds database

You can read doc at https://help.aliyun.com/document_detail/26243.html?spm=5176.doc26244.6.715.OSNUa8

func (*Client) CreateOrder

func (client *Client) CreateOrder(args *CreateOrderArgs) (resp CreateOrderResponse, err error)

CreateOrder create db instance order you can read doc at http://docs.alibaba-inc.com/pages/viewpage.action?pageId=259349053

func (*Client) DeleteAccount

func (client *Client) DeleteAccount(instanceId, accountName string) (resp *DeleteAccountResponse, err error)

DeleteAccount delete account

You can read doc at https://help.aliyun.com/document_detail/26264.html?spm=5176.doc26269.6.737.CvlZp6

func (*Client) DeleteDatabase

func (client *Client) DeleteDatabase(instanceId, dbName string) error

DeleteInstance deletes database

You can read doc at https://help.aliyun.com/document_detail/26259.html?spm=5176.doc26260.6.731.Abjwne

func (*Client) DeleteInstance

func (client *Client) DeleteInstance(instanceId string) error

DeleteInstance deletes db instance

You can read doc at https://help.aliyun.com/document_detail/26229.html?spm=5176.doc26315.6.700.7SmyAT

func (*Client) DescribeAccounts

func (client *Client) DescribeAccounts(args *DescribeAccountsArgs) (resp *DescribeAccountsResponse, err error)

DescribeAccounts describes db accounts

You can read doc at https://help.aliyun.com/document_detail/26265.html?spm=5176.doc26266.6.739.UjtjaI

func (*Client) DescribeBackupPolicy

func (client *Client) DescribeBackupPolicy(args *DescribeBackupPolicyArgs) (resp *DescribeBackupPolicyResponse, err error)

DescribeBackupPolicy describe backup policy

You can read doc at https://help.aliyun.com/document_detail/26275.html?spm=5176.doc26276.6.750.CUqjDn

func (*Client) DescribeDBInstanceAttribute

func (client *Client) DescribeDBInstanceAttribute(args *DescribeDBInstancesArgs) (resp *DescribeDBInstanceAttributeResponse, err error)

DescribeDBInstanceAttribute describes db instance

You can read doc at https://help.aliyun.com/document_detail/26231.html?spm=5176.doc26228.6.702.uhzm31

func (*Client) DescribeDBInstanceIPs

func (client *Client) DescribeDBInstanceIPs(args *DescribeDBInstanceIPsArgs) (resp *DescribeDBInstanceIPsResponse, err error)

DescribeDBInstanceIPArrayList describe security ips

You can read doc at https://help.aliyun.com/document_detail/26241.html?spm=5176.doc26242.6.715.d9pxvr

func (*Client) DescribeDBInstanceNetInfo

func (client *Client) DescribeDBInstanceNetInfo(args *DescribeDBInstanceNetInfoArgs) (resp *DescribeDBInstanceNetInfoResponse, err error)

DescribeDBInstanceNetInfo describe rds net info

You can read doc at https://help.aliyun.com/document_detail/26237.html?spm=5176.doc26234.6.711.vHOktx

func (*Client) DescribeDBInstancePerformance

func (client *Client) DescribeDBInstancePerformance(args *DescribeDBInstancePerformanceArgs) (resp DescribeDBInstancePerformanceResponse, err error)

func (*Client) DescribeDatabases

func (client *Client) DescribeDatabases(args *DescribeDatabasesArgs) (resp *DescribeDatabasesResponse, err error)

DescribeDatabases describes db database

You can read doc at https://help.aliyun.com/document_detail/26260.html?spm=5176.doc26258.6.732.gCx1a3

func (*Client) DescribeRegions

func (client *Client) DescribeRegions() (resp *DescribeRegionsResponse, err error)

DescribeRegions describe rds regions

You can read doc at https://help.aliyun.com/document_detail/26243.html?spm=5176.doc26244.6.715.OSNUa8

func (*Client) GrantAccountPrivilege

func (client *Client) GrantAccountPrivilege(args *GrantAccountPrivilegeArgs) (resp *GrantAccountPrivilegeResponse, err error)

GrantAccountPrivilege grant database privilege to account

You can read doc at https://help.aliyun.com/document_detail/26266.html?spm=5176.doc26264.6.739.o2y01n

func (*Client) ModifyBackupPolicy

func (client *Client) ModifyBackupPolicy(args *ModifyBackupPolicyArgs) (resp *ModifyBackupPolicyResponse, err error)

ModifyBackupPolicy modify backup policy

You can read doc at https://help.aliyun.com/document_detail/26276.html?spm=5176.doc26250.6.751.KOew21

func (*Client) ModifyDBInstanceSpec

func (client *Client) ModifyDBInstanceSpec(args *ModifyDBInstanceSpecArgs) (resp *ModifyDBInstanceSpecResponse, err error)

ModifyDBInstanceSpec modify db instance spec

You can read doc at https://help.aliyun.com/document_detail/26233.html?spm=5176.doc26258.6.707.2QOLrM

func (*Client) ModifySecurityIps

func (client *Client) ModifySecurityIps(args *ModifySecurityIpsArgs) (resp common.Response, err error)

func (*Client) WaitForAccount

func (client *Client) WaitForAccount(instanceId string, accountName string, status AccountStatus, timeout int) error

func (*Client) WaitForAccountPrivilege

func (client *Client) WaitForAccountPrivilege(instanceId, accountName, dbName string, privilege AccountPrivilege, timeout int) error

func (*Client) WaitForAllDatabase

func (client *Client) WaitForAllDatabase(instanceId string, databaseNames []string, status InstanceStatus, timeout int) error

func (*Client) WaitForInstance

func (client *Client) WaitForInstance(instanceId string, status InstanceStatus, timeout int) error

WaitForInstance waits for instance to given status

func (*Client) WaitForInstanceAsyn

func (client *Client) WaitForInstanceAsyn(instanceId string, status InstanceStatus, timeout int) error

WaitForInstance waits for instance to given status

func (*Client) WaitForPublicConnection

func (client *Client) WaitForPublicConnection(instanceId string, timeout int) error

type CommodityCode

type CommodityCode string

type ConnectionMode

type ConnectionMode string

type CreateAccountArgs

type CreateAccountArgs struct {
	DBInstanceId       string
	AccountName        string
	AccountPassword    string
	AccountType        AccountType
	AccountDescription string
}

type CreateAccountResponse

type CreateAccountResponse struct {
	common.Response
}

type CreateDatabaseArgs

type CreateDatabaseArgs struct {
	DBInstanceId     string
	DBName           string
	CharacterSetName string
	DBDescription    string
}

type CreateDatabaseResponse

type CreateDatabaseResponse struct {
	common.Response
}

type CreateOrderArgs

type CreateOrderArgs struct {
	CommodityCode       CommodityCode
	RegionId            common.Region
	ZoneId              string
	Engine              Engine
	EngineVersion       string
	PayType             DBPayType
	DBInstanceClass     string
	DBInstanceStorage   int
	DBInstanceNetType   common.NetType
	InstanceNetworkType common.NetworkType
	VPCId               string
	VSwitchId           string
	UsedTime            int
	TimeType            common.TimeType
	Quantity            int
	InstanceUsedType    string
	Resource            string
	AutoPay             string
	AutoRenew           string
	BackupId            string
	RestoreTime         string
	SecurityIPList      string
	BusinessInfo        string
}

type CreateOrderResponse

type CreateOrderResponse struct {
	common.Response
	DBInstanceId string
	OrderId      int
}

type DBInstanceAccount

type DBInstanceAccount struct {
	DBInstanceId       string
	AccountName        string
	AccountStatus      AccountStatus
	AccountDescription string
	DatabasePrivileges struct {
		DatabasePrivilege []DatabasePrivilege
	}
}

type DBInstanceAttribute

type DBInstanceAttribute struct {
	DBInstanceId                string
	PayType                     DBPayType
	DBInstanceType              string
	InstanceNetworkType         string
	ConnectionMode              string
	RegionId                    string
	ZoneId                      string
	ConnectionString            string
	Port                        string
	Engine                      Engine
	EngineVersion               string
	DBInstanceClass             string
	DBInstanceMemory            int64
	DBInstanceStorage           int
	DBInstanceNetType           string
	DBInstanceStatus            InstanceStatus
	DBInstanceDescription       string
	LockMode                    string
	LockReason                  string
	DBMaxQuantity               int
	AccountMaxQuantity          int
	CreationTime                string
	ExpireTime                  string
	MaintainTime                string
	AvailabilityValue           string
	MaxIOPS                     int
	MaxConnections              int
	MasterInstanceId            string
	IncrementSourceDBInstanceId string
	GuardDBInstanceId           string
	TempDBInstanceId            string
	ReadOnlyDBInstanceIds       ReadOnlyDBInstanceIds
	SecurityIPList              string
}

type DBInstanceIPArray

type DBInstanceIPArray struct {
	SecurityIps                string
	DBInstanceIPArrayName      string
	DBInstanceIPArrayAttribute string
}

type DBInstanceIPList

type DBInstanceIPList struct {
	DBInstanceIPArrayName      string
	DBInstanceIPArrayAttribute string
	SecurityIPList             string
}

type DBInstanceNetInfo

type DBInstanceNetInfo struct {
	ConnectionString string
	IPAddress        string
	Port             string
	VPCId            string
	VSwitchId        string
	IPType           IPType
}

type DBPayType

type DBPayType string

type Database

type Database struct {
	DBName           string
	DBInstanceId     string
	Engine           string
	DBStatus         InstanceStatus
	CharacterSetName InstanceStatus
	DBDescription    InstanceStatus
	Account          InstanceStatus
	AccountPrivilege InstanceStatus
	Accounts         struct {
		AccountPrivilegeInfo []AccountPrivilegeInfo
	}
}

type DatabasePrivilege

type DatabasePrivilege struct {
	DBName           string
	AccountPrivilege AccountPrivilege
}

type DeleteAccountArgs

type DeleteAccountArgs struct {
	DBInstanceId string
	AccountName  string
}

type DeleteAccountResponse

type DeleteAccountResponse struct {
	common.Response
}

type DeleteDBInstanceArgs

type DeleteDBInstanceArgs struct {
	DBInstanceId string
}

type DeleteDBInstanceResponse

type DeleteDBInstanceResponse struct {
	common.Response
}

type DeleteDatabaseArgs

type DeleteDatabaseArgs struct {
	DBInstanceId string
	DBName       string
}

type DeleteDatabaseResponse

type DeleteDatabaseResponse struct {
	common.Response
}

type DescribeAccountsArgs

type DescribeAccountsArgs struct {
	DBInstanceId string
	AccountName  string
}

type DescribeAccountsResponse

type DescribeAccountsResponse struct {
	common.Response
	Accounts struct {
		DBInstanceAccount []DBInstanceAccount
	}
}

type DescribeBackupPolicyArgs

type DescribeBackupPolicyArgs struct {
	DBInstanceId string
}

type DescribeBackupPolicyResponse

type DescribeBackupPolicyResponse struct {
	common.Response
	BackupPolicy
}

type DescribeDBInstanceAttributeResponse

type DescribeDBInstanceAttributeResponse struct {
	common.Response
	Items struct {
		DBInstanceAttribute []DBInstanceAttribute
	}
}

type DescribeDBInstanceIPsArgs

type DescribeDBInstanceIPsArgs struct {
	DBInstanceId string
}

type DescribeDBInstanceIPsResponse

type DescribeDBInstanceIPsResponse struct {
	common.Response
	Items struct {
		DBInstanceIPArray []DBInstanceIPList
	}
}

type DescribeDBInstanceNetInfoArgs

type DescribeDBInstanceNetInfoArgs struct {
	DBInstanceId string
}

type DescribeDBInstanceNetInfoResponse

type DescribeDBInstanceNetInfoResponse struct {
	common.Response
	InstanceNetworkType string
	DBInstanceNetInfos  struct {
		DBInstanceNetInfo []DBInstanceNetInfo
	}
}

type DescribeDBInstancePerformanceArgs

type DescribeDBInstancePerformanceArgs struct {
	DBInstanceId string

	StartTime string
	EndTime   string
	// contains filtered or unexported fields
}

func (*DescribeDBInstancePerformanceArgs) Setkey

func (client *DescribeDBInstancePerformanceArgs) Setkey(key string)

type DescribeDBInstancePerformanceResponse

type DescribeDBInstancePerformanceResponse struct {
	common.Response
	DBInstanceId    string
	Engine          string
	StartTime       util.ISO6801Time
	EndTime         util.ISO6801Time
	PerformanceKeys struct {
		PerformanceKey []PerformanceKeyType
	}
}

type DescribeDBInstancesArgs

type DescribeDBInstancesArgs struct {
	DBInstanceId string
}

type DescribeDatabasesArgs

type DescribeDatabasesArgs struct {
	DBInstanceId string
	DBName       string
	DBStatus     InstanceStatus
}

type DescribeDatabasesResponse

type DescribeDatabasesResponse struct {
	common.Response
	Databases struct {
		Database []Database
	}
}

type DescribeRegionsArgs

type DescribeRegionsArgs struct {
}

type DescribeRegionsResponse

type DescribeRegionsResponse struct {
	Regions struct {
		RDSRegion []RDSRegion
	}
}

type Engine

type Engine string

type GrantAccountPrivilegeArgs

type GrantAccountPrivilegeArgs struct {
	DBInstanceId     string
	AccountName      string
	DBName           string
	AccountPrivilege AccountPrivilege
}

type GrantAccountPrivilegeResponse

type GrantAccountPrivilegeResponse struct {
	common.Response
}

type IPType

type IPType string

type InstanceStatus

type InstanceStatus string

InstanceStatus represents instance status

type ModifyBackupPolicyArgs

type ModifyBackupPolicyArgs struct {
	DBInstanceId string
	BackupPolicy
}

type ModifyBackupPolicyResponse

type ModifyBackupPolicyResponse struct {
	common.Response
}

type ModifyDBInstanceSpecArgs

type ModifyDBInstanceSpecArgs struct {
	DBInstanceId      string
	PayType           DBPayType
	DBInstanceClass   string
	DBInstanceStorage string
}

type ModifyDBInstanceSpecResponse

type ModifyDBInstanceSpecResponse struct {
	common.Response
}

type ModifySecurityIpsArgs

type ModifySecurityIpsArgs struct {
	DBInstanceId string
	DBInstanceIPArray
}

ref: https://help.aliyun.com/document_detail/26242.html

type PerformanceKeyType

type PerformanceKeyType struct {
	Key         string
	Unit        string
	ValueFormat string
	Values      struct {
		PerformanceValue []PerformanceValueType
	}
}

type PerformanceValueType

type PerformanceValueType struct {
	Value string
	Date  util.ISO6801Time
}

type RDSRegion

type RDSRegion struct {
	RegionId string
	ZoneId   string
}

type ReadOnlyDBInstanceIds

type ReadOnlyDBInstanceIds struct {
	ReadOnlyDBInstanceId []string
}

Jump to

Keyboard shortcuts

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