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
Index ¶
- Constants
- type Billing
- type Client
- func (c *Client) CreateInstance(args *CreateInstanceArgs) (*CreateInstanceResult, error)
- func (c *Client) DeleteInstance(instanceId string, clientToken string) error
- func (c *Client) GetInstanceDetail(instanceId string) (*GetInstanceDetailResult, error)
- func (c *Client) GetNodeTypeList() (*GetNodeTypeListResult, error)
- func (c *Client) ListInstances(args *ListInstancesArgs) (*ListInstancesResult, error)
- func (c *Client) ResizeInstance(instanceId string, args *ResizeInstanceArgs) error
- func (c *Client) UpdateInstanceName(instanceId string, args *UpdateInstanceNameArgs) error
- type CreateInstanceArgs
- type CreateInstanceResult
- type GetInstanceDetailResult
- type GetNodeTypeListResult
- type InstanceModel
- type ListInstancesArgs
- type ListInstancesResult
- type NodeType
- type Reservation
- type ResizeInstanceArgs
- type Subnet
- type UpdateInstanceNameArgs
Constants ¶
const ( INSTANCE_URL_V1 = bce.URI_PREFIX + "v1" + "/instance" INSTANCE_URL_V2 = bce.URI_PREFIX + "v2" + "/instance" )
const (
DEFAULT_ENDPOINT = "redis." + bce.DEFAULT_REGION + ".baidubce.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Billing ¶
type Billing struct { PaymentTiming string `json:"paymentTiming"` Reservation *Reservation `json:"reservation,omitempty"` }
type Client ¶
Client of SCS service is a kind of BceClient, so derived from BceClient
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 ¶
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) 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) 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) 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) 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 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 int `json:"autoRenew"` Tags []model.TagModel `json:"tags"` }
type GetNodeTypeListResult ¶
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 ListInstancesArgs ¶
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 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"` }