Documentation ¶
Overview ¶
Package rds defines the RDS services of BCE. The supported APIs are all defined in sub-package
rds.go - the rds APIs definition supported by the RDS service
util.go - define the utilities for api package of RDS service
Index ¶
- Constants
- func Aes128EncryptUseSecreteKey(sk string, data string) (string, error)
- type Account
- type AutoRenewArgs
- type BackupPolicy
- type Billing
- type Client
- func (c *Client) AutoRenew(args *AutoRenewArgs) error
- func (c *Client) CreateAccount(instanceId string, args *CreateAccountArgs) error
- func (c *Client) CreateRds(args *CreateRdsArgs) (*CreateResult, error)
- func (c *Client) CreateRdsProxy(args *CreateRdsProxyArgs) (*CreateResult, error)
- func (c *Client) CreateReadReplica(args *CreateReadReplicaArgs) (*CreateResult, error)
- func (c *Client) DeleteAccount(instanceId, accountName string) error
- func (c *Client) DeleteRds(instanceIds string) error
- func (c *Client) GetAccount(instanceId, accountName string) (*Account, error)
- func (c *Client) GetBackupDetail(instanceId string, backupId string) (*Snapshot, error)
- func (c *Client) GetBackupList(instanceId string, args *GetBackupListArgs) (*GetBackupListResult, error)
- func (c *Client) GetDetail(instanceId string) (*Instance, error)
- func (c *Client) GetSecurityIps(instanceId string) (*GetSecurityIpsResult, error)
- func (c *Client) GetZoneList() (*GetZoneListResult, error)
- func (c *Client) ListAccount(instanceId string) (*ListAccountResult, error)
- func (c *Client) ListParameters(instanceId string) (*ListParametersResult, error)
- func (c *Client) ListRds(args *ListRdsArgs) (*ListRdsResult, error)
- func (c *Client) ListSubnets(args *ListSubnetsArgs) (*ListSubnetsResult, error)
- func (c *Client) ModifyBackupPolicy(instanceId string, args *ModifyBackupPolicyArgs) error
- func (c *Client) ModifyEndpoint(instanceId string, args *ModifyEndpointArgs) error
- func (c *Client) ModifyPublicAccess(instanceId string, args *ModifyPublicAccessArgs) error
- func (c *Client) ModifySyncMode(instanceId string, args *ModifySyncModeArgs) error
- func (c *Client) RebootInstance(instanceId string) error
- func (c *Client) ResizeRds(instanceId string, args *ResizeRdsArgs) error
- func (c *Client) UpdateInstanceName(instanceId string, args *UpdateInstanceNameArgs) error
- func (c *Client) UpdateParameter(instanceId, Etag string, args *UpdateParameterArgs) error
- func (c *Client) UpdateSecurityIps(instanceId, Etag string, args *UpdateSecurityIpsArgs) error
- type CreateAccountArgs
- type CreateRdsArgs
- type CreateRdsProxyArgs
- type CreateReadReplicaArgs
- type CreateResult
- type DatabasePrivilege
- type Endpoint
- type GetBackupListArgs
- type GetBackupListResult
- type GetSecurityIpsResult
- type GetZoneListResult
- type Instance
- type KVParameter
- type ListAccountResult
- type ListParametersResult
- type ListRdsArgs
- type ListRdsResult
- type ListSubnetsArgs
- type ListSubnetsResult
- type ModifyBackupPolicyArgs
- type ModifyEndpointArgs
- type ModifyPublicAccessArgs
- type ModifySyncModeArgs
- type Parameter
- type Reservation
- type ResizeRdsArgs
- type Snapshot
- type Subnet
- type SubnetMap
- type Topology
- type UpdateInstanceNameArgs
- type UpdateParameterArgs
- type UpdateSecurityIpsArgs
- type ZoneName
Constants ¶
const ( URI_PREFIX = bce.URI_PREFIX + "v1" DEFAULT_ENDPOINT = "rds.bj.baidubce.com" REQUEST_RDS_URL = "/instance" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AutoRenewArgs ¶
type BackupPolicy ¶
type Billing ¶
type Billing struct { PaymentTiming string `json:"paymentTiming"` Reservation Reservation `json:"reservation,omitempty"` }
type Client ¶
Client of RDS service is a kind of BceClient, so derived from BceClient
func (*Client) AutoRenew ¶
func (c *Client) AutoRenew(args *AutoRenewArgs) error
autoRenew - create autoRenew
PARAMS:
- Args: *autoRenewArgs
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) CreateAccount ¶
func (c *Client) CreateAccount(instanceId string, args *CreateAccountArgs) error
CreateAccount - create a account with the specific parameters
PARAMS:
- instanceId: the specific instanceId
- args: the arguments to create a account
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) CreateRds ¶
func (c *Client) CreateRds(args *CreateRdsArgs) (*CreateResult, error)
CreateRds - create a RDS with the specific parameters
PARAMS:
- args: the arguments to create a rds
RETURNS:
- *InstanceIds: the result of create RDS, contains new RDS's instanceIds
- error: nil if success otherwise the specific error
func (*Client) CreateRdsProxy ¶
func (c *Client) CreateRdsProxy(args *CreateRdsProxyArgs) (*CreateResult, error)
CreateRdsProxy - create a proxy RDS with the specific parameters
PARAMS:
- args: the arguments to create a readReplica rds
RETURNS:
- *InstanceIds: the result of create a readReplica RDS, contains the readReplica RDS's instanceIds
- error: nil if success otherwise the specific error
func (*Client) CreateReadReplica ¶
func (c *Client) CreateReadReplica(args *CreateReadReplicaArgs) (*CreateResult, error)
CreateReadReplica - create a readReplica RDS with the specific parameters
PARAMS:
- args: the arguments to create a readReplica rds
RETURNS:
- *InstanceIds: the result of create a readReplica RDS, contains the readReplica RDS's instanceIds
- error: nil if success otherwise the specific error
func (*Client) DeleteAccount ¶
DeleteAccount - delete an account of a RDS instance
PARAMS:
- instanceIds: the specific instanceIds
- accountName: the specific account's name
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) DeleteRds ¶
DeleteRds - delete a rds
PARAMS:
- instanceIds: the specific instanceIds
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) GetAccount ¶
GetAccount - get an account of a RDS instance with the specific parameters
PARAMS:
- instanceId: the specific rds Instance's ID
- accountName: the specific account's name
RETURNS:
- *Account: the account's meta
- error: nil if success otherwise the specific error
func (*Client) GetBackupDetail ¶
GetBackupDetail - get backup detail of the instance's backup
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
- backupId: id of the backup
RETURNS:
- *Snapshot: result of the backup detail
- error: nil if success otherwise the specific error
func (*Client) GetBackupList ¶
func (c *Client) GetBackupList(instanceId string, args *GetBackupListArgs) (*GetBackupListResult, error)
GetBackupList - get backup list of the instance
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
RETURNS:
- *GetBackupListResult: result of the backup list
- error: nil if success otherwise the specific error
func (*Client) GetDetail ¶
GetDetail - get a specific rds Instance's detail
PARAMS:
- instanceId: the specific rds Instance's ID
RETURNS:
- *Instance: the specific rdsInstance's detail
- error: nil if success otherwise the specific error
func (*Client) GetSecurityIps ¶
func (c *Client) GetSecurityIps(instanceId string) (*GetSecurityIpsResult, error)
GetSecurityIps - get all SecurityIps
PARAMS:
- instanceId: the specific rds Instance's ID
RETURNS:
- *GetSecurityIpsResult: all security IP
- error: nil if success otherwise the specific error
func (*Client) GetZoneList ¶
func (c *Client) GetZoneList() (*GetZoneListResult, error)
GetZoneList - list all zone
PARAMS:
- cli: the client agent which can perform sending request
RETURNS:
- *GetZoneListResult: result of the zone list
- error: nil if success otherwise the specific error
func (*Client) ListAccount ¶
func (c *Client) ListAccount(instanceId string) (*ListAccountResult, error)
ListAccount - list all account of a RDS instance with the specific parameters
PARAMS:
- instanceId: the specific rds Instance's ID
RETURNS:
- *ListAccountResult: the result of list all account, contains all accounts' meta
- error: nil if success otherwise the specific error
func (*Client) ListParameters ¶
func (c *Client) ListParameters(instanceId string) (*ListParametersResult, error)
ListParameters - list all parameters of a RDS instance
PARAMS:
- instanceId: the specific rds Instance's ID
RETURNS:
- *ListParametersResult: the result of list all parameters
- error: nil if success otherwise the specific error
func (*Client) ListRds ¶
func (c *Client) ListRds(args *ListRdsArgs) (*ListRdsResult, error)
ListRds - list all RDS with the specific parameters
PARAMS:
- args: the arguments to list all RDS
RETURNS:
- *ListRdsResult: the result of list all RDS, contains all rds' meta
- error: nil if success otherwise the specific error
func (*Client) ListSubnets ¶
func (c *Client) ListSubnets(args *ListSubnetsArgs) (*ListSubnetsResult, error)
ListsSubnet - list all Subnets
PARAMS:
- cli: the client agent which can perform sending request
- args: the arguments to list all subnets, not necessary
RETURNS:
- *ListSubnetsResult: result of the subnet list
- error: nil if success otherwise the specific error
func (*Client) ModifyBackupPolicy ¶
func (c *Client) ModifyBackupPolicy(instanceId string, args *ModifyBackupPolicyArgs) error
ModifyBackupPolicy - modify backup policy
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
- args: the arguments to modify public access
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) ModifyEndpoint ¶
func (c *Client) ModifyEndpoint(instanceId string, args *ModifyEndpointArgs) error
ModifyEndpoint - modify the prefix of endpoint
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
- args: the arguments to modify endpoint
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) ModifyPublicAccess ¶
func (c *Client) ModifyPublicAccess(instanceId string, args *ModifyPublicAccessArgs) error
ModifyPublicAccess - modify public access
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
- args: the arguments to modify public access
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) ModifySyncMode ¶
func (c *Client) ModifySyncMode(instanceId string, args *ModifySyncModeArgs) error
UpdateSyncMode - update sync mode of a specified instance
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
- args: the arguments to update syncMode
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) RebootInstance ¶
RebootInstance - reboot a specified instance
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance to be rebooted
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) ResizeRds ¶
func (c *Client) ResizeRds(instanceId string, args *ResizeRdsArgs) error
ResizeRds - resize an RDS with the specific parameters
PARAMS:
- instanceId: the specific instanceId
- args: the arguments to resize an RDS
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) UpdateInstanceName ¶
func (c *Client) UpdateInstanceName(instanceId string, args *UpdateInstanceNameArgs) error
UpdateInstanceName - update name of a specified instance
PARAMS:
- cli: the client agent which can perform sending request
- instanceId: id of the instance
- args: the arguments to update instanceName
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) UpdateParameter ¶
func (c *Client) UpdateParameter(instanceId, Etag string, args *UpdateParameterArgs) error
UpdateParameter - update Parameter
PARAMS:
- instanceId: the specific rds Instance's ID
- Etag: get latest etag by ListParameters
- Args: *UpdateParameterArgs
RETURNS:
- error: nil if success otherwise the specific error
func (*Client) UpdateSecurityIps ¶
func (c *Client) UpdateSecurityIps(instanceId, Etag string, args *UpdateSecurityIpsArgs) error
UpdateSecurityIps - update SecurityIps
PARAMS:
- instanceId: the specific rds Instance's ID
- Etag: get latest etag by GetSecurityIps
- Args: all SecurityIps
RETURNS:
- error: nil if success otherwise the specific error
type CreateAccountArgs ¶
type CreateAccountArgs struct { ClientToken string `json:"-"` AccountName string `json:"accountName"` Password string `json:"password"` AccountType string `json:"accountType,omitempty"` DatabasePrivileges []DatabasePrivilege `json:"databasePrivileges,omitempty"` Desc string `json:"desc,omitempty"` Type string `json:"type,omitempty"` }
type CreateRdsArgs ¶
type CreateRdsArgs struct { ClientToken string `json:"-"` Billing Billing `json:"billing"` PurchaseCount int `json:"purchaseCount,omitempty"` InstanceName string `json:"instanceName,omitempty"` Engine string `json:"engine"` EngineVersion string `json:"engineVersion"` Category string `json:"category,omitempty"` CpuCount int `json:"cpuCount"` MemoryCapacity float64 `json:"memoryCapacity"` VolumeCapacity int `json:"volumeCapacity"` ZoneNames []string `json:"zoneNames,omitempty"` VpcId string `json:"vpcId,omitempty"` IsDirectPay bool `json:"isDirectPay,omitempty"` Subnets []SubnetMap `json:"subnets,omitempty"` Tags []model.TagModel `json:"tags,omitempty"` AutoRenewTimeUnit string `json:"autoRenewTimeUnit,omitempty"` AutoRenewTime int `json:"autoRenewTime,omitempty"` BgwGroupId string `json:"bgwGroupId,omitempty"` }
type CreateRdsProxyArgs ¶
type CreateRdsProxyArgs struct { ClientToken string `json:"-"` Billing Billing `json:"billing"` SourceInstanceId string `json:"sourceInstanceId"` InstanceName string `json:"instanceName,omitempty"` NodeAmount int `json:"nodeAmount"` ZoneNames []string `json:"zoneNames,omitempty"` VpcId string `json:"vpcId,omitempty"` IsDirectPay bool `json:"isDirectPay,omitempty"` Subnets []SubnetMap `json:"subnets,omitempty"` Tags []model.TagModel `json:"tags,omitempty"` }
type CreateReadReplicaArgs ¶
type CreateReadReplicaArgs struct { ClientToken string `json:"-"` Billing Billing `json:"billing"` PurchaseCount int `json:"purchaseCount,omitempty"` SourceInstanceId string `json:"sourceInstanceId"` InstanceName string `json:"instanceName,omitempty"` CpuCount int `json:"cpuCount"` MemoryCapacity float64 `json:"memoryCapacity"` VolumeCapacity int `json:"volumeCapacity"` ZoneNames []string `json:"zoneNames,omitempty"` VpcId string `json:"vpcId,omitempty"` IsDirectPay bool `json:"isDirectPay,omitempty"` Subnets []SubnetMap `json:"subnets,omitempty"` Tags []model.TagModel `json:"tags,omitempty"` }
type CreateResult ¶
type CreateResult struct {
InstanceIds []string `json:"instanceIds"`
}
type DatabasePrivilege ¶
type GetBackupListArgs ¶
type GetBackupListResult ¶
type GetSecurityIpsResult ¶
type GetZoneListResult ¶
type GetZoneListResult struct {
Zones []ZoneName `json:"zones"`
}
type Instance ¶
type Instance struct { InstanceId string `json:"instanceId"` InstanceName string `json:"instanceName"` Engine string `json:"engine"` EngineVersion string `json:"engineVersion"` Category string `json:"category"` InstanceStatus string `json:"instanceStatus"` CpuCount int `json:"cpuCount"` MemoryCapacity float64 `json:"memoryCapacity"` VolumeCapacity int `json:"volumeCapacity"` NodeAmount int `json:"nodeAmount"` UsedStorage float64 `json:"usedStorage"` PublicAccessStatus string `json:"publicAccessStatus"` InstanceCreateTime string `json:"instanceCreateTime"` InstanceExpireTime string `json:"instanceExpireTime"` Endpoint Endpoint `json:"endpoint"` SyncMode string `json:"syncMode"` BackupPolicy BackupPolicy `json:"backupPolicy"` Region string `json:"region"` InstanceType string `json:"instanceType"` SourceInstanceId string `json:"sourceInstanceId"` SourceRegion string `json:"sourceRegion"` ZoneNames []string `json:"zoneNames"` VpcId string `json:"vpcId"` Subnets []Subnet `json:"subnets"` Topology Topology `json:"topology"` Task string `json:"task"` PaymentTiming string `json:"paymentTiming"` BgwGroupId string `json:"bgwGroupId"` }
type KVParameter ¶
type ListAccountResult ¶
type ListAccountResult struct {
Accounts []Account `json:"accounts"`
}
type ListParametersResult ¶
type ListRdsArgs ¶
type ListRdsResult ¶
type ListSubnetsArgs ¶
type ListSubnetsResult ¶
type ListSubnetsResult struct {
Subnets []Subnet `json:"subnets"`
}
type ModifyBackupPolicyArgs ¶
type ModifyEndpointArgs ¶
type ModifyEndpointArgs struct {
Address string `json:"address"`
}
type ModifyPublicAccessArgs ¶
type ModifyPublicAccessArgs struct {
PublicAccess bool `json:"publicAccess"`
}
type ModifySyncModeArgs ¶
type ModifySyncModeArgs struct {
SyncMode string `json:"syncMode"`
}
type Parameter ¶
type Parameter struct { Name string `json:"name"` DefaultValue string `json:"defaultValue"` Value string `json:"value"` PendingValue string `json:"pendingValue"` Type string `json:"type"` Dynamic string `json:"dynamic"` Modifiable string `json:"modifiable"` AllowedValues string `json:"allowedValues"` Desc string `json:"desc"` }
type Reservation ¶
type ResizeRdsArgs ¶
type Snapshot ¶
type Snapshot struct { SnapshotId string `json:"backupId"` SnapshotSizeInBytes int64 `json:"backupSize"` SnapshotType string `json:"backupType"` SnapshotStatus string `json:"backupStatus"` SnapshotStartTime string `json:"backupStartTime"` SnapshotEndTime string `json:"backupEndTime"` DownloadUrl string `json:"downloadUrl"` DownloadExpires string `json:"downloadExpires"` }
type UpdateInstanceNameArgs ¶
type UpdateInstanceNameArgs struct {
InstanceName string `json:"instanceName"`
}
type UpdateParameterArgs ¶
type UpdateParameterArgs struct {
Parameters []KVParameter `json:"parameters"`
}
type UpdateSecurityIpsArgs ¶
type UpdateSecurityIpsArgs struct {
SecurityIps []string `json:"securityIps"`
}