bbc

package
v0.9.12 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 9 Imported by: 8

Documentation

Overview

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

Package bbc defines all APIs supported by the BBC service of BCE.

Package defines all APIs supported by the BBC service of BCE.

Package bbc defines all APIs supported by the BBC service of BCE.

Package bbc defines all APIs supported by the BBC service of BCE.

Package bbc defines all APIs supported by the BBC service of BCE.

Package bbc defines all APIs supported by the BBC service of BCE.

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

Index

Constants

View Source
const (
	URI_PREFIX_V1 = bce.URI_PREFIX + "v1"
	URI_PREFIX_V2 = bce.URI_PREFIX + "v2"

	REQUEST_INSTANCE_URI = "/instance"
	REQUEST_SUBNET_URI   = "/vpcSubnet"

	REQUEST_IMAGE_URI      = "/image"
	REQUEST_BATCHADDIP_URI = "/batchAddIp"
	REQUEST_BATCHDELIP_URI = "/batchDelIp"

	REQUEST_FLAVOR_URI      = "/flavor"
	REQUEST_FLAVOR_RAID_URI = "/flavorRaid"

	REQUEST_OPERATION_LOG_URI = "/operationLog"

	REQUEST_DEPLOY_SET_URI = "/deployset"
)
View Source
const DEFAULT_SERVICE_DOMAIN = "bbc." + bce.DEFAULT_REGION + ".baidubce.com"

Variables

This section is empty.

Functions

func Aes128EncryptUseSecreteKey added in v0.9.8

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

func BatchAddIp added in v0.9.8

func BatchAddIp(cli bce.Client, reqBody *bce.Body) error

BatchAddIp - Add ips to instance

PARAMS:

  • cli: the client agent which can perform sending request
  • reqBody: http request body

RETURNS:

  • error: nil if success otherwise the specific error

func BatchDelIp added in v0.9.8

func BatchDelIp(cli bce.Client, reqBody *bce.Body) error

BatchDelIp - Delete ips of instance

PARAMS:

  • cli: the client agent which can perform sending request
  • reqBody: http request body

RETURNS:

  • error: nil if success otherwise the specific error

func DeleteDeploySet added in v0.9.8

func DeleteDeploySet(cli bce.Client, deploySetId string) error

DeleteDeploySet - delete a deploy set

PARAMS:

  • cli: the client agent which can perform sending request
  • deploySetId: the id of the deploy set

RETURNS:

  • error: nil if success otherwise the specific error

func DeleteImage added in v0.9.8

func DeleteImage(cli bce.Client, imageId string) error

DeleteImage - delete an image

PARAMS:

  • cli: the client agent which can perform sending request
  • imageId: the specific image ID

RETURNS:

  • error: nil if success otherwise the specific error

func DeleteInstance added in v0.9.8

func DeleteInstance(cli bce.Client, instanceId string) error

DeleteInstance - delete a bbc instance

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func ModifyInstanceDesc added in v0.9.8

func ModifyInstanceDesc(cli bce.Client, instanceId string, reqBody *bce.Body) error

ModifyInstanceDesc - modify a bbc instance desc

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func ModifyInstanceName added in v0.9.8

func ModifyInstanceName(cli bce.Client, instanceId string, reqBody *bce.Body) error

ModifyInstanceName - modify a bbc instance name

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func ModifyInstancePassword added in v0.9.8

func ModifyInstancePassword(cli bce.Client, instanceId string, reqBody *bce.Body) error

ModifyInstancePassword - modify a bbc instance password

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func RebootInstance added in v0.9.8

func RebootInstance(cli bce.Client, instanceId string, reqBody *bce.Body) error

RebootInstance - reboot a bbc instance

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func RebuildInstance added in v0.9.8

func RebuildInstance(cli bce.Client, instanceId string, reqBody *bce.Body) error

RebuildInstance - rebuild a bbc instance

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func StartInstance added in v0.9.8

func StartInstance(cli bce.Client, instanceId string) error

StartInstance - start a bbc instance

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func StopInstance added in v0.9.8

func StopInstance(cli bce.Client, instanceId string, reqBody *bce.Body) error

StopInstance - stop a bbc instance

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func UnbindTags added in v0.9.8

func UnbindTags(cli bce.Client, instanceId string, reqBody *bce.Body) error

UnbindTags - unbind a bbc instance tags

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

Types

type BatchAddIpArgs added in v0.9.8

type BatchAddIpArgs struct {
	InstanceId string   `json:"instanceId"`
	PrivateIps []string `json:"privateIps"`
}

type BatchDelIpArgs added in v0.9.8

type BatchDelIpArgs struct {
	InstanceId string   `json:"instanceId"`
	PrivateIps []string `json:"privateIps"`
}

type BbcNetworkModel added in v0.9.8

type BbcNetworkModel struct {
	BbcId  string      `json:"bbcId"`
	Vpc    VpcModel    `json:"vpc"`
	Subnet SubnetModel `json:"subnet"`
}

type Billing added in v0.9.8

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

type Client

type Client struct {
	*bce.BceClient
}

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

func NewClient

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

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

func (*Client) BatchAddIP added in v0.9.8

func (c *Client) BatchAddIP(args *BatchAddIpArgs) error

BatchAddIP - Add ips to instance

PARAMS:

  • args: the arguments to add ips to bbc instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) BatchDelIP added in v0.9.8

func (c *Client) BatchDelIP(args *BatchDelIpArgs) error

BatchDelIP - Delete ips of instance

PARAMS:

  • args: the arguments to add ips to bbc instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) CreateDeploySet

func (c *Client) CreateDeploySet(args *CreateDeploySetArgs) (*CreateDeploySetResult, error)

CreateDeploySet - create a deploy set

PARAMS:

  • args: the arguments to create a deploy set

RETURNS:

  • *CreateDeploySetResult: results of creating a deploy set
  • error: nil if success otherwise the specific error

func (*Client) CreateImageFromInstanceId

func (c *Client) CreateImageFromInstanceId(args *CreateImageArgs) (*CreateImageResult, error)

CreateImageFromInstanceId - create image from specified instance

PARAMS:

  • args: the arguments to create image

RETURNS:

  • *CreateImageResult: the result of create Image
  • error: nil if success otherwise the specific error

func (*Client) CreateInstance

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

CreateInstance - create an instance with the specific parameters

PARAMS:

  • args: the arguments to create instance

RETURNS:

  • *CreateInstanceResult: the result of create Instance, contains new Instance ID
  • error: nil if success otherwise the specific error

func (*Client) DeleteDeploySet

func (c *Client) DeleteDeploySet(deploySetId string) error

DeleteDeploySet - delete a deploy set

PARAMS:

  • deploySetId: the id of the deploy set

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteImage

func (c *Client) DeleteImage(imageId string) error

DeleteImage - delete an image

PARAMS:

  • imageId: the specific image ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteInstance added in v0.9.8

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

DeleteInstance - delete an instance

PARAMS:

  • instanceId: the specific instance ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetDeploySet

func (c *Client) GetDeploySet(deploySetId string) (*GetDeploySetResult, error)

GetDeploySet - get details of the deploy set

PARAMS:

  • deploySetId: the id of the deploy set

RETURNS:

  • *GetDeploySetResult: the detail of the deploy set
  • error: nil if success otherwise the specific error

func (*Client) GetFlavorDetail

func (c *Client) GetFlavorDetail(flavorId string) (*GetFlavorDetailResult, error)

GetFlavorDetail - get details of the specified flavor

PARAMS:

  • flavorId: the id of the flavor

RETURNS:

  • *GetFlavorDetailResult: the detail of the specified flavor
  • error: nil if success otherwise the specific error

func (*Client) GetFlavorRaid

func (c *Client) GetFlavorRaid(flavorId string) (*GetFlavorRaidResult, error)

GetFlavorRaid - get the RAID detail and disk size of the specified flavor

PARAMS:

  • flavorId: the id of the flavor

RETURNS:

  • *GetFlavorRaidResult: the detail of the raid of the specified flavor
  • error: nil if success otherwise the specific error

func (*Client) GetImageDetail

func (c *Client) GetImageDetail(imageId string) (*GetImageDetailResult, error)

GetImageDetail - get an image's detail info

PARAMS:

  • imageId: the specific image ID

RETURNS:

  • *GetImageDetailResult: the result of get image's detail
  • error: nil if success otherwise the specific error

func (*Client) GetInstanceDetail

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

GetInstanceDetail - get a specific instance detail info

PARAMS:

  • instanceId: the specific instance ID

RETURNS:

  • *GetInstanceDetailResult: the result of get instance detail info
  • error: nil if success otherwise the specific error

func (*Client) GetOperationLog

func (c *Client) GetOperationLog(args *GetOperationLogArgs) (*GetOperationLogResult, error)

GetOperationLog - get operation log

PARAMS:

  • args: the arguments to get operation log

RETURNS:

  • *GetOperationLogResult: results of getting operation log
  • error: nil if success otherwise the specific error

func (*Client) GetVpcSubnet

func (c *Client) GetVpcSubnet(args *GetVpcSubnetArgs) (*GetVpcSubnetResult, error)

GetVpcSubnet - get multi instances vpc and subnet

PARAMS:

  • args: the instanceId of bbc instances

RETURNS:

  • *GetVpcSubnetResult: result of vpc and subnet
  • error: nil if success otherwise the specific error

func (*Client) ListDeploySets

func (c *Client) ListDeploySets() (*ListDeploySetsResult, error)

ListDeploySets - list all deploy sets

RETURNS:

  • *ListDeploySetsResult: the result of list all deploy sets
  • error: nil if success otherwise the specific error

func (*Client) ListFlavors

func (c *Client) ListFlavors() (*ListFlavorsResult, error)

ListFlavors - list all available flavors

RETURNS:

  • *ListFlavorsResult: the result of list all flavors
  • error: nil if success otherwise the specific error

func (*Client) ListImage

func (c *Client) ListImage(args *ListImageArgs) (*ListImageResult, error)

ListImage - list all images

PARAMS:

  • args: the arguments to list all images

RETURNS:

  • *ListImageResult: the result of list all images
  • error: nil if success otherwise the specific error

func (*Client) ListInstances

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

ListInstances - list all instance with the specific parameters

PARAMS:

  • args: the arguments to list all instance

RETURNS:

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

func (*Client) ModifyInstanceDesc

func (c *Client) ModifyInstanceDesc(instanceId string, args *ModifyInstanceDescArgs) error

ModifyInstanceDesc - modify an instance's description

PARAMS:

  • instanceId: the specific instance ID
  • args: the arguments of now instance's description

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ModifyInstanceName

func (c *Client) ModifyInstanceName(instanceId string, args *ModifyInstanceNameArgs) error

ModifyInstanceName - modify an instance's name

PARAMS:

  • instanceId: the specific instance ID
  • args: the arguments of now instance's name

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ModifyInstancePassword

func (c *Client) ModifyInstancePassword(instanceId string, args *ModifyInstancePasswordArgs) error

ModifyInstancePassword - modify an instance's password

PARAMS:

  • instanceId: the specific instance ID
  • args: the arguments of now instance's password

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) RebootInstance

func (c *Client) RebootInstance(instanceId string, forceStop bool) error

RebootInstance - restart an instance

PARAMS:

  • instanceId: the specific instance ID
  • forceStop: choose to force stop an instance or not

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) RebuildInstance

func (c *Client) RebuildInstance(instanceId string, isPreserveData bool, args *RebuildInstanceArgs) error

RebuildInstance - rebuild an instance

PARAMS:

  • instanceId: the specific instance ID
  • isPreserveData: choose to preserve data or not
  • args: the arguments to rebuild an instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) StartInstance

func (c *Client) StartInstance(instanceId string) error

StartInstance - start an instance

PARAMS:

  • instanceId: the specific instance ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) StopInstance

func (c *Client) StopInstance(instanceId string, forceStop bool) error

StopInstance - stop an instance

PARAMS:

  • instanceId: the specific instance ID
  • forceStop: choose to force stop an instance or not

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UnbindTags

func (c *Client) UnbindTags(instanceId string, args *UnbindTagsArgs) error

UnbindTags - unbind an instance tags

PARAMS:

  • instanceId: the id of the instance
  • args: tags of an instance to unbind

RETURNS:

  • error: nil if success otherwise the specific error

type CreateDeploySetArgs added in v0.9.8

type CreateDeploySetArgs struct {
	Strategy    string `json:"strategy"`
	Concurrency int    `json:"concurrency"`
	Name        string `json:"name,omitempty"`
	Desc        string `json:"desc,omitempty"`
	ClientToken string `json:"-"`
}

type CreateDeploySetResult added in v0.9.8

type CreateDeploySetResult struct {
	DeploySetId string `json:"deploySetId"`
}

func CreateDeploySet added in v0.9.8

func CreateDeploySet(cli bce.Client, clientToken string, reqBody *bce.Body) (*CreateDeploySetResult, error)

CreateDeploySet - create a deploy set

PARAMS:

  • cli: the client agent which can perform sending request
  • clientToken: idempotent token, an ASCII string no longer than 64 bits
  • reqBody: http request body

RETURNS:

  • *CreateDeploySetResult: results of creating a deploy set
  • error: nil if success otherwise the specific error

type CreateImageArgs added in v0.9.8

type CreateImageArgs struct {
	ImageName   string `json:"imageName"`
	InstanceId  string `json:"instanceId"`
	ClientToken string `json:"-"`
}

type CreateImageResult added in v0.9.8

type CreateImageResult struct {
	ImageId string `json:"imageId"`
}

func CreateImageFromInstanceId added in v0.9.8

func CreateImageFromInstanceId(cli bce.Client, clientToken string, reqBody *bce.Body) (*CreateImageResult, error)

CreateImageFromInstanceId - create image from specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • clientToken: idempotent token, an ASCII string no longer than 64 bits
  • reqBody: http request body

RETURNS:

  • *CreateImageResult: the result of create Image
  • error: nil if success otherwise the specific error

type CreateInstanceArgs added in v0.9.8

type CreateInstanceArgs struct {
	FlavorId         string  `json:"flavorId"`
	ImageId          string  `json:"imageId"`
	RaidId           string  `json:"raidId"`
	RootDiskSizeInGb int     `json:"rootDiskSizeInGb"`
	PurchaseCount    int     `json:"purchaseCount"`
	ZoneName         string  `json:"zoneName"`
	SubnetId         string  `json:"subnetId"`
	Billing          Billing `json:"billing"`
	Name             string  `json:"name,omitempty"`
	AdminPass        string  `json:"adminPass,omitempty"`
	DeploySetId      string  `json:"deploySetId,omitempty"`
	ClientToken      string  `json:"-"`
	SecurityGroupId  string  `json:"securityGroupId,omitempty"`
}

type CreateInstanceResult added in v0.9.8

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

func CreateInstance added in v0.9.8

func CreateInstance(cli bce.Client, clientToken string, reqBody *bce.Body) (*CreateInstanceResult, error)

CreateInstance - create a bbc instance

PARAMS:

  • cli: the client agent which can perform sending request
  • clientToken: idempotent token, an ASCII string no longer than 64 bits
  • reqBody: http request body

RETURNS:

  • *CreateInstanceResult: results of creating a bbc instance
  • error: nil if success otherwise the specific error

type DeploySetModel added in v0.9.8

type DeploySetModel struct {
	Strategy     string   `json:"strategy"`
	InstanceList []string `json:"instanceList"`
	Concurrency  int      `json:"concurrency"`
	DeploySetId  string   `json:"deploySetId"`
}

type FlavorModel added in v0.9.8

type FlavorModel struct {
	FlavorId           string `json:"flavorID"`
	CpuCount           int    `json:"cpuCount"`
	CpuType            string `json:"cpuType"`
	MemoryCapacityInGB int    `json:"memoryCapacityInGb"`
	Disk               string `json:"disk"`
	NetworkCard        string `json:"networkCard"`
	Others             string `json:"others"`
}

type GetDeploySetResult added in v0.9.8

type GetDeploySetResult struct {
	DeploySetModel
}

func GetDeploySet added in v0.9.8

func GetDeploySet(cli bce.Client, deploySetId string) (*GetDeploySetResult, error)

GetDeploySet - get details of the deploy set

PARAMS:

  • cli: the client agent which can perform sending request
  • deploySetId: the id of the deploy set

RETURNS:

  • *GetDeploySetResult: the detail of the deploy set
  • error: nil if success otherwise the specific error

type GetFlavorDetailResult added in v0.9.8

type GetFlavorDetailResult struct {
	FlavorModel
}

func GetFlavorDetail added in v0.9.8

func GetFlavorDetail(cli bce.Client, flavorId string) (*GetFlavorDetailResult, error)

GetFlavorDetail - get details of the specified flavor

PARAMS:

  • cli: the client agent which can perform sending request
  • flavorId: the id of the flavor

RETURNS:

  • *GetFlavorDetailResult: the detail of the specified flavor
  • error: nil if success otherwise the specific error

type GetFlavorRaidResult added in v0.9.8

type GetFlavorRaidResult struct {
	FlavorId string      `json:"flavorId"`
	Raids    []RaidModel `json:"raids"`
}

func GetFlavorRaid added in v0.9.8

func GetFlavorRaid(cli bce.Client, flavorId string) (*GetFlavorRaidResult, error)

GetFlavorRaid - get the RAID detail and disk size of the specified flavor

PARAMS:

  • cli: the client agent which can perform sending request
  • flavorId: the id of the flavor

RETURNS:

  • *GetFlavorRaidResult: the detail of the raid of the specified flavor
  • error: nil if success otherwise the specific error

type GetImageDetailResult added in v0.9.8

type GetImageDetailResult struct {
	Image *ImageModel `json:"image"`
}

func GetImageDetail added in v0.9.8

func GetImageDetail(cli bce.Client, imageId string) (*GetImageDetailResult, error)

GetImageDetail - get an image's detail info

PARAMS:

  • cli: the client agent which can perform sending request
  • imageId: the specific image ID

RETURNS:

  • *GetImageDetailResult: the result of get image's detail
  • error: nil if success otherwise the specific error

type GetOperationLogArgs added in v0.9.8

type GetOperationLogArgs struct {
	Marker    string
	MaxKeys   int
	StartTime string
	EndTime   string
}

type GetOperationLogResult added in v0.9.8

type GetOperationLogResult struct {
	Marker        string              `json:"marker"`
	IsTruncated   bool                `json:"isTruncated"`
	NextMarker    string              `json:"nextMarker"`
	MaxKeys       int                 `json:"maxKeys"`
	OperationLogs []OperationLogModel `json:"operationLogs"`
}

func GetOperationLog added in v0.9.8

func GetOperationLog(cli bce.Client, args *GetOperationLogArgs) (*GetOperationLogResult, error)

GetOperationLog - get operation log

PARAMS:

  • cli: the client agent which can perform sending request
  • args: the arguments to get operation log

RETURNS:

  • *GetOperationLogResult: results of getting operation log
  • error: nil if success otherwise the specific error

type GetVpcSubnetArgs added in v0.9.8

type GetVpcSubnetArgs struct {
	BbcIds []string `json:"bbcIds"`
}

type GetVpcSubnetResult added in v0.9.8

type GetVpcSubnetResult struct {
	NetworkInfo []BbcNetworkModel `json:"networkInfo"`
}

func GetVpcSubnet added in v0.9.8

func GetVpcSubnet(cli bce.Client, reqBody *bce.Body) (*GetVpcSubnetResult, error)

GetVpcSubnet - get multi instances vpc and subnet

PARAMS:

  • cli: the client agent which can perform sending request
  • reqBody: http request body

RETURNS:

  • *GetVpcSubnetResult: result of vpc and subnet
  • error: nil if success otherwise the specific error

type ImageModel added in v0.9.8

type ImageModel struct {
	OsVersion      string      `json:"osVersion"`
	OsArch         string      `json:"osArch"`
	Status         ImageStatus `json:"status"`
	Desc           string      `json:"desc"`
	Id             string      `json:"id"`
	Name           string      `json:"name"`
	OsName         string      `json:"osName"`
	OsBuild        string      `json:"osBuild"`
	CreateTime     string      `json:"createTime"`
	Type           ImageType   `json:"type"`
	OsType         string      `json:"osType"`
	SpecialVersion string      `json:"specialVersion"`
}

type ImageStatus added in v0.9.8

type ImageStatus string
const (
	ImageStatusCreating     ImageStatus = "Creating"
	ImageStatusCreateFailed ImageStatus = "CreateFailed"
	ImageStatusAvailable    ImageStatus = "Available"
	ImageStatusNotAvailable ImageStatus = "NotAvailable"
	ImageStatusError        ImageStatus = "Error"
)

type ImageType added in v0.9.8

type ImageType string
const (
	ImageTypeIntegration ImageType = "Integration"
	ImageTypeSystem      ImageType = "System"
	ImageTypeCustom      ImageType = "Custom"
)

type InstanceModel added in v0.9.8

type InstanceModel struct {
	Id                    string           `json:"id"`
	Name                  string           `json:"name"`
	Desc                  string           `json:"desc"`
	Status                InstanceStatus   `json:"status"`
	PaymentTiming         string           `json:"paymentTiming"`
	CreateTime            string           `json:"createTime"`
	ExpireTime            string           `json:"expireTime"`
	PublicIp              string           `json:"publicIp"`
	InternalIp            string           `json:"internalIp"`
	ImageId               string           `json:"imageId"`
	FlavorId              string           `json:"flavorId"`
	Zone                  string           `json:"zone"`
	Region                string           `json:"region"`
	NetworkCapacityInMbps int              `json:"networkCapacityInMbps"`
	Tags                  []model.TagModel `json:"tags"`
}

func GetInstanceDetail added in v0.9.8

func GetInstanceDetail(cli bce.Client, instanceId string) (*InstanceModel, error)

GetInstanceDetail - get a bbc instance detail msg

PARAMS:

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

RETURNS:

  • *InstanceModel: instance detail msg
  • error: nil if success otherwise the specific error

type InstanceStatus added in v0.9.8

type InstanceStatus string
const (
	InstanceStatusRunning         InstanceStatus = "Running"
	InstanceStatusStarting        InstanceStatus = "Starting"
	InstanceStatusStopping        InstanceStatus = "Stopping"
	InstanceStatusStopped         InstanceStatus = "Stopped"
	InstanceStatusDeleted         InstanceStatus = "Deleted"
	InstanceStatusExpired         InstanceStatus = "Expired"
	InstanceStatusError           InstanceStatus = "Error"
	InstanceStatusImageProcessing InstanceStatus = "ImageProcessing"
)

type ListDeploySetsResult added in v0.9.8

type ListDeploySetsResult struct {
	DeploySetList []DeploySetModel `json:"deploySetList"`
}

func ListDeploySets added in v0.9.8

func ListDeploySets(cli bce.Client) (*ListDeploySetsResult, error)

ListDeploySets - list all deploy sets PARAMS:

  • cli: the client agent which can perform sending request

RETURNS:

  • *ListDeploySetsResult: the result of list all deploy sets
  • error: nil if success otherwise the specific error

type ListFlavorsResult added in v0.9.8

type ListFlavorsResult struct {
	Flavors []FlavorModel `json:"flavors"`
}

func ListFlavors added in v0.9.8

func ListFlavors(cli bce.Client) (*ListFlavorsResult, error)

ListFlavors - list all available flavors

PARAMS:

  • cli: the client agent which can perform sending request

RETURNS:

  • *ListFlavorsResult: the result of list all flavors
  • error: nil if success otherwise the specific error

type ListImageArgs added in v0.9.8

type ListImageArgs struct {
	Marker    string
	MaxKeys   int
	ImageType string
}

type ListImageResult added in v0.9.8

type ListImageResult struct {
	Marker      string       `json:"marker"`
	IsTruncated bool         `json:"isTruncated"`
	NextMarker  string       `json:"nextMarker"`
	MaxKeys     int          `json:"maxKeys"`
	Images      []ImageModel `json:"images"`
}

func ListImage added in v0.9.8

func ListImage(cli bce.Client, queryArgs *ListImageArgs) (*ListImageResult, error)

ListImage - list all images

PARAMS:

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

RETURNS:

  • *ListImageResult: the result of list all images
  • error: nil if success otherwise the specific error

type ListInstancesArgs added in v0.9.8

type ListInstancesArgs struct {
	Marker     string
	MaxKeys    int
	InternalIp string
}

type ListInstancesResult added in v0.9.8

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

func ListInstances added in v0.9.8

func ListInstances(cli bce.Client, args *ListInstancesArgs) (*ListInstancesResult, error)

ListInstances - list all bbc instances

PARAMS:

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

RETURNS:

  • *ListInstanceResult: results of list bbc instances
  • error: nil if success otherwise the specific error

type ModifyInstanceDescArgs added in v0.9.8

type ModifyInstanceDescArgs struct {
	Description string `json:"desc"`
}

type ModifyInstanceNameArgs added in v0.9.8

type ModifyInstanceNameArgs struct {
	Name string `json:"name"`
}

type ModifyInstancePasswordArgs added in v0.9.8

type ModifyInstancePasswordArgs struct {
	AdminPass string `json:"adminPass"`
}

type OperationLogModel added in v0.9.8

type OperationLogModel struct {
	OperationStatus bool   `json:"operationStatus"`
	OperationTime   string `json:"operationTime"`
	OperationDesc   string `json:"operationDesc"`
	OperationIp     string `json:"operationIp"`
}

type PaymentTimingType added in v0.9.8

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

type RaidModel added in v0.9.8

type RaidModel struct {
	RaidId       string `json:"raidId"`
	Raid         string `json:"raid"`
	SysSwapSize  int    `json:"sysSwapSize"`
	SysRootSize  int    `json:"sysRootSize"`
	SysHomeSize  int    `json:"sysHomeSize"`
	SysDiskSize  int    `json:"sysDiskSize"`
	DataDiskSize int    `json:"dataDiskSize"`
}

type RebuildInstanceArgs added in v0.9.8

type RebuildInstanceArgs struct {
	ImageId        string `json:"imageId"`
	AdminPass      string `json:"adminPass"`
	IsPreserveData bool   `json:"isPreserveData,omitempty"`
	RaidId         string `json:"raidId,omitempty"`
	SysRootSize    int    `json:"sysRootSize,omitempty"`
}

type Reservation added in v0.9.8

type Reservation struct {
	Length   int    `json:"reservationLength"`
	TimeUnit string `json:"reservationTimeUnit"`
}

type StopInstanceArgs added in v0.9.8

type StopInstanceArgs struct {
	ForceStop bool `json:"forceStop,omitempty"`
}

type SubnetModel added in v0.9.8

type SubnetModel struct {
	VpcId      string `json:"vpcId"`
	Name       string `json:"name"`
	SubnetType string `json:"subnetType"`
	SubnetId   string `json:"subnetId"`
	Cidr       string `json:"cidr"`
	ZoneName   string `json:"zoneName"`
}

type UnbindTagsArgs added in v0.9.8

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

type VpcModel added in v0.9.8

type VpcModel struct {
	VpcId       string `json:"vpcId"`
	Cidr        string `json:"cidr"`
	Name        string `json:"name"`
	IsDefault   bool   `json:"isDefault"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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