cbs

package
v0.0.0-...-d999168 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PayModePrePay           = "prePay"
	StorageTypeCloudBasic   = "cloudBasic"
	StorageTypeCloudPremium = "cloudPremium"
	StorageTypeCloudSSD     = "cloudSSD"

	DiskTypeRoot = "root"
	DiskTypeData = "data"

	StorageStatusNormal = "normal"

	RenewFlagAutoRenew               = "NOTIFY_AND_AUTO_RENEW"
	RenewFlagManulRenew              = "NOTIFY_AND_MANUAL_RENEW"
	RenewFlagManulRenewDisableNotify = "DISABLE_NOTIFY_AND_MANUAL_RENEW"
)
View Source
const (
	CbsHost = "cbs.api.qcloud.com"
	CbsPath = "/v2/index.php"
)
View Source
const (
	TaskCheckInterval = time.Second * 1

	TaskSuccceed = 0
	TaskFailed   = 1
	TaskRunning  = 2

	TaskStatusUnknown = 9
)

Variables

This section is empty.

Functions

func WaitUntilDone

func WaitUntilDone(do DoFunc, check Checker, client *Client) error

Types

type AttachCbsStorageArgs

type AttachCbsStorageArgs struct {
	StorageIds  []string `qcloud_arg:"storageIds"`
	UInstanceId string   `qcloud_arg:"uInstanceId"`
}

type AttachCbsStorageResponse

type AttachCbsStorageResponse struct {
	Response
	Detail map[string]SubAttachDetachTask `json:"detail"`
}

type Checker

type Checker func(info *StorageSet) (bool, error)

type Client

type Client struct {
	*common.Client
}

func NewClient

func NewClient(credential common.CredentialInterface, opts common.Opts) (*Client, error)

func NewClientFromEnv

func NewClientFromEnv() (*Client, error)

func (*Client) AttachCbsStorage

func (client *Client) AttachCbsStorage(storageIds []string, uInstanceId string) (*AttachCbsStorageResponse, error)

func (*Client) AttachCbsStorageTask

func (client *Client) AttachCbsStorageTask(storageId string, uInstanceId string) error

func (*Client) CreateCbsStorage

func (client *Client) CreateCbsStorage(args *CreateCbsStorageArgs) ([]string, error)

func (*Client) CreateCbsStorageTask

func (client *Client) CreateCbsStorageTask(args *CreateCbsStorageArgs) ([]string, error)

func (*Client) DescribeCbsStorage

func (client *Client) DescribeCbsStorage(args *DescribeCbsStorageArgs) (*DescribeCbsStorageResponse, error)

func (*Client) DetachCbsStorage

func (client *Client) DetachCbsStorage(storageIds []string) (*DetachCbsStorageResponse, error)

func (*Client) DetachCbsStorageTask

func (client *Client) DetachCbsStorageTask(storageId string) error

func (*Client) ModifyCbsRenewFlag

func (client *Client) ModifyCbsRenewFlag(storageIds []string, RenewFlag string) (*ModifyCbsRenewFlagResponse, error)

func (*Client) ModifyCbsStorageAttribute

func (client *Client) ModifyCbsStorageAttribute(storageId string, storageName string) (*ModifyCbsStorageAttribute, error)

func (*Client) TerminateCbsStorage

func (client *Client) TerminateCbsStorage(storageIds []string) (*TerminateCbsStorageResponse, error)

type CreateCbsStorageArgs

type CreateCbsStorageArgs struct {
	StorageType string `qcloud_arg:"storageType"`
	PayMode     string `qcloud_arg:"payMode"`
	StorageSize int    `qcloud_arg:"storageSize"`

	GoodsNum int    `qcloud_arg:"goodsNum"`
	Period   int    `qcloud_arg:"period"`
	Zone     string `qcloud_arg:"zone"`
}

type CreateCbsStorageResponse

type CreateCbsStorageResponse struct {
	Response
	StorageIds []string `json:"storageIds"`
}

type DescribeCbsStorageArgs

type DescribeCbsStorageArgs struct {
	StorageIds   *[]string `qcloud_arg:"storageIds"`
	UInstanceIds *[]string `qcloud_arg:"uInstanceIds"`

	DiskType *string `qcloud_arg:"diskType"`
	Portable *int    `qcloud_arg:"portable"`

	Offset *int `qcloud_arg:"offset"`
	Limit  *int `qcloud_arg:"limit"`
}

type DescribeCbsStorageResponse

type DescribeCbsStorageResponse struct {
	Response
	TotalCount int          `json:"totalCount"`
	StorageSet []StorageSet `json:"storageSet"`
}

type DetachCbsStorageArgs

type DetachCbsStorageArgs struct {
	StorageIds []string `qcloud_arg:"storageIds"`
}

type DetachCbsStorageResponse

type DetachCbsStorageResponse struct {
	Response
	Detail map[string]SubAttachDetachTask `json:"detail"`
}

type DoFunc

type DoFunc func() (string, error)

type ModifyCbsRenewFlagArgs

type ModifyCbsRenewFlagArgs struct {
	StorageIds []string `qcloud_arg:"storageIds"`
	RenewFlag  string   `qcloud_arg:"renewFlag"`
}

type ModifyCbsRenewFlagResponse

type ModifyCbsRenewFlagResponse struct {
	Response
}

type ModifyCbsStorageAttribute

type ModifyCbsStorageAttribute struct {
	Response
}

type ModifyCbsStorageAttributeArg

type ModifyCbsStorageAttributeArg struct {
	StorageId   string `qcloud_arg:"storageId"`
	StorageName string `qcloud_arg:"storageName"`
}

type Response

type Response struct {
	Code     int    `json:"code"`
	Message  string `json:"message"`
	CodeDesc string `json:"codeDesc"`
}

type Storage

type Storage struct {
	Client    *Client
	StorageId string
}

func NewStorage

func NewStorage(storageId string, client *Client) *Storage

func (Storage) GetInfo

func (s Storage) GetInfo() (*StorageSet, error)

type StorageSet

type StorageSet struct {
	StorageID       string `json:"storageId"`
	UInstanceID     string `json:"uInstanceId"`
	StorageName     string `json:"storageName"`
	ProjectID       int    `json:"projectId"`
	DiskType        string `json:"diskType"`
	StorageType     string `json:"storageType"`
	StorageStatus   string `json:"storageStatus"`
	ZoneID          int    `json:"zoneId"`
	CreateTime      string `json:"createTime"`
	StorageSize     int    `json:"storageSize"`
	SnapshotAbility int    `json:"snapshotAbility"`
	PayMode         string `json:"payMode"`
	Portable        int    `json:"portable"`
	Attached        int    `json:"attached"`
	DeadlineTime    string `json:"deadlineTime"`
	Rollbacking     int    `json:"rollbacking"`
	RollbackPercent int    `json:"rollbackPercent"`
	Zone            string `json:"zone"`
}

type SubAttachDetachTask

type SubAttachDetachTask struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

type TerminateCbsStorageArgs

type TerminateCbsStorageArgs struct {
	StorageIds []string `qcloud_arg:"storageIds"`
}

type TerminateCbsStorageResponse

type TerminateCbsStorageResponse struct {
	Response
	DealNames []string `json:"dealNames"`
}

Jump to

Keyboard shortcuts

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