rdspostgresql

package
v1.0.101 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionCreateInstance      = "CreateDBInstance"
	ActionCreateIpWhiteList   = "CreateDBInstanceIPList"
	ActionCreateAccount       = "CreateAccount"
	ActionCreateDatabase      = "CreateDatabase"
	ActionModifyDatabaseOwner = "ModifyDatabaseOwner"
)
View Source
const (
	APIVersion20180101 = "2018-01-01"
)

Variables

View Source
var (
	ServiceInfoMap = map[string]*base.ServiceInfo{
		base.RegionCnNorth1: {
			Timeout: 5 * time.Second,
			Host:    "xxx.volcengineapi.com",
			Header: http.Header{
				"Accept": []string{"application/json"},
			},
			Credentials: base.Credentials{Region: base.RegionCnNorth1, Service: "rds_postgresql"},
		},
	}

	ApiInfoList = map[string]*base.ApiInfo{
		ActionCreateInstance: {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionCreateInstance},
				"Version": []string{APIVersion20180101},
			},
		},
		ActionCreateIpWhiteList: {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionCreateIpWhiteList},
				"Version": []string{APIVersion20180101},
			},
		},
		ActionCreateAccount: {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionCreateAccount},
				"Version": []string{APIVersion20180101},
			},
		},
		ActionCreateDatabase: {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionCreateDatabase},
				"Version": []string{APIVersion20180101},
			},
		},
		ActionModifyDatabaseOwner: {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{ActionModifyDatabaseOwner},
				"Version": []string{APIVersion20180101},
			},
		},
	}
)
View Source
var DefaultInstance = NewInstance(base.RegionCnNorth1)

Functions

func UnmarshalResultInto

func UnmarshalResultInto(data []byte, result interface{}) error

Types

type AccountType

type AccountType string
const (
	AccountTypeSuper  AccountType = "Super"
	AccountTypeNormal AccountType = "Normal"
)

type CType

type CType string
const (
	CType_C        CType = "C"
	CType_CUTF8    CType = "CUTF8"
	CType_EnUsUtf8 CType = "EnUsUtf8"
)

type Charset

type Charset string
const (
	Charset_UTF8   Charset = "utf8"
	Charset_LATIN1 Charset = "latin1"
	Charset_ASCII  Charset = "ascii"
)

type CollateType

type CollateType string
const (
	CollateType_C        CollateType = "C"
	CollateType_CUTF8    CollateType = "CUTF8"
	CollateType_EnUsUtf8 CollateType = "EnUsUtf8"
)

type CreateAccountReq

type CreateAccountReq struct {
	InstanceId      string      `json:"InstanceId"`
	AccountName     string      `json:"AccountName"`
	AccountPassword string      `json:"AccountPassword"`
	AccountDesc     string      `json:"AccountDesc"`
	AccountType     AccountType `json:"AccountType"`
}

type CreateDBInstanceIPListReq

type CreateDBInstanceIPListReq struct {
	InstanceId string   `json:"InstanceId"`
	GroupName  string   `json:"GroupName"`
	IPList     []string `json:"IPList"`
}

type CreateDatabaseReq

type CreateDatabaseReq struct {
	InstanceId       string      `json:"InstanceId"`
	DBName           string      `json:"DBName"`
	CharacterSetName Charset     `json:"CharacterSetName"`
	Collate          CollateType `json:"Collate"`
	Ctype            CType       `json:"Ctype"`
	Owner            string      `json:"Owner"`
}

type CreateInstanceReq

type CreateInstanceReq struct {
	Region           string `json:"Region"`
	Zone             string `json:"Zone"`
	ZoneSlave        string `json:"ZoneSlave"`
	DBEngine         string `json:"DBEngine"`
	DBEngineVersion  string `json:"DBEngineVersion"`
	InstanceType     string `json:"InstanceType"`
	StorageType      string `json:"StorageType"`
	StorageSpaceGB   int32  `json:"StorageSpaceGB"`
	Internal         bool   `json:"Internal"`
	ClusterName      string `json:"ClusterName"`
	NodePoolName     string `json:"NodePoolName"`
	Number           int32  `json:"Number"`
	InstanceSpecName string `json:"InstanceSpecName"`
	VpcID            string `json:"VpcID"`
	InstanceName     string `json:"InstanceName"`
	InstanceCategory string `json:"InstanceCategory"`
	MasterInstanceId string `json:"MasterInstanceId"`
	ChargeType       string `json:"ChargeType"`
	RequestSource    string `json:"RequestSource"`
}

createInstance

type CreateInstanceResp

type CreateInstanceResp struct {
	InstanceID string
}

type ModifyDatabaseOwnerReq

type ModifyDatabaseOwnerReq struct {
	InstanceId string `json:"InstanceId"`
	Owner      string `json:"Owner"`
	DBName     string `json:"DBName"`
}

type RdsPostgresql

type RdsPostgresql struct {
	*base.Client
}

func NewInstance

func NewInstance(region string) *RdsPostgresql

func (*RdsPostgresql) CreateAccount

func (p *RdsPostgresql) CreateAccount(req *CreateAccountReq) (*base.CommonResponse, error)

Create account

func (*RdsPostgresql) CreateDBInstanceIPList

func (p *RdsPostgresql) CreateDBInstanceIPList(req *CreateDBInstanceIPListReq) (*base.CommonResponse, error)

Create instance IP white list

func (*RdsPostgresql) CreateDatabase

func (p *RdsPostgresql) CreateDatabase(req *CreateDatabaseReq) (*base.CommonResponse, error)

Create account

func (*RdsPostgresql) CreateInstance

func (p *RdsPostgresql) CreateInstance(req *CreateInstanceReq) (*CreateInstanceResp, error)

Create instance

func (*RdsPostgresql) CreateROInstance

func (p *RdsPostgresql) CreateROInstance(req *CreateInstanceReq) (*CreateInstanceResp, error)

Create instance

func (*RdsPostgresql) ModifyDatabaseOwner

func (p *RdsPostgresql) ModifyDatabaseOwner(req *ModifyDatabaseOwnerReq) (*base.CommonResponse, error)

Modify database owner

func (*RdsPostgresql) SetRegion

func (p *RdsPostgresql) SetRegion(region string) error

type SchemaInfo

type SchemaInfo struct {
	SchemaName string `json:"SchemaName"`
	DBName     string `json:"DBName"`
	Owner      string `json:"Owner"`
}

Jump to

Keyboard shortcuts

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