api

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

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

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

Index

Constants

View Source
const (
	URI_PREFIX = bce.URI_PREFIX + "v2"

	REQUEST_INSTANCE_URI = "/instance"
	REQUEST_VNC_SUFFIX   = "/vnc"

	REQUEST_VOLUME_URI           = "/volume"
	REQUEST_SECURITYGROUP_URI    = "/securityGroup"
	REQUEST_IMAGE_URI            = "/image"
	REQUEST_IMAGE_SHAREDUSER_URI = "/sharedUsers"
	REQUEST_IMAGE_OS_URI         = "/os"

	REQUEST_SNAPSHOT_URI = "/snapshot"
	REQUEST_ASP_URI      = "/asp"
	REQUEST_SPEC_URI     = "/instance/spec"
	REQUEST_ZONE_URI     = "/zone"

	REQUEST_SUBNET_URI = "/subnet"
)

Variables

This section is empty.

Functions

func Aes128EncryptUseSecreteKey

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

func AttachAutoSnapshotPolicy

func AttachAutoSnapshotPolicy(cli bce.Client, aspId string, args *AttachASPArgs) error

AttachAutoSnapshotPolicy - attach an automatic snapshot policy to specified volumes

PARAMS:

  • cli: the client agent which can perform sending request
  • aspId: the id of the automatic snapshot policy
  • args: the arguments to attach automatic snapshot policy

RETURNS:

  • error: nil if success otherwise the specific error

func AuthorizeSecurityGroupRule

func AuthorizeSecurityGroupRule(cli bce.Client, securityGroupId string, args *AuthorizeSecurityGroupArgs) error

AuthorizeSecurityGroupRule - authorize a rule of security group

PARAMS:

  • cli: the client agent which can perform sending request
  • securityGroupId: id of the security group
  • args: arguments to authorize security group rule

RETURNS:

  • error: nil if success otherwise the specific error

func BindSecurityGroup

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

BindSecurityGroup - bind security group for a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • reqBody: the request body to bind security group associate to the instance

RETURNS:

  • error: nil if success otherwise the specific error

func CancelRemoteCopyImage

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

CancelRemoteCopyImage - cancel the image copy across regions

PARAMS:

  • cli: the client agent which can perform sending request
  • imageId: id of the image

RETURNS:

  • error: nil if success otherwise the specific error

func ChangeInstancePass

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

ChangeInstancePass - change password of specified instance

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func DeleteAutoSnapshotPolicy

func DeleteAutoSnapshotPolicy(cli bce.Client, aspId string) error

DeleteAutoSnapshotPolicy - delete an automatic snapshot policy

PARAMS:

  • cli: the client agent which can perform sending request
  • aspId: the id of the automatic snapshot policy

RETURNS:

  • error: nil if success otherwise the specific error

func DeleteCDSVolume

func DeleteCDSVolume(cli bce.Client, volumeId string) error

DeleteCDSVolume - delete a specified cds volume

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the cds volume to be deleted
  • :

RETURNS:

  • error: nil if success otherwise the specific error

func DeleteCDSVolumeNew

func DeleteCDSVolumeNew(cli bce.Client, volumeId string, args *DeleteCDSVolumeArgs) error

DeleteCDSVolumeNew - delete a specified cds volume, the difference from the above api is that \ can control whether to delete the snapshot associated with the volume

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the cds volume to be deleted
  • args: the arguments to delete cds volume

RETURNS:

  • error: nil if success otherwise the specific error

func DeleteImage

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

DeleteImage - delete a specified image

PARAMS:

  • cli: the client agent which can perform sending request
  • imageId: id of image to be deleted

RETURNS:

  • error: nil if success otherwise the specific error

func DeleteInstance

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

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 DeleteInstanceWithRelatedResource

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

DeleteInstanceWithRelatedResource - delete an instance with related resources

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance to be deleted
  • reqBody: request body to delete instance

RETURNS:

  • error: nil if success otherwise the specific error

func DeleteSecurityGroup

func DeleteSecurityGroup(cli bce.Client, securityGroupId string) error

DeleteSecurityGroup - delete a security group

PARAMS:

  • cli: the client agent which can perform sending request
  • securityGroupId: id of the security group to be deleted

RETURNS:

  • error: nil if success otherwise the specific error

func DeleteSnapshot

func DeleteSnapshot(cli bce.Client, snapshotId string) error

DeleteSnapshot - delete a snapshot

PARAMS:

  • cli: the client agent which can perform sending request
  • snapshotId: id of the snapshot to be deleted

RETURNS:

  • error: nil if success otherwise the specific error

func DetachAutoSnapshotPolicy

func DetachAutoSnapshotPolicy(cli bce.Client, aspId string, args *DetachASPArgs) error

DetachAutoSnapshotPolicy - detach an automatic snapshot policy for specified volumes

PARAMS:

  • cli: the client agent which can perform sending request
  • aspId: the id of the automatic snapshot policy
  • args: the arguments to detach automatic snapshot policy

RETURNS:

  • error: nil if success otherwise the specific error

func DetachCDSVolume

func DetachCDSVolume(cli bce.Client, volumeId string, args *DetachVolumeArgs) error

DetachCDSVolume - detach an cds volume for a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the cds volume
  • args: the arguments of instance id detached from

RETURNS:

  • error: nil if success otherwise the specific error

func InstanceChangeSubnet

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

InstanceChangeSubnet - change the subnet to which the instance belongs

PARAMS:

  • cli: the client agent which can perform sending request
  • reqBody: request body to change subnet of instance

RETURNS:

  • error: nil if success otherwise the specific error

func InstancePurchaseReserved

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

InstancePurchaseReserved - renew a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance to be renewed
  • reqBody: the request body to renew instance

RETURNS:

  • error: nil if success otherwise the specific error

func ModifyCDSVolume

func ModifyCDSVolume(cli bce.Client, volumeId string, args *ModifyCSDVolumeArgs) error

ModifyCDSVolume - modify attributes of the specified cds volume

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the volume to be modified
  • args: arguments to modify volume

RETURNS:

  • error: nil if success otherwise the specific error

func ModifyChargeTypeCDSVolume

func ModifyChargeTypeCDSVolume(cli bce.Client, volumeId string, args *ModifyChargeTypeCSDVolumeArgs) error

ModifyChargeTypeCDSVolume - modify the volume billing method, only support Postpaid to Prepaid and Prepaid to Postpaid

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the volume to be modified
  • args: the arguments to modify volume billing method

RETURNS:

  • error: nil if success otherwise the specific error

func ModifyInstanceAttribute

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

ModifyInstanceAttribute - modify attribute of a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance to be modified
  • reqBody: the request body to modify instance

RETURNS:

  • error: nil if success otherwise the specific error

func ModifyInstanceDesc

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

ModifyInstanceDesc - modify desc of a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance to be modified
  • reqBody: the request body to modify instance

RETURNS:

  • error: nil if success otherwise the specific error

func PurchaseReservedCDSVolume

func PurchaseReservedCDSVolume(cli bce.Client, volumeId string, args *PurchaseReservedCSDVolumeArgs) error

PurchaseReservedCDSVolume - renew a specified volume to extend expiration time.

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the volume to be renewed
  • args: the arguments to renew cds volume

RETURNS:

  • error: nil if success otherwise the specific error

func RebootInstance

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

RebootInstance - reboot a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance to be rebooted
  • reqBody: the request body to reboot instance

RETURNS:

  • error: nil if success otherwise the specific error

func RebuildInstance

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

RebuildInstance - rebuild a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance to be rebuilded
  • reqBody: the request body to rebuild instance

RETURNS:

  • error: nil if success otherwise the specific error

func RemoteCopyImage

func RemoteCopyImage(cli bce.Client, imageId string, args *RemoteCopyImageArgs) error

RemoteCopyImage - copy custom images across regions, only custom images supported, the system \ and service integration images cannot be copied.

PARAMS:

  • cli: the client agent which can perform sending request
  • imageId: id of the image to be copied
  • args: the arguments to copy image

RETURNS:

  • error: nil if success otherwise the specific error

func RenameCDSVolume

func RenameCDSVolume(cli bce.Client, volumeId string, args *RenameCSDVolumeArgs) error

RenameCDSVolume - rename a specified cds volume

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the volume to be renamed
  • args: the arguments to rename volume

RETURNS:

  • error: nil if success otherwise the specific error

func ResizeCDSVolume

func ResizeCDSVolume(cli bce.Client, volumeId string, args *ResizeCSDVolumeArgs) error

ResizeCDSVolume - resize a specified cds volume

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the cds volume to be resized
  • args: the arguments to resize cds volume

RETURNS:

  • error: nil if success otherwise the specific error

func ResizeInstance

func ResizeInstance(cli bce.Client, instanceId, clientToken string, reqBody *bce.Body) 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 RevokeSecurityGroupRule

func RevokeSecurityGroupRule(cli bce.Client, securityGroupId string, args *RevokeSecurityGroupArgs) error

RevokeSecurityGroupRule - revoke a rule of security group

PARAMS:

  • cli: the client agent which can perform sending request
  • securityGroupId: id of the security group
  • args: arguments to revoke security group rule

RETURNS:

  • error: nil if success otherwise the specific error

func RollbackCDSVolume

func RollbackCDSVolume(cli bce.Client, volumeId string, args *RollbackCSDVolumeArgs) error

RollbackCDSVolume - roll back a specified cds volume

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the cds volume to be rolled back
  • args: the arguments to roll back the cds volume

RETURNS:

  • error: nil if success otherwise the specific error

func ShareImage

func ShareImage(cli bce.Client, imageId string, args *SharedUser) error

ShareImage - share a specified custom image

PARAMS:

  • cli: the client agent which can perform sending request
  • imageId: id of the image to be shared
  • args: the arguments to share image

RETURNS:

  • error: nil if success otherwise the specific error

func StartInstance

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

StartInstance - start a specified instance

PARAMS:

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

RETURNS:

  • error: nil if success otherwise the specific error

func StopInstance

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

StopInstance - stop a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance to be stoped
  • reqBody: the request body to stop instance

RETURNS:

  • error: nil if success otherwise the specific error

func UnBindSecurityGroup

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

UnBindSecurityGroup - unbind security group for a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • instanceId: id of the instance
  • reqBody: the request body to unbind security group associate to the instance

RETURNS:

  • error: nil if success otherwise the specific error

func UnShareImage

func UnShareImage(cli bce.Client, imageId string, args *SharedUser) error

UnShareImage - unshare a specified image

PARAMS:

  • cli: the client agent which can perform sending request
  • imageId: id of the image to be unshared
  • args: the arguments to unshare image

RETURNS:

  • error: nil if success otherwise the specific error

func UpdateAutoSnapshotPolicy

func UpdateAutoSnapshotPolicy(cli bce.Client, args *UpdateASPArgs) error

UpdateAutoSnapshotPolicy - update an automatic snapshot policy

PARAMS:

  • cli: the client agent which can perform sending request
  • args: the arguments to update automatic snapshot policy

RETURNS:

  • error: nil if success otherwise the specific error

Types

type AttachASPArgs

type AttachASPArgs struct {
	VolumeIds []string `json:"volumeIds"`
}

type AttachVolumeArgs

type AttachVolumeArgs struct {
	InstanceId string `json:"instanceId"`
}

type AttachVolumeResult

type AttachVolumeResult struct {
	VolumeAttachment *VolumeAttachmentModel `json:"volumeAttachment"`
}

func AttachCDSVolume

func AttachCDSVolume(cli bce.Client, volumeId string, args *AttachVolumeArgs) (*AttachVolumeResult, error)

AttachCDSVolume - attach an cds volume to a specified instance

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the cds volume
  • args: the arguments of instance id

RETURNS:

  • *AttachVolumeResult: the result of the attachment
  • error: nil if success otherwise the specific error

type AuthorizeSecurityGroupArgs

type AuthorizeSecurityGroupArgs struct {
	ClientToken string                  `json:"-"`
	Rule        *SecurityGroupRuleModel `json:"rule"`
}

type AutoSnapshotPolicyModel

type AutoSnapshotPolicyModel struct {
	CreatedTime     string `json:"createdTime"`
	Id              string `json:"id"`
	Status          string `json:"status"`
	RetentionDays   int    `json:"retentionDays"`
	UpdatedTime     string `json:"updatedTime"`
	DeletedTime     string `json:"deletedTime"`
	LastExecuteTime string `json:"lastExecuteTime"`
	VolumeCount     int    `json:"volumeCount"`
	Name            string `json:"name"`
	TimePoints      []int  `json:"timePoints"`
	RepeatWeekdays  []int  `json:"repeatWeekdays"`
}

type Billing

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

type BindSecurityGroupArgs

type BindSecurityGroupArgs struct {
	SecurityGroupId string `json:"securityGroupId"`
}

type ChangeInstancePassArgs

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

type CreateASPArgs

type CreateASPArgs struct {
	ClientToken    string   `json:"-"`
	Name           string   `json:"name"`
	TimePoints     []string `json:"timePoints"`
	RepeatWeekdays []string `json:"repeatWeekdays"`
	RetentionDays  string   `json:"retentionDays"`
}

type CreateASPResult

type CreateASPResult struct {
	AspId string `json:"aspId"`
}

func CreateAutoSnapshotPolicy

func CreateAutoSnapshotPolicy(cli bce.Client, args *CreateASPArgs) (*CreateASPResult, error)

CreateAutoSnapshotPolicy - create an automatic snapshot policy

PARAMS:

  • cli: the client agent which can perform sending request
  • args: the arguments to create automatic snapshot policy

RETURNS:

  • *CreateASPResult: the ID of the automatic snapshot policy newly created
  • error: nil if success otherwise the specific error

type CreateCDSVolumeArgs

type CreateCDSVolumeArgs struct {
	Name          string      `json:"name,omitempty"`
	Description   string      `json:"description,omitempty"`
	SnapshotId    string      `json:"snapshotId,omitempty"`
	ZoneName      string      `json:"zoneName,omitempty"`
	PurchaseCount int         `json:"purchaseCount,omitempty"`
	CdsSizeInGB   int         `json:"cdsSizeInGB,omitempty"`
	StorageType   StorageType `json:"storageType,omitempty"`
	Billing       *Billing    `json:"billing"`
	ClientToken   string      `json:"-"`
}

type CreateCDSVolumeResult

type CreateCDSVolumeResult struct {
	VolumeIds []string `json:"volumeIds"`
}

func CreateCDSVolume

func CreateCDSVolume(cli bce.Client, args *CreateCDSVolumeArgs) (*CreateCDSVolumeResult, error)

CreateCDSVolume - create a specified count of cds volumes

PARAMS:

  • cli: the client agent which can perform sending request
  • args: the arguments to create cds volumes

RETURNS:

  • *CreateCDSVolumeResult: the result of volume ids newly created
  • error: nil if success otherwise the specific error

type CreateCdsModel

type CreateCdsModel struct {
	CdsSizeInGB int         `json:"cdsSizeInGB"`
	StorageType StorageType `json:"storageType"`
	SnapShotId  string      `json:"snapshotId,omitempty"`
}

type CreateImageArgs

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

type CreateImageResult

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

func CreateImage

func CreateImage(cli bce.Client, args *CreateImageArgs) (*CreateImageResult, error)

CreateImage - create an image

PARAMS:

  • cli: the client agent which can perform sending request
  • args: the arguments to create image

RETURNS:

  • *CreateImageResult: the result of the image newly created
  • error: nil if success otherwise the specific error

type CreateInstanceArgs

type CreateInstanceArgs struct {
	ImageId               string           `json:"imageId"`
	Billing               Billing          `json:"billing"`
	InstanceType          InstanceType     `json:"instanceType,omitempty"`
	CpuCount              int              `json:"cpuCount"`
	MemoryCapacityInGB    int              `json:"memoryCapacityInGB"`
	RootDiskSizeInGb      int              `json:"rootDiskSizeInGb,omitempty"`
	RootDiskStorageType   StorageType      `json:"rootDiskStorageType,omitempty"`
	LocalDiskSizeInGB     int              `json:"localDiskSizeInGB,omitempty"`
	EphemeralDisks        []EphemeralDisk  `json:"ephemeralDisks,omitempty"`
	CreateCdsList         []CreateCdsModel `json:"createCdsList,omitempty"`
	NetWorkCapacityInMbps int              `json:"networkCapacityInMbps,omitempty"`
	DedicateHostId        string           `json:"dedicatedHostId,omitempty"`
	PurchaseCount         int              `json:"purchaseCount,omitempty"`
	Name                  string           `json:"name,omitempty"`
	AdminPass             string           `json:"adminPass,omitempty"`
	ZoneName              string           `json:"zoneName,omitempty"`
	SubnetId              string           `json:"subnetId,omitempty"`
	SecurityGroupId       string           `json:"securityGroupId,omitempty"`
	GpuCard               string           `json:"gpuCard,omitempty"`
	FpgaCard              string           `json:"fpgaCard,omitempty"`
	CardCount             string           `json:"cardCount,omitempty"`
	AutoRenewTimeUnit     string           `json:"autoRenewTimeUnit"`
	AutoRenewTime         int              `json:"autoRenewTime"`
	CdsAutoRenew          bool             `json:"cdsAutoRenew"`
	RelationTag           bool             `json:"relationTag,omitempty"`
	Tags                  []model.TagModel `json:"tags,omitempty"`
	ClientToken           string           `json:"-"`
}

type CreateInstanceResult

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

func CreateInstance

func CreateInstance(cli bce.Client, clientToken string, reqBody *bce.Body) (*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

type CreateSecurityGroupArgs

type CreateSecurityGroupArgs struct {
	ClientToken string                   `json:"-"`
	Name        string                   `json:"name"`
	Desc        string                   `json:"desc,omitempty"`
	VpcId       string                   `json:"vpcId,omitempty"`
	Rules       []SecurityGroupRuleModel `json:"rules"`
	Tags        []model.TagModel         `json:"tags,omitempty"`
}

type CreateSecurityGroupResult

type CreateSecurityGroupResult struct {
	SecurityGroupId string `json:"securityGroupId"`
}

func CreateSecurityGroup

func CreateSecurityGroup(cli bce.Client, args *CreateSecurityGroupArgs) (*CreateSecurityGroupResult, error)

CreateSecurityGroup - create a security group and related rules

PARAMS:

  • cli: the client agent which can perform sending request
  • args: the arguments to create security group
  • :

RETURNS:

  • *CreateSecurityGroupResult: result of the security group id
  • error: nil if success otherwise the specific error

type CreateSnapshotArgs

type CreateSnapshotArgs struct {
	ClientToken  string `json:"-"`
	VolumeId     string `json:"volumeId"`
	SnapshotName string `json:"snapshotName"`
	Description  string `json:"desc,omitempty"`
}

type CreateSnapshotResult

type CreateSnapshotResult struct {
	SnapshotId string `json:"snapshotId"`
}

func CreateSnapshot

func CreateSnapshot(cli bce.Client, args *CreateSnapshotArgs) (*CreateSnapshotResult, error)

CreateSnapshot - create a snapshot for specified volume

PARAMS:

  • cli: the client agent which can perform sending request
  • args: the arguments to create snapshot

RETURNS:

  • *CreateSnapshotResult: result of the snapshot id newly created
  • error: nil if success otherwise the specific error

type DeleteCDSVolumeArgs

type DeleteCDSVolumeArgs struct {
	ManualSnapshot string `json:"manualSnapshot,omitempty"`
	AutoSnapshot   string `json:"autoSnapshot,omitempty"`
}

type DeleteInstanceWithRelateResourceArgs

type DeleteInstanceWithRelateResourceArgs struct {
	RelatedReleaseFlag    bool `json:"relatedReleaseFlag"`
	DeleteCdsSnapshotFlag bool `json:"deleteCdsSnapshotFlag"`
}

type DetachASPArgs

type DetachASPArgs struct {
	VolumeIds []string `json:"volumeIds"`
}

type DetachVolumeArgs

type DetachVolumeArgs struct {
	InstanceId string `json:"instanceId"`
}

type EphemeralDisk

type EphemeralDisk struct {
	StorageType  StorageType `json:"storageType"`
	SizeInGB     int         `json:"sizeInGB"`
	FreeSizeInGB int         `json:"freeSizeInGB"`
}

type GetASPDetailResult

type GetASPDetailResult struct {
	AutoSnapshotPolicy AutoSnapshotPolicyModel `json:"autoSnapshotPolicy"`
}

func GetAutoSnapshotPolicyDetail

func GetAutoSnapshotPolicyDetail(cli bce.Client, aspId string) (*GetASPDetailResult, error)

GetAutoSnapshotPolicyDetail - get details of the specified automatic snapshot policy

PARAMS:

  • cli: the client agent which can perform sending request
  • aspId: the id of the automatic snapshot policy

RETURNS:

  • *GetASPDetailResult: the result of the given automatic snapshot policy
  • error: nil if success otherwise the specific error

type GetImageDetailResult

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

func GetImageDetail

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

GetImageDetail - get details of the specified image

PARAMS:

  • cli: the client agent which can perform sending request
  • imageId: id of the image

RETURNS:

  • *GetImageDetailResult: result of image details
  • error: nil if success otherwise the specific error

type GetImageOsArgs

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

type GetImageOsResult

type GetImageOsResult struct {
	OsInfo []OsModel `json:"osInfo"`
}

func GetImageOS

func GetImageOS(cli bce.Client, args *GetImageOsArgs) (*GetImageOsResult, error)

GetImageOS - get the operating system information of the instance in batches according to the instance ids

PARAMS:

  • cli: the client agent which can perform sending request
  • args: the arguments of instance ids

RETURNS:

  • *GetImageOsResult: result of the operating system information
  • error: nil if success otherwise the specific error

type GetImageSharedUserResult

type GetImageSharedUserResult struct {
	Users []SharedUser `json:"users"`
}

func GetImageSharedUser

func GetImageSharedUser(cli bce.Client, imageId string) (*GetImageSharedUserResult, error)

GetImageSharedUser - get the list of users that the image has been shared with

PARAMS:

  • cli: the client agent which can perform sending request
  • imageId: id of the image

RETURNS:

  • *GetImageSharedUserResult: result of the shared users
  • error: nil if success otherwise the specific error

type GetInstanceDetailResult

type GetInstanceDetailResult struct {
	Instance InstanceModel `json:"instance"`
}

func GetInstanceDetail

func GetInstanceDetail(cli bce.Client, 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

type GetInstanceVNCResult

type GetInstanceVNCResult struct {
	VNCUrl string `json:"vncUrl"`
}

func GetInstanceVNC

func GetInstanceVNC(cli bce.Client, instanceId string) (*GetInstanceVNCResult, error)

GetInstanceVNC - get VNC address of the specified instance

PARAMS:

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

RETURNS:

  • *GetInstanceVNCResult: result of the VNC address of the instance
  • error: nil if success otherwise the specific error

type GetSnapshotDetailResult

type GetSnapshotDetailResult struct {
	Snapshot SnapshotModel `json:"snapshot"`
}

func GetSnapshotDetail

func GetSnapshotDetail(cli bce.Client, snapshotId string) (*GetSnapshotDetailResult, error)

GetSnapshotDetail - get details of the specified snapshot

PARAMS:

  • cli: the client agent which can perform sending request
  • snapshotId: id of the snapshot

RETURNS:

  • *GetSnapshotDetailResult: result of snapshot details
  • error: nil if success otherwise the specific error

type GetVolumeDetailResult

type GetVolumeDetailResult struct {
	Volume *VolumeModel `json:"volume"`
}

func GetCDSVolumeDetail

func GetCDSVolumeDetail(cli bce.Client, volumeId string) (*GetVolumeDetailResult, error)

GetCDSVolumeDetail - get details of the specified cds volume

PARAMS:

  • cli: the client agent which can perform sending request
  • volumeId: id of the cds volume

RETURNS:

  • *GetVolumeDetailResult: the result of the specified cds volume details
  • error: nil if success otherwise the specific error

type ImageModel

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

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

type ImageType

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

type InstanceChangeSubnetArgs

type InstanceChangeSubnetArgs struct {
	InstanceId string `json:"instanceId"`
	SubnetId   string `json:"subnetId"`
	Reboot     bool   `json:"reboot"`
}

type InstanceModel

type InstanceModel struct {
	InstanceId            string           `json:"id"`
	InstanceName          string           `json:"name"`
	InstanceType          InstanceType     `json:"instanceType"`
	Description           string           `json:"desc"`
	Status                InstanceStatus   `json:"status"`
	PaymentTiming         string           `json:"paymentTiming"`
	CreationTime          string           `json:"createTime"`
	ExpireTime            string           `json:"expireTime"`
	PublicIP              string           `json:"publicIp"`
	InternalIP            string           `json:"internalIp"`
	CpuCount              int              `json:"cpuCount"`
	GpuCard               string           `json:"gpuCard"`
	FpgaCard              string           `json:"fpgaCard"`
	CardCount             string           `json:"cardCount"`
	MemoryCapacityInGB    int              `json:"memoryCapacityInGB"`
	LocalDiskSizeInGB     int              `json:"localDiskSizeInGB"`
	ImageId               string           `json:"imageId"`
	NetworkCapacityInMbps int              `json:"networkCapacityInMbps"`
	PlacementPolicy       string           `json:"placementPolicy"`
	ZoneName              string           `json:"zoneName"`
	SubnetId              string           `json:"subnetId"`
	VpcId                 string           `json:"vpcId"`
	AutoRenew             bool             `json:"autoRenew"`
	KeypairId             string           `json:"keypairId"`
	KeypairName           string           `json:"keypairName"`
	DedicatedHostId       string           `json:"dedicatedHostId"`
	Tags                  []model.TagModel `json:"tags"`
}

Instance define instance model

type InstanceStatus

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

type InstanceType

type InstanceType string
const (
	InstanceTypeN1 InstanceType = "N1"
	InstanceTypeN2 InstanceType = "N2"
	InstanceTypeN3 InstanceType = "N3"
	InstanceTypeC1 InstanceType = "C1"
	InstanceTypeC2 InstanceType = "C2"
	InstanceTypeS1 InstanceType = "S1"
	InstanceTypeG1 InstanceType = "G1"
	InstanceTypeF1 InstanceType = "F1"
)

type InstanceTypeModel

type InstanceTypeModel struct {
	Type              string `json:"type"`
	Name              string `json:"name"`
	CpuCount          int    `json:"cpuCount"`
	MemorySizeInGB    int    `json:"memorySizeInGB"`
	LocalDiskSizeInGB int    `json:"localDiskSizeInGB"`
}

type ListASPArgs

type ListASPArgs struct {
	Marker     string
	MaxKeys    int
	AspName    string
	VolumeName string
}

type ListASPResult

type ListASPResult struct {
	Marker              string                    `json:"marker"`
	IsTruncated         bool                      `json:"isTruncated"`
	NextMarker          string                    `json:"nextMarker"`
	MaxKeys             int                       `json:"maxKeys"`
	AutoSnapshotPolicys []AutoSnapshotPolicyModel `json:"autoSnapshotPolicys"`
}

func ListAutoSnapshotPolicy

func ListAutoSnapshotPolicy(cli bce.Client, queryArgs *ListASPArgs) (*ListASPResult, error)

ListAutoSnapshotPolicy - list all automatic snapshot policies with the specified parameters

PARAMS:

  • cli: the client agent which can perform sending request
  • queryArgs: the arguments to list automatic snapshot policies
  • :

RETURNS:

  • *ListASPResult: the result of the automatic snapshot policies
  • error: nil if success otherwise the specific error

type ListCDSVolumeArgs

type ListCDSVolumeArgs struct {
	MaxKeys    int
	InstanceId string
	ZoneName   string
	Marker     string
}

type ListCDSVolumeResult

type ListCDSVolumeResult struct {
	Marker      string        `json:"marker"`
	IsTruncated bool          `json:"isTruncated"`
	NextMarker  string        `json:"nextMarker"`
	MaxKeys     int           `json:"maxKeys"`
	Volumes     []VolumeModel `json:"volumes"`
}

func ListCDSVolume

func ListCDSVolume(cli bce.Client, queryArgs *ListCDSVolumeArgs) (*ListCDSVolumeResult, error)

ListCDSVolume - list all cds volumes with the given parameters

PARAMS:

  • cli: the client agent which can perform sending request
  • queryArgs: the optional arguments to list cds volumes

RETURNS:

  • *ListCDSVolumeResult: the result of cds volume list
  • error: nil if success otherwise the specific error

type ListImageArgs

type ListImageArgs struct {
	Marker    string
	MaxKeys   int
	ImageType string
}

type ListImageResult

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

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

ListImage - list all images with the specified parameters

PARAMS:

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

RETURNS:

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

type ListInstanceArgs

type ListInstanceArgs struct {
	Marker          string
	MaxKeys         int
	InternalIp      string
	DedicatedHostId string
	ZoneName        string
}

type ListInstanceResult

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

func ListInstances

func ListInstances(cli bce.Client, args *ListInstanceArgs) (*ListInstanceResult, 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

type ListSecurityGroupArgs

type ListSecurityGroupArgs struct {
	Marker     string
	MaxKeys    int
	InstanceId string
	VpcId      string
}

type ListSecurityGroupResult

type ListSecurityGroupResult struct {
	Marker         string               `json:"marker"`
	IsTruncated    bool                 `json:"isTruncated"`
	NextMarker     string               `json:"nextMarker"`
	MaxKeys        int                  `json:"maxKeys"`
	SecurityGroups []SecurityGroupModel `json:"securityGroups"`
}

func ListSecurityGroup

func ListSecurityGroup(cli bce.Client, queryArgs *ListSecurityGroupArgs) (*ListSecurityGroupResult, error)

ListSecurityGroup - list all security groups with the specified parameters

PARAMS:

  • cli: the client agent which can perform sending request
  • queryArgs: the arguments to list security groups

RETURNS:

  • *ListSecurityGroupResult: result of the security group list
  • error: nil if success otherwise the specific error

type ListSnapshotArgs

type ListSnapshotArgs struct {
	Marker   string
	MaxKeys  int
	VolumeId string
}

type ListSnapshotResult

type ListSnapshotResult struct {
	Marker      string          `json:"marker"`
	IsTruncated bool            `json:"isTruncated"`
	NextMarker  string          `json:"nextMarker"`
	MaxKeys     int             `json:"maxKeys"`
	Snapshots   []SnapshotModel `json:"snapshots"`
}

func ListSnapshot

func ListSnapshot(cli bce.Client, queryArgs *ListSnapshotArgs) (*ListSnapshotResult, error)

ListSnapshot - list all snapshots with the specified parameters

PARAMS:

  • cli: the client agent which can perform sending request
  • queryArgs: arguments to list snapshots

RETURNS:

  • *ListSnapshotResult: result of the snapshot list
  • error: nil if success otherwise the specific error

type ListSpecResult

type ListSpecResult struct {
	InstanceTypes []InstanceTypeModel `json:"instanceTypes"`
}

func ListSpec

func ListSpec(cli bce.Client) (*ListSpecResult, error)

ListSpec - get specification list information of the instance

PARAMS:

  • cli: the client agent which can perform sending request

RETURNS:

  • *ListSpecResult: result of the specifications
  • error: nil if success otherwise the specific error

type ListZoneResult

type ListZoneResult struct {
	Zones []ZoneModel `json:"zones"`
}

func ListZone

func ListZone(cli bce.Client) (*ListZoneResult, error)

ListZone - get the available zone list in the current region

PARAMS:

  • cli: the client agent which can perform sending request

RETURNS:

  • *ListZoneResult: result of the available zones
  • error: nil if success otherwise the specific error

type ModifyCSDVolumeArgs

type ModifyCSDVolumeArgs struct {
	CdsName string `json:"cdsName,omitempty"`
	Desc    string `json:"desc,omitempty"`
}

type ModifyChargeTypeCSDVolumeArgs

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

type ModifyInstanceAttributeArgs

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

type ModifyInstanceDescArgs

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

type OsModel

type OsModel struct {
	OsVersion  string `json:"osVersion"`
	OsType     string `json:"osType"`
	InstanceId string `json:"instanceId"`
	OsArch     string `json:"osArch"`
	OsName     string `json:"osName"`
}

type PaymentTimingType

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

type PurchaseReservedArgs

type PurchaseReservedArgs struct {
	Billing     Billing `json:"billing"`
	ClientToken string  `json:"-"`
}

type PurchaseReservedCSDVolumeArgs

type PurchaseReservedCSDVolumeArgs struct {
	Billing     *Billing `json:"billing"`
	ClientToken string   `json:"-"`
}

type RebuildInstanceArgs

type RebuildInstanceArgs struct {
	ImageId   string `json:"imageId"`
	AdminPass string `json:"adminPass"`
}

type RemoteCopyImageArgs

type RemoteCopyImageArgs struct {
	Name       string   `json:"name,omitempty"`
	DestRegion []string `json:"destRegion"`
}

type RenameCSDVolumeArgs

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

type Reservation

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

type ResizeCSDVolumeArgs

type ResizeCSDVolumeArgs struct {
	NewCdsSizeInGB int    `json:"newCdsSizeInGB"`
	ClientToken    string `json:"-"`
}

type ResizeInstanceArgs

type ResizeInstanceArgs struct {
	CpuCount           int             `json:"cpuCount"`
	MemoryCapacityInGB int             `json:"memoryCapacityInGB"`
	EphemeralDisks     []EphemeralDisk `json:"ephemeralDisks,omitempty"`
	ClientToken        string          `json:"-"`
}

type RevokeSecurityGroupArgs

type RevokeSecurityGroupArgs struct {
	Rule *SecurityGroupRuleModel `json:"rule"`
}

type RollbackCSDVolumeArgs

type RollbackCSDVolumeArgs struct {
	SnapshotId string `json:"snapshotId"`
}

type SecurityGroupModel

type SecurityGroupModel struct {
	Id    string                   `json:"id"`
	Name  string                   `json:"name"`
	Desc  string                   `json:"desc"`
	VpcId string                   `json:"vpcId"`
	Rules []SecurityGroupRuleModel `json:"rules"`
	Tags  []model.TagModel         `json:"tags"`
}

type SecurityGroupRuleModel

type SecurityGroupRuleModel struct {
	SourceIp        string `json:"sourceIp,omitempty"`
	DestIp          string `json:"destIp,omitempty"`
	Protocol        string `json:"protocol,omitempty"`
	SourceGroupId   string `json:"sourceGroupId,omitempty"`
	Ethertype       string `json:"ethertype,omitempty"`
	PortRange       string `json:"portRange,omitempty"`
	DestGroupId     string `json:"destGroupId,omitempty"`
	SecurityGroupId string `json:"securityGroupId,omitempty"`
	Remark          string `json:"remark,omitempty"`
	Direction       string `json:"direction"`
}

type SharedUser

type SharedUser struct {
	AccountId string `json:"accountId,omitempty"`
	Account   string `json:"account,omitempty"`
}

type SnapshotModel

type SnapshotModel struct {
	Id           string         `json:"id"`
	Name         string         `json:"name"`
	SizeInGB     int            `json:"sizeInGB"`
	CreateTime   string         `json:"createTime"`
	Status       SnapshotStatus `json:"status"`
	CreateMethod string         `json:"createMethod"`
	VolumeId     string         `json:"volumeId"`
	Description  string         `json:"desc"`
}

type SnapshotStatus

type SnapshotStatus string
const (
	SnapshotStatusCreating      SnapshotStatus = "Creating"
	SnapshotStatusCreatedFailed SnapshotStatus = "CreatedFailed"
	SnapshotStatusAvailable     SnapshotStatus = "Available"
	SnapshotStatusNotAvailable  SnapshotStatus = "NotAvailable"
)

type StopInstanceArgs

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

type StorageType

type StorageType string
const (
	StorageTypeStd1     StorageType = "std1"
	StorageTypeHP1      StorageType = "hp1"
	StorageTypeCloudHP1 StorageType = "cloud_hp1"
	StorageTypeLocal    StorageType = "local"
	StorageTypeSATA     StorageType = "sata"
	StorageTypeSSD      StorageType = "ssd"
)

type UpdateASPArgs

type UpdateASPArgs struct {
	Name           string   `json:"name"`
	TimePoints     []string `json:"timePoints"`
	RepeatWeekdays []string `json:"repeatWeekdays"`
	RetentionDays  string   `json:"retentionDays"`
	AspId          string   `json:"aspId"`
}

type VolumeAttachmentModel

type VolumeAttachmentModel struct {
	VolumeId   string `json:"volumeId"`
	InstanceId string `json:"instanceId"`
	Device     string `json:"device"`
	Serial     string `json:"serial"`
}

type VolumeModel

type VolumeModel struct {
	Type               VolumeType               `json:"type"`
	StorageType        StorageType              `json:"storageType"`
	Id                 string                   `json:"id"`
	Name               string                   `json:"name"`
	DiskSizeInGB       int                      `json:"diskSizeInGB"`
	PaymentTiming      string                   `json:"paymentTiming"`
	ExpireTime         string                   `json:"expireTime"`
	Status             VolumeStatus             `json:"status"`
	Desc               string                   `json:"desc"`
	Attachments        []VolumeAttachmentModel  `json:"attachments"`
	ZoneName           string                   `json:"zoneName"`
	AutoSnapshotPolicy *AutoSnapshotPolicyModel `json:"autoSnapshotPolicy"`
	CreateTime         string                   `json:"createTime"`
	IsSystemVolume     bool                     `json:"isSystemVolume"`
	RegionId           string                   `json:"regionId"`
	SourceSnapshotId   string                   `json:"sourceSnapshotId"`
	SnapshotNum        string                   `json:"snapshotNum"`
	Tags               []model.TagModel         `json:"tags"`
}

type VolumeStatus

type VolumeStatus string
const (
	VolumeStatusAVAILABLE          VolumeStatus = "Available"
	VolumeStatusINUSE              VolumeStatus = "InUse"
	VolumeStatusSNAPSHOTPROCESSING VolumeStatus = "SnapshotProcessing"
	VolumeStatusRECHARGING         VolumeStatus = "Recharging"
	VolumeStatusDETACHING          VolumeStatus = "Detaching"
	VolumeStatusDELETING           VolumeStatus = "Deleting"
	VolumeStatusEXPIRED            VolumeStatus = "Expired"
	VolumeStatusNOTAVAILABLE       VolumeStatus = "NotAvailable"
	VolumeStatusDELETED            VolumeStatus = "Deleted"
	VolumeStatusSCALING            VolumeStatus = "Scaling"
	VolumeStatusIMAGEPROCESSING    VolumeStatus = "ImageProcessing"
	VolumeStatusCREATING           VolumeStatus = "Creating"
	VolumeStatusATTACHING          VolumeStatus = "Attaching"
	VolumeStatusERROR              VolumeStatus = "Error"
)

type VolumeType

type VolumeType string
const (
	VolumeTypeSYSTEM    VolumeType = "System"
	VolumeTypeEPHEMERAL VolumeType = "Ephemeral"
	VolumeTypeCDS       VolumeType = "Cds"
)

type ZoneModel

type ZoneModel struct {
	ZoneName string `json:"zoneName"`
}

Jump to

Keyboard shortcuts

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