bcc

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_SERVICE_DOMAIN = "bcc." + bce.DEFAULT_REGION + ".baidubce.com"

Variables

This section is empty.

Functions

This section is empty.

Types

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

func (c *Client) AttachAutoSnapshotPolicy(aspId string, args *api.AttachASPArgs) error

AttachAutoSnapshotPolicy - attach an ASP to volumes

PARAMS:

  • aspId: the specific auto snapshot policy ID
  • args: the arguments to attach an ASP

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) AttachCDSVolume

func (c *Client) AttachCDSVolume(volumeId string, args *api.AttachVolumeArgs) (*api.AttachVolumeResult, error)

AttachCDSVolume - attach a CDS volume to an instance

PARAMS:

  • volumeId: the specific CDS volume ID
  • args: the arguments to attach a CDS volume

RETURNS:

  • *api.AttachVolumeResult: the result of attach a CDS volume
  • error: nil if success otherwise the specific error

func (*Client) AuthorizeSecurityGroupRule

func (c *Client) AuthorizeSecurityGroupRule(securityGroupId string, args *api.AuthorizeSecurityGroupArgs) error

AuthorizeSecurityGroupRule - authorize a security group rule

PARAMS:

  • securityGroupId: the specific securityGroup ID
  • args: the arguments to authorize a security group rule

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) BindSecurityGroup

func (c *Client) BindSecurityGroup(instanceId string, securityGroupId string) error

BindSecurityGroup - bind a security group to an instance

PARAMS:

  • instanceId: the specific instance ID
  • securityGroupId: the security group ID which need to bind

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) CancelRemoteCopyImage

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

CancelRemoteCopyImage - cancel a copy image from other region operation

PARAMS:

  • imageId: the specific image ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ChangeInstancePass

func (c *Client) ChangeInstancePass(instanceId string, args *api.ChangeInstancePassArgs) error

ChangeInstancePass - change an instance's password

PARAMS:

  • instanceId: the specific instance ID
  • args: the arguments to change password

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) CreateAutoSnapshotPolicy

func (c *Client) CreateAutoSnapshotPolicy(args *api.CreateASPArgs) (*api.CreateASPResult, error)

CreateAutoSnapshotPolicy - create an auto snapshot policy

PARAMS:

  • args: the arguments to create an auto snapshot policy

RETURNS:

  • *api.CreateASPResult: the result of create an auto snapshot policy
  • error: nil if success otherwise the specific error

func (*Client) CreateCDSVolume

func (c *Client) CreateCDSVolume(args *api.CreateCDSVolumeArgs) (*api.CreateCDSVolumeResult, error)

cds sdk CreateCDSVolume - create a CDS volume

PARAMS:

  • args: the arguments to create CDS

RETURNS:

  • *api.CreateCDSVolumeResult: the result of create CDS volume, contains new volume ID
  • error: nil if success otherwise the specific error

func (*Client) CreateImage

func (c *Client) CreateImage(args *api.CreateImageArgs) (*api.CreateImageResult, error)

image sdk CreateImage - create an image

PARAMS:

  • args: the arguments to create image

RETURNS:

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

func (*Client) CreateInstance

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

CreateInstance - create an instance with the specific parameters

PARAMS:

  • args: the arguments to create instance

RETURNS:

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

func (*Client) CreateSecurityGroup

func (c *Client) CreateSecurityGroup(args *api.CreateSecurityGroupArgs) (*api.CreateSecurityGroupResult, error)

securityGroup sdk CreateSecurityGroup - create a security group

PARAMS:

  • args: the arguments to create security group

RETURNS:

  • *api.CreateSecurityGroupResult: the result of create security group
  • error: nil if success otherwise the specific error

func (*Client) CreateSnapshot

func (c *Client) CreateSnapshot(args *api.CreateSnapshotArgs) (*api.CreateSnapshotResult, error)

CreateSnapshot - create a snapshot

PARAMS:

  • args: the arguments to create a snapshot

RETURNS:

  • *api.CreateSnapshotResult: the result of create snapshot
  • error: nil if success otherwise the specific error

func (*Client) DeleteAutoSnapshotPolicy

func (c *Client) DeleteAutoSnapshotPolicy(aspId string) error

DeleteAutoSnapshotPolicy - delete an auto snapshot policy

PARAMS:

  • aspId: the specific auto snapshot policy ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteCDSVolume

func (c *Client) DeleteCDSVolume(volumeId string) error

DeleteCDSVolume - delete a CDS volume

PARAMS:

  • volumeId: the specific CDS volume ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteCDSVolumeNew

func (c *Client) DeleteCDSVolumeNew(volumeId string, args *api.DeleteCDSVolumeArgs) error

DeleteCDSVolumeNew - delete a CDS volume and snapshot

PARAMS:

  • volumeId: the specific CDS volume ID
  • args: the arguments to delete a CDS volume

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

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

DeleteInstance - delete a specific instance

PARAMS:

  • instanceId: the specific instance ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteInstanceWithRelateResource

func (c *Client) DeleteInstanceWithRelateResource(instanceId string, args *api.DeleteInstanceWithRelateResourceArgs) error

DeleteInstanceWithRelateResource - delete an instance and all eip/cds relate it

PARAMS:

  • instanceId: the specific instance ID
  • args: the arguments to delete instance and its relate resource

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteSecurityGroup

func (c *Client) DeleteSecurityGroup(securityGroupId string) error

DeleteSecurityGroup - delete a security group

PARAMS:

  • securityGroupId: the specific securityGroup ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DeleteSnapshot

func (c *Client) DeleteSnapshot(snapshotId string) error

DeleteSnapshot - delete a snapshot

PARAMS:

  • snapshotId: the specific snapshot ID

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DetachAutoSnapshotPolicy

func (c *Client) DetachAutoSnapshotPolicy(aspId string, args *api.DetachASPArgs) error

DetachAutoSnapshotPolicy - detach an ASP

PARAMS:

  • aspId: the specific auto snapshot policy ID
  • args: the arguments to detach an ASP

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) DetachCDSVolume

func (c *Client) DetachCDSVolume(volumeId string, args *api.DetachVolumeArgs) error

DetachCDSVolume - detach a CDS volume

PARAMS:

  • volumeId: the specific CDS volume ID
  • args: the arguments to detach a CDS volume

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) GetAutoSnapshotPolicy

func (c *Client) GetAutoSnapshotPolicy(aspId string) (*api.GetASPDetailResult, error)

GetAutoSnapshotPolicy - get an auto snapshot policy's meta

PARAMS:

  • aspId: the specific auto snapshot policy ID

RETURNS:

  • *api.GetASPDetailResult: the result of get an auto snapshot policy's meta
  • error: nil if success otherwise the specific error

func (*Client) GetCDSVolumeDetail

func (c *Client) GetCDSVolumeDetail(volumeId string) (*api.GetVolumeDetailResult, error)

GetCDSVolumeDetail - get a CDS volume's detail info

PARAMS:

  • volumeId: the specific CDS volume ID

RETURNS:

  • *api.GetVolumeDetailResult: the result of get a specific CDS volume's info
  • error: nil if success otherwise the specific error

func (*Client) GetImageDetail

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

GetImageDetail - get an image's detail info

PARAMS:

  • imageId: the specific image ID

RETURNS:

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

func (*Client) GetImageOS

func (c *Client) GetImageOS(args *api.GetImageOsArgs) (*api.GetImageOsResult, error)

GetImageOS - get image OS

PARAMS:

  • args: the arguments to get OS info

RETURNS:

  • *api.GetImageOsResult: the result of get image OS info
  • error: nil if success otherwise the specific error

func (*Client) GetImageSharedUser

func (c *Client) GetImageSharedUser(imageId string) (*api.GetImageSharedUserResult, error)

GetImageSharedUser - get user list use this image

PARAMS:

  • imageId: the specific image ID

RETURNS:

  • *api.GetImageSharedUserResult: the result of user list
  • error: nil if success otherwise the specific error

func (*Client) GetInstanceDetail

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

GetInstanceDetail - get a specific instance detail info

PARAMS:

  • instanceId: the specific instance ID

RETURNS:

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

func (*Client) GetInstanceVNC

func (c *Client) GetInstanceVNC(instanceId string) (*api.GetInstanceVNCResult, error)

GetInstanceVNC - get an instance's VNC url

PARAMS:

  • instanceId: the specific instance ID

RETURNS:

  • *api.GetInstanceVNCResult: the result of get instance's VNC url
  • error: nil if success otherwise the specific error

func (*Client) GetSnapshotDetail

func (c *Client) GetSnapshotDetail(snapshotId string) (*api.GetSnapshotDetailResult, error)

GetSnapshotDetail - get a snapshot's detail info

PARAMS:

  • snapshotId: the specific snapshot ID

RETURNS:

  • *api.GetSnapshotDetailResult: the result of get snapshot's detail info
  • error: nil if success otherwise the specific error

func (*Client) InstanceChangeSubnet

func (c *Client) InstanceChangeSubnet(args *api.InstanceChangeSubnetArgs) error

InstanceChangeSubnet - change an instance's subnet

PARAMS:

  • args: the arguments to change an instance's subnet

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) InstancePurchaseReserved

func (c *Client) InstancePurchaseReserved(instanceId string, args *api.PurchaseReservedArgs) error

InstancePurchaseReserved - purchase reserve an instance

PARAMS:

  • instanceId: the specific instance ID
  • args: the arguments to purchase reserved an instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ListAutoSnapshotPolicy

func (c *Client) ListAutoSnapshotPolicy(args *api.ListASPArgs) (*api.ListASPResult, error)

ListAutoSnapshotPolicy - list all auto snapshot policies

PARAMS:

  • args: the arguments to create instance

RETURNS:

  • *api.ListASPResult: the result of list all auto snapshot policies
  • error: nil if success otherwise the specific error

func (*Client) ListCDSVolume

func (c *Client) ListCDSVolume(queryArgs *api.ListCDSVolumeArgs) (*api.ListCDSVolumeResult, error)

ListCDSVolume - list all cds volume with the specific parameters

PARAMS:

  • args: the arguments to list all cds

RETURNS:

  • *api.ListCDSVolumeResult: the result of list all CDS volume
  • error: nil if success otherwise the specific error

func (*Client) ListImage

func (c *Client) ListImage(queryArgs *api.ListImageArgs) (*api.ListImageResult, error)

ListImage - list all images

PARAMS:

  • args: the arguments to list all images

RETURNS:

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

func (*Client) ListInstances

func (c *Client) ListInstances(args *api.ListInstanceArgs) (*api.ListInstanceResult, error)

ListInstances - list all instance with the specific parameters

PARAMS:

  • args: the arguments to list all instance

RETURNS:

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

func (*Client) ListSecurityGroup

func (c *Client) ListSecurityGroup(queryArgs *api.ListSecurityGroupArgs) (*api.ListSecurityGroupResult, error)

ListSecurityGroup - list all security group

PARAMS:

  • args: the arguments to list all security group

RETURNS:

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

func (*Client) ListSnapshot

func (c *Client) ListSnapshot(args *api.ListSnapshotArgs) (*api.ListSnapshotResult, error)

ListSnapshot - list all snapshots

PARAMS:

  • args: the arguments to list all snapshots

RETURNS:

  • *api.ListSnapshotResult: the result of list all snapshots
  • error: nil if success otherwise the specific error

func (*Client) ListSpec

func (c *Client) ListSpec() (*api.ListSpecResult, error)

ListSpec - list all spec

RETURNS:

  • *api.ListSpecResult: the result of all spec
  • error: nil if success otherwise the specific error

func (*Client) ListZone

func (c *Client) ListZone() (*api.ListZoneResult, error)

ListZone - list all zones

RETURNS:

  • *api.ListZoneResult: the result of list all zones
  • error: nil if success otherwise the specific error

func (*Client) ModifyCDSVolume

func (c *Client) ModifyCDSVolume(volumeId string, args *api.ModifyCSDVolumeArgs) error

ModifyCDSVolume - modify a CDS volume

PARAMS:

  • volumeId: the specific CDS volume ID
  • args: the arguments to modify a CDS volume

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ModifyChargeTypeCDSVolume

func (c *Client) ModifyChargeTypeCDSVolume(volumeId string, args *api.ModifyChargeTypeCSDVolumeArgs) error

ModifyChargeTypeCDSVolume - modify a CDS volume's charge type

PARAMS:

  • volumeId: the specific CDS volume ID
  • args: the arguments to create instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ModifyInstanceAttribute

func (c *Client) ModifyInstanceAttribute(instanceId string, args *api.ModifyInstanceAttributeArgs) error

ModifyInstanceAttribute - modify an instance's attribute

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ModifyInstanceDesc

func (c *Client) ModifyInstanceDesc(instanceId string, args *api.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) PurchaseReservedCDSVolume

func (c *Client) PurchaseReservedCDSVolume(volumeId string, args *api.PurchaseReservedCSDVolumeArgs) error

PurchaseReservedCDSVolume - purchase reserve a CDS volume

PARAMS:

  • volumeId: the specific CDS volume ID
  • args: the arguments to purchase reserve a CDS volume

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, args *api.RebuildInstanceArgs) error

RebuildInstance - rebuild an instance

PARAMS:

  • instanceId: the specific instance ID
  • args: the arguments to rebuild an instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) RemoteCopyImage

func (c *Client) RemoteCopyImage(imageId string, args *api.RemoteCopyImageArgs) error

RemoteCopyImage - copy an image from other region

PARAMS:

  • imageId: the specific image ID
  • args: the arguments to remote copy an image

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) RenameCDSVolume

func (c *Client) RenameCDSVolume(volumeId string, args *api.RenameCSDVolumeArgs) error

RenameCDSVolume - rename a CDS volume

PARAMS:

  • volumeId: the specific CDS volume ID
  • args: the arguments to rename a CDS volume

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ResizeCDSVolume

func (c *Client) ResizeCDSVolume(volumeId string, args *api.ResizeCSDVolumeArgs) error

ResizeCDSVolume - resize a CDS volume

PARAMS:

  • volumeId: the specific CDS volume ID
  • args: the arguments to resize CDS volume

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ResizeInstance

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

ResizeInstance - resize a specific instance

PARAMS:

  • instanceId: the specific instance ID
  • args: the arguments to resize a specific instance

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) RevokeSecurityGroupRule

func (c *Client) RevokeSecurityGroupRule(securityGroupId string, args *api.RevokeSecurityGroupArgs) error

RevokeSecurityGroupRule - revoke a security group rule

PARAMS:

  • securityGroupId: the specific securityGroup ID
  • args: the arguments to revoke security group rule

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) RollbackCDSVolume

func (c *Client) RollbackCDSVolume(volumeId string, args *api.RollbackCSDVolumeArgs) error

RollbackCDSVolume - rollback a CDS volume

PARAMS:

  • volumeId: the specific CDS volume ID
  • args: the arguments to rollback a CDS volume

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) ShareImage

func (c *Client) ShareImage(imageId string, args *api.SharedUser) error

ShareImage - share an image

PARAMS:

  • imageId: the specific image ID
  • args: the arguments to share an image

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

func (c *Client) UnBindSecurityGroup(instanceId string, securityGroupId string) error

UnBindSecurityGroup - unbind a security group ID from instance

PARAMS:

  • instanceId: the specific instance ID
  • securityGroupId: the security group ID which need to unbind

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UnShareImage

func (c *Client) UnShareImage(imageId string, args *api.SharedUser) error

UnShareImage - cancel share an image

PARAMS:

  • imageId: the specific image ID
  • args: the arguments to cancel share an image

RETURNS:

  • error: nil if success otherwise the specific error

func (*Client) UpdateAutoSnapshotPolicy

func (c *Client) UpdateAutoSnapshotPolicy(args *api.UpdateASPArgs) error

UpdateAutoSnapshotPolicy - update an auto snapshot policy

PARAMS:

  • args: the arguments to update an auto snapshot policy

RETURNS:

  • error: nil if success otherwise the specific error

Directories

Path Synopsis
Package api defines all APIs supported by the BCC service of BCE.
Package api defines all APIs supported by the BCC service of BCE.

Jump to

Keyboard shortcuts

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