dbsc

package
v0.9.164 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	URI_PREFIX_V2      = bce.URI_PREFIX + "v2"
	REQUEST_VOLUME_URI = "/volume"

	REQUEST_CREATE_URI            = "/cluster"
	REQUEST_AUTO_RENEW_URI        = "/cluster/autoRenew"
	REQUEST_CANCEL_AUTO_RENEW_URI = "/cluster/cancelAutoRenew"
)
View Source
const DEFAULT_SERVICE_DOMAIN = "bcc." + bce.DEFAULT_REGION + ".baidubce.com"

Variables

This section is empty.

Functions

func AutoRenewVolumeCluster

func AutoRenewVolumeCluster(cli bce.Client, args *AutoRenewVolumeClusterArgs) error

func CancelAutoRenewVolumeCluster

func CancelAutoRenewVolumeCluster(cli bce.Client, args *CancelAutoRenewVolumeClusterArgs) error

func PurchaseReservedVolumeCluster

func PurchaseReservedVolumeCluster(cli bce.Client, clusterId string, args *PurchaseReservedVolumeClusterArgs) error

func ResizeVolumeCluster

func ResizeVolumeCluster(cli bce.Client, clusterId string, args *ResizeVolumeClusterArgs) error

Types

type AutoRenewVolumeClusterArgs

type AutoRenewVolumeClusterArgs struct {
	ClusterId     string `json:"clusterId"`
	RenewTimeUnit string `json:"renewTimeUnit"`
	RenewTime     int    `json:"renewTime"`
}

type Billing

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

type CancelAutoRenewVolumeClusterArgs

type CancelAutoRenewVolumeClusterArgs struct {
	ClusterId string `json:"clusterId"`
}

type Client

type Client struct {
	*bce.BceClient
}

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

func NewClient

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

NewClient make the BCC service client with default configuration. Use `cli.Config.xxx` to access the config or change it to non-default value.

func (*Client) AutoRenewVolumeCluster

func (c *Client) AutoRenewVolumeCluster(args *AutoRenewVolumeClusterArgs) error

func (*Client) CancelAutoRenewVolumeCluster

func (c *Client) CancelAutoRenewVolumeCluster(args *CancelAutoRenewVolumeClusterArgs) error

func (*Client) CreateVolumeCluster

func (c *Client) CreateVolumeCluster(args *CreateVolumeClusterArgs) (*CreateVolumeClusterResult, error)

func (*Client) GetVolumeClusterDetail

func (c *Client) GetVolumeClusterDetail(clusterId string) (*VolumeClusterDetail, error)

func (*Client) ListVolumeCluster

func (c *Client) ListVolumeCluster(queryArgs *ListVolumeClusterArgs) (*ListVolumeClusterResult, error)

func (*Client) PurchaseReservedVolumeCluster

func (c *Client) PurchaseReservedVolumeCluster(clusterId string, args *PurchaseReservedVolumeClusterArgs) error

func (*Client) ResizeVolumeCluster

func (c *Client) ResizeVolumeCluster(clusterId string, args *ResizeVolumeClusterArgs) error

type CreateVolumeClusterArgs

type CreateVolumeClusterArgs struct {
	ZoneName        string      `json:"zoneName,omitempty"`
	ClusterName     string      `json:"clusterName,omitempty"`
	StorageType     StorageType `json:"storageType,omitempty"`
	ClusterSizeInGB int         `json:"clusterSizeInGB,omitempty"`
	PurchaseCount   int         `json:"purchaseCount,omitempty"`
	Billing         *Billing    `json:"billing"`
	RenewTimeUnit   string      `json:"renewTimeUnit"`
	RenewTime       int         `json:"renewTime"`
	UuidFlag        string      `json:"uuidFlag"`
}

type CreateVolumeClusterResult

type CreateVolumeClusterResult struct {
	ClusterIds   []string `json:"clusterIds"`
	ClusterUuids []string `json:"clusterUuids"`
}

type ListVolumeClusterArgs

type ListVolumeClusterArgs struct {
	Marker      string
	MaxKeys     int
	ClusterName string
	ZoneName    string
}

type ListVolumeClusterResult

type ListVolumeClusterResult struct {
	Marker      string               `json:"marker"`
	IsTruncated bool                 `json:"isTruncated"`
	NextMarker  string               `json:"nextMarker"`
	MaxKeys     int                  `json:"maxKeys"`
	Result      []VolumeClusterModel `json:"result"`
}

func ListVolumeCluster

func ListVolumeCluster(cli bce.Client, queryArgs *ListVolumeClusterArgs) (*ListVolumeClusterResult, error)

type PaymentTimingType

type PaymentTimingType string
const (
	PaymentTimingPrePaid  PaymentTimingType = "Prepaid"
	PaymentTimingPostPaid PaymentTimingType = "Postpaid"
)

type PurchaseReservedVolumeClusterArgs

type PurchaseReservedVolumeClusterArgs struct {
	Billing *Billing `json:"billing"`
}

type Reservation

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

type ResizeVolumeClusterArgs

type ResizeVolumeClusterArgs struct {
	NewClusterSizeInGB int `json:"newClusterSizeInGB"`
}

type StorageType

type StorageType string
const (
	StorageTypeHP1 StorageType = "hp1"
	StorageTypeHdd StorageType = "hdd"
)

type VolumeClusterDetail

type VolumeClusterDetail struct {
	ClusterId           string   `json:"clusterId"`
	ClusterName         string   `json:"clusterName"`
	CreatedTime         string   `json:"createdTime"`
	ExpiredTime         string   `json:"expiredTime"`
	Status              string   `json:"status"`
	ZoneName            string   `json:"logicalZone"`
	ProductType         string   `json:"productType"`
	ClusterType         string   `json:"clusterType"`
	TotalCapacity       int      `json:"totalCapacity"`
	UsedCapacity        int      `json:"usedCapacity"`
	AvailableCapacity   int      `json:"availableCapacity"`
	ExpandingCapacity   int      `json:"expandingCapacity"`
	CreatedVolumeNum    int      `json:"createdVolumeNum"`
	AffiliatedCDSNumber []string `json:"affiliatedCDSNumber"`
	EnableAutoRenew     bool     `json:"enableAutoRenew"`
	RenewTimeUnit       string   `json:"renewTimeUnit"`
	RenewTime           int      `json:"renewTime"`
}

func GetVolumeClusterDetail

func GetVolumeClusterDetail(cli bce.Client, clusterId string) (*VolumeClusterDetail, error)

type VolumeClusterModel

type VolumeClusterModel struct {
	ClusterId         string `json:"clusterId"`
	ClusterName       string `json:"clusterName"`
	CreatedTime       string `json:"createdTime"`
	ExpiredTime       string `json:"expiredTime"`
	Status            string `json:"status"`
	ZoneName          string `json:"logicalZone"`
	ProductType       string `json:"productType"`
	ClusterType       string `json:"clusterType"`
	TotalCapacity     int    `json:"totalCapacity"`
	UsedCapacity      int    `json:"usedCapacity"`
	AvailableCapacity int    `json:"availableCapacity"`
	ExpandingCapacity int    `json:"expandingCapacity"`
	CreatedVolumeNum  int    `json:"createdVolumeNum"`
	EnableAutoRenew   bool   `json:"enableAutoRenew"`
	RenewTimeUnit     string `json:"renewTimeUnit"`
	RenewTime         int    `json:"renewTime"`
}

Jump to

Keyboard shortcuts

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