scs

package
v0.9.44 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Overview

Package scs defines the SCS services of BCE. The supported APIs are all defined in sub-package

scs.go - the SCS for Redis APIs definition supported by the redis service

util.go - define the utilities for api package of SCS service

Index

Constants

View Source
const (
	INSTANCE_URL_V1 = bce.URI_PREFIX + "v1" + "/instance"
	INSTANCE_URL_V2 = bce.URI_PREFIX + "v2" + "/instance"
)
View Source
const (
	DEFAULT_ENDPOINT = "redis." + bce.DEFAULT_REGION + ".baidubce.com"
)

Variables

This section is empty.

Functions

func Aes128EncryptUseSecreteKey added in v0.9.27

func Aes128EncryptUseSecreteKey(sk string, data string) (string, error)

Types

type BackupInfo added in v0.9.31

type BackupInfo struct {
	BackupType string         `json:"backupType"`
	Comment    string         `json:"comment"`
	StartTime  string         `json:"startTime"`
	Records    []BackupRecord `json:"records"`
}

type BackupRecord added in v0.9.31

type BackupRecord struct {
	BackupRecordId string `json:"backupRecordId"`
	BackupStatus   string `json:"backupStatus"`
	Duration       string `json:"duration"`
	ObjectSize     string `json:"objectSize"`
	ShardName      string `json:"shardName"`
	StartTime      string `json:"startTime"`
}

type Billing

type Billing struct {
	PaymentTiming string       `json:"paymentTiming"`
	Reservation   *Reservation `json:"reservation,omitempty"`
}

type BindingTagArgs added in v0.9.27

type BindingTagArgs struct {
	ChangeTags []model.TagModel `json:"changeTags"`
}

type Client

type Client struct {
	*bce.BceClient
}

Client of SCS service is a kind of BceClient, so derived from BceClient

func NewClient

func NewClient(ak, sk, endPoint string) (*Client, error)

func (*Client) AddSecurityIp added in v0.9.27

func (c *Client) AddSecurityIp(instanceId string, args *SecurityIpArgs) error

AddSecurityIp - add securityIp to access a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • args: the arguments to add securityIp

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) BindingTag added in v0.9.27

func (c *Client) BindingTag(instanceId string, args *BindingTagArgs) error

BindingTags - bind tags to a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • args: the arguments to bind tags to instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) CreateInstance

func (c *Client) CreateInstance(args *CreateInstanceArgs) (*CreateInstanceResult, error)

CreateInstance - create an instance with specified parameters

PARAMS:

  • cli: the client agent which can perform sending request
  • reqBody: the request body to create instance

RETURNS:

  • *CreateInstanceResult: result of the instance ids newly created
  • error: nil if success otherwise the specific error

func (*Client) DeleteInstance

func (c *Client) DeleteInstance(instanceId string, clientToken string) error

DeleteInstance - delete a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance to be deleted

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteSecurityIp added in v0.9.27

func (c *Client) DeleteSecurityIp(instanceId string, args *SecurityIpArgs) error

DeleteSecurityIp - delete securityIp to access a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • args: the arguments to delete securityIp

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) FlushInstance added in v0.9.27

func (c *Client) FlushInstance(instanceId string, args *FlushInstanceArgs) error

FlushInstance - flush a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • args: the arguments to flush instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetBackupList added in v0.9.27

func (c *Client) GetBackupList(instanceId string) (*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) GetInstanceDetail

func (c *Client) GetInstanceDetail(instanceId string) (*GetInstanceDetailResult, error)

GetInstanceDetail - get details of the specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance

RETURNS:

  • *GetInstanceDetailResult: result of the instance details
  • error: nil if success otherwise the specific error

func (*Client) GetNodeTypeList

func (c *Client) GetNodeTypeList() (*GetNodeTypeListResult, error)

GetNodeTypeList - list all nodetype

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance to be deleted
  • args: the arguments to Update instanceName

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetParameters added in v0.9.27

func (c *Client) GetParameters(instanceId string) (*GetParametersResult, error)

GetParameters - query the configuration parameters and running parameters of redis instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance

RETURNS:

  • *GetParameterResult: result of the parameters
  • error: nil if success otherwise the specific error

func (*Client) GetSecurityIp added in v0.9.27

func (c *Client) GetSecurityIp(instanceId string) (*GetSecurityIpResult, error)

GetSecurityIp - list all securityIps

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance

RETURNS:

  • *ListSecurityIp: result of the security IP list
  • error: nil if success otherwise the specific error

func (*Client) GetZoneList added in v0.9.27

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) ListInstances

func (c *Client) ListInstances(args *ListInstancesArgs) (*ListInstancesResult, error)

ListInstances - list all instances with the specified parameters

PARAMS:

  • cli: the client agent which can perform sending request
  • args: the arguments to list instances

RETURNS:

  • *ListInstanceResult: result of the instance list
  • error: nil if success otherwise the specific error

func (*Client) ListSubnets added in v0.9.27

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 added in v0.9.27

func (c *Client) ModifyBackupPolicy(instanceId string, args *ModifyBackupPolicyArgs) error

ModifyBackupPolicy - modify the BackupPolicy of a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • args: the arguments to Modify BackupPolicy

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ModifyParameters added in v0.9.27

func (c *Client) ModifyParameters(instanceId string, args *ModifyParametersArgs) error

ModifyParameters - modify the parameters of a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • args: the arguments to modify parameters

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ModifyPassword added in v0.9.27

func (c *Client) ModifyPassword(instanceId string, args *ModifyPasswordArgs) error

ModifyPassword - modify the password of a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • args: the arguments to Modify Password

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ResizeInstance

func (c *Client) ResizeInstance(instanceId string, args *ResizeInstanceArgs) error

ResizeInstance - resize a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance to be resized
  • reqBody: the request body to resize instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UnBindingTag added in v0.9.27

func (c *Client) UnBindingTag(instanceId string, args *BindingTagArgs) error

UnBindingTags - unbind tags to a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • args: the arguments to unbind tags to instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateInstanceDomainName added in v0.9.27

func (c *Client) UpdateInstanceDomainName(instanceId string, args *UpdateInstanceDomainNameArgs) error

UpdateInstanceDomainName - update name of a specified instance domain

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • args: the arguments to update domainName

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 to be deleted
  • args: the arguments to Update instanceName

RETURNS:

  • error: nil if success otherwise the specific error

type CreateInstanceArgs

type CreateInstanceArgs struct {
	Billing           Billing  `json:"billing"`
	PurchaseCount     int      `json:"purchaseCount"`
	InstanceName      string   `json:"instanceName"`
	NodeType          string   `json:"nodeType"`
	ShardNum          int      `json:"shardNum"`
	ProxyNum          int      `json:"proxyNum"`
	ClusterType       string   `json:"clusterType"`
	ReplicationNum    int      `json:"replicationNum"`
	Port              int      `json:"port"`
	EngineVersion     string   `json:"engineVersion"`
	VpcID             string   `json:"vpcId"`
	Subnets           []Subnet `json:"subnets,omitempty"`
	AutoRenewTimeUnit string   `json:"autoRenewTimeUnit,omitempty"`
	AutoRenewTime     int      `json:"autoRenewTime,omitempty"`
	ClientToken       string   `json:"-"`
}

type CreateInstanceResult

type CreateInstanceResult struct {
	InstanceIds []string `json:"instanceIds"`
}

type FlushInstanceArgs added in v0.9.27

type FlushInstanceArgs struct {
	Password    string `json:"password"`
	ClientToken string `json:"-"`
}

type GetBackupListResult added in v0.9.27

type GetBackupListResult struct {
	TotalCount string       `json:"totalCount"`
	Backups    []BackupInfo `json:"backups"`
}

type GetInstanceDetailResult

type GetInstanceDetailResult struct {
	InstanceID         string           `json:"instanceId"`
	InstanceName       string           `json:"instanceName"`
	InstanceStatus     string           `json:"instanceStatus"`
	ClusterType        string           `json:"clusterType"`
	Engine             string           `json:"engine"`
	EngineVersion      string           `json:"engineVersion"`
	VnetIP             string           `json:"vnetIp"`
	Domain             string           `json:"domain"`
	Port               int              `json:"port"`
	InstanceCreateTime string           `json:"instanceCreateTime"`
	InstanceExpireTime string           `json:"instanceExpireTime"`
	Capacity           int              `json:"capacity"`
	UsedCapacity       float64          `json:"usedCapacity"`
	PaymentTiming      string           `json:"paymentTiming"`
	VpcID              string           `json:"vpcId"`
	ZoneNames          []string         `json:"zoneNames"`
	Subnets            []Subnet         `json:"subnets"`
	AutoRenew          string           `json:"autoRenew"`
	Tags               []model.TagModel `json:"tags"`
}

type GetNodeTypeListResult

type GetNodeTypeListResult struct {
	ClusterNodeTypeList []NodeType `json:"clusterNodeTypeList"`
	DefaultNodeTypeList []NodeType `json:"defaultNodeTypeList"`
	HsdbNodeTypeList    []NodeType `json:"hsdbNodeTypeList"`
}

type GetParametersResult added in v0.9.27

type GetParametersResult struct {
	Parameters []Parameter `json:"parameters"`
}

type GetSecurityIpResult added in v0.9.27

type GetSecurityIpResult struct {
	SecurityIps []string `json:"securityIps"`
}

type GetZoneListResult added in v0.9.27

type GetZoneListResult struct {
	Zones []ZoneNames `json:"zones"`
}

type InstanceModel

type InstanceModel struct {
	InstanceID         string           `json:"instanceId"`
	InstanceName       string           `json:"instanceName"`
	InstanceStatus     string           `json:"instanceStatus"`
	ClusterType        string           `json:"clusterType"`
	Engine             string           `json:"engine"`
	EngineVersion      string           `json:"engineVersion"`
	VnetIP             string           `json:"vnetIp"`
	Domain             string           `json:"domain"`
	Port               int              `json:"port"`
	InstanceCreateTime string           `json:"instanceCreateTime"`
	Capacity           int              `json:"capacity"`
	UsedCapacity       float64          `json:"usedCapacity"`
	PaymentTiming      string           `json:"paymentTiming"`
	ZoneNames          []string         `json:"zoneNames"`
	Tags               []model.TagModel `json:"tags"`
}

type InstanceParam added in v0.9.27

type InstanceParam struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ListInstancesArgs

type ListInstancesArgs struct {
	Marker  string
	MaxKeys int
}

type ListInstancesResult

type ListInstancesResult struct {
	Marker      string          `json:"marker"`
	IsTruncated bool            `json:"isTruncated"`
	NextMarker  string          `json:"nextMarker"`
	MaxKeys     int             `json:"maxKeys"`
	Instances   []InstanceModel `json:"instances"`
}

type ListSubnetsArgs added in v0.9.27

type ListSubnetsArgs struct {
	VpcID    string `json:"vpcId"`
	ZoneName string `json:"zoneName"`
}

type ListSubnetsResult added in v0.9.27

type ListSubnetsResult struct {
	SubnetOriginals []SubnetOriginal `json:"subnets"`
}

type ModifyBackupPolicyArgs added in v0.9.27

type ModifyBackupPolicyArgs struct {
	BackupDays  string `json:"backupDays"`
	BackupTime  string `json:"backupTime"`
	ClientToken string `json:"clientToken"`
	ExpireDay   int    `json:"expireDay"`
}

type ModifyParametersArgs added in v0.9.27

type ModifyParametersArgs struct {
	Parameter   InstanceParam `json:"parameter"`
	ClientToken string        `json:"-"`
}

type ModifyPasswordArgs added in v0.9.27

type ModifyPasswordArgs struct {
	Password    string `json:"password"`
	ClientToken string `json:"-"`
}

type NodeType

type NodeType struct {
	InstanceFlavor          int     `json:"instanceFlavor"`
	NodeType                string  `json:"nodeType"`
	CPUNum                  int     `json:"cpuNum"`
	NetworkThroughputInGbps float64 `json:"networkThroughputInGbps"`
	PeakQPS                 int     `json:"peakQps"`
	MaxConnections          int     `json:"maxConnections"`
	AllowedNodeNumList      []int   `json:"allowedNodeNumList"`
}

type Parameter added in v0.9.27

type Parameter struct {
	Default      string `json:"default"`
	ForceRestart int    `json:"forceRestart"`
	Name         string `json:"name"`
	Value        string `json:"value"`
}

type Reservation

type Reservation struct {
	ReservationLength   int    `json:"reservationLength"`
	ReservationTimeUnit string `json:"reservationTimeUnit"`
}

type ResizeInstanceArgs

type ResizeInstanceArgs struct {
	NodeType    string `json:"nodeType"`
	ShardNum    int    `json:"shardNum"`
	ClientToken string `json:"-"`
}

type SecurityIpArgs added in v0.9.27

type SecurityIpArgs struct {
	SecurityIps []string `json:"securityIps"`
	ClientToken string   `json:"-"`
}

type Subnet

type Subnet struct {
	ZoneName string `json:"zoneName"`
	SubnetID string `json:"subnetId"`
}

type SubnetOriginal added in v0.9.27

type SubnetOriginal struct {
	Name     string `json:"name"`
	SubnetID string `json:"subnetId"`
	ZoneName string `json:"zoneName"`
	Cidr     string `json:"cidr"`
	VpcID    string `json:"vpcId"`
}

type UpdateInstanceDomainNameArgs added in v0.9.27

type UpdateInstanceDomainNameArgs struct {
	Domain      string `json:"domain"`
	ClientToken string `json:"-"`
}

type UpdateInstanceNameArgs

type UpdateInstanceNameArgs struct {
	InstanceName string `json:"instanceName"`
	ClientToken  string `json:"-"`
}

type ZoneNames added in v0.9.31

type ZoneNames struct {
	ZoneNames []string `json:"zoneNames"`
}

Jump to

Keyboard shortcuts

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