qcloud

package
v2.3.16+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternetChargeByTraffic   = TInternetChargeType("PayByTraffic")
	InternetChargeByBandwidth = TInternetChargeType("PayByBandwidth")
)
View Source
const (
	EIP_STATUS_ASSOCIATING   = "Associating"
	EIP_STATUS_UNASSOCIATING = "Unassociating"
	EIP_STATUS_INUSE         = "InUse"
	EIP_STATUS_AVAILABLE     = "Available"

	EIP_OPERATION_LOCK_FINANCIAL = "financial"
	EIP_OPERATION_LOCK_SECURITY  = "security"

	EIP_INSTANCE_TYPE_ECS   = "EcsInstance" // (默认值):VPC类型的ECS实例
	EIP_INTANNCE_TYPE_SLB   = "SlbInstance" // :VPC类型的SLB实例
	EIP_INSTANCE_TYPE_NAT   = "Nat"         // :NAT网关
	EIP_INSTANCE_TYPE_HAVIP = "HaVip"       // :HAVIP
)
View Source
const (
	InstanceStatusStopped  = "STOPPED"
	InstanceStatusRunning  = "RUNNING"
	InstanceStatusStopping = "STOPPING"
	InstanceStatusStarting = "STARTING"
)
View Source
const (
	CLOUD_PROVIDER_QCLOUD    = models.CLOUD_PROVIDER_QCLOUD
	CLOUD_PROVIDER_QCLOUD_CN = "腾讯云"

	QCLOUD_DEFAULT_REGION = "ap-beijing"

	QCLOUD_API_VERSION = "2017-03-12"
)

Variables

View Source
var LatitudeAndLongitude = map[string]map[string]float32{
	"ap-bangkok":        {"latitude": 13.756330, "longitude": 100.501762},
	"ap-beijing":        {"latitude": 39.904202, "longitude": 116.407394},
	"ap-chengdu":        {"latitude": 30.572815, "longitude": 104.066803},
	"ap-chongqing":      {"latitude": 29.431585, "longitude": 106.912254},
	"ap-guangzhou":      {"latitude": 23.129110, "longitude": 113.264381},
	"ap-guangzhou-open": {"latitude": 23.126593, "longitude": 113.273415},
	"ap-hongkong":       {"latitude": 22.396427, "longitude": 114.109497},
	"ap-mumbai":         {"latitude": 19.075983, "longitude": 72.877655},
	"ap-seoul":          {"latitude": 37.566536, "longitude": 126.977966},
	"ap-shanghai":       {"latitude": 31.230391, "longitude": 121.473701},
	"ap-shanghai-fsi":   {"latitude": 31.311033, "longitude": 121.536217},
	"ap-shenzhen-fsi":   {"latitude": 22.531544, "longitude": 114.025467},
	"ap-singapore":      {"latitude": 1.352083, "longitude": 103.819839},
	"ap-tokyo":          {"latitude": 35.709026, "longitude": 139.731995},
	"eu-frankfurt":      {"latitude": 51.165691, "longitude": 10.451526},
	"eu-moscow":         {"latitude": 55.755825, "longitude": 37.617298},
	"na-ashburn":        {"latitude": 37.431572, "longitude": -78.656891},
	"na-siliconvalley":  {"latitude": 37.387474, "longitude": -122.057541},
	"na-toronto":        {"latitude": 43.653225, "longitude": -79.383186},
}

Functions

This section is empty.

Types

type AddressTemplate

type AddressTemplate struct {
	AddressSet          []string
	AddressTemplateId   string
	AddressTemplateName string
	CreatedTime         time.Time
}

type AddressTemplateGroup

type AddressTemplateGroup struct {
	AddressTemplateIdSet     []string
	AddressTemplateGroupName string
	AddressTemplateGroupId   string
	CreatedTime              time.Time
}

type AddressTemplateSpecification

type AddressTemplateSpecification struct {
	AddressId      string //	IP地址ID,例如:ipm-2uw6ujo6。
	AddressGroupId string //	IP地址组ID,例如:ipmg-2uw6ujo6。
}

type DataDisk

type DataDisk struct {
	DiskSize           float32 //	数据盘大小,单位:GB。最小调整步长为10G,不同数据盘类型取值范围不同,具体限制详见:CVM实例配置。默认值为0,表示不购买数据盘。更多限制详见产品文档。
	DiskType           string  //	数据盘类型。数据盘类型限制详见CVM实例配置。取值范围:LOCAL_BASIC:本地硬盘 LOCAL_SSD:本地SSD硬盘 CLOUD_BASIC:普通云硬盘 CLOUD_PREMIUM:高性能云硬盘 CLOUD_SSD:SSD云硬盘 默认取值:LOCAL_BASIC。 该参数对ResizeInstanceDisk接口无效。
	DiskId             string  //	数据盘ID。LOCAL_BASIC 和 LOCAL_SSD 类型没有ID。暂时不支持该参数。
	DeleteWithInstance bool    //	数据盘是否随子机销毁。取值范围:TRUE:子机销毁时,销毁数据盘 FALSE:子机销毁时,保留数据盘 默认取值:TRUE 该参数目前仅用于 RunInstances 接口。
}

type ImageStatusType

type ImageStatusType string
const (
	ImageStatusCreating     ImageStatusType = "Creating"
	ImageStatusAvailable    ImageStatusType = "NORMAL"
	ImageStatusUnAvailable  ImageStatusType = "UnAvailable"
	ImageStatusCreateFailed ImageStatusType = "CreateFailed"
)

type InstanceChargeType

type InstanceChargeType string
const (
	PrePaidInstanceChargeType  InstanceChargeType = "PREPAID"
	PostPaidInstanceChargeType InstanceChargeType = "POSTPAID_BY_HOUR"
	CdhPaidInstanceChargeType  InstanceChargeType = "CDHPAID"
	DefaultInstanceChargeType                     = PostPaidInstanceChargeType
)

type InternetAccessible

type InternetAccessible struct {
	InternetChargeType      string //网络计费类型。取值范围:BANDWIDTH_PREPAID:预付费按带宽结算 TRAFFIC_POSTPAID_BY_HOUR:流量按小时后付费 BANDWIDTH_POSTPAID_BY_HOUR:带宽按小时后付费 BANDWIDTH_PACKAGE:带宽包用户 默认取值:非带宽包用户默认与子机付费类型保持一致。
	InternetMaxBandwidthOut int    //	公网出带宽上限,单位:Mbps。默认值:0Mbps。不同机型带宽上限范围不一致,具体限制详见购买网络带宽。
	PublicIpAssigned        bool   //	是否分配公网IP。取值范围: TRUE:表示分配公网IP FALSE:表示不分配公网IP 当公网带宽大于0Mbps时,可自由选择开通与否,默认开通公网IP;当公网带宽为0,则不允许分配公网IP。
}

type LoginSettings

type LoginSettings struct {
	Password       string   //实例登录密码。不同操作系统类型密码复杂度限制不一样,具体如下:Linux实例密码必须8到16位,至少包括两项[a-z,A-Z]、[0-9] 和 [( ) ~ ! @ # $ % ^ & * - + = &#124; { } [ ] : ; ' , . ? / ]中的特殊符号。<br><li>Windows实例密码必须12到16位,至少包括三项[a-z],[A-Z],[0-9] 和 [( ) ~ ! @ # $ % ^ & * - + = { } [ ] : ; ' , . ? /]中的特殊符号。 若不指定该参数,则由系统随机生成密码,并通过站内信方式通知到用户。
	KeyIds         []string //	密钥ID列表。关联密钥后,就可以通过对应的私钥来访问实例;KeyId可通过接口DescribeKeyPairs获取,密钥与密码不能同时指定,同时Windows操作系统不支持指定密钥。当前仅支持购买的时候指定一个密钥。
	KeepImageLogin string   //	保持镜像的原始设置。该参数与Password或KeyIds.N不能同时指定。只有使用自定义镜像、共享镜像或外部导入镜像创建实例时才能指定该参数为TRUE。取值范围: TRUE:表示保持镜像的登录设置 FALSE:表示不保持镜像的登录设置 默认取值:FALSE。
}

type Placement

type Placement struct {
	ProjectId int
	Zone      string
}

type QcloudResponse

type QcloudResponse struct {
	*tchttp.BaseResponse
	Response *interface{} `json:"Response"`
}

type SAccountBalance

type SAccountBalance struct {
	AvailableAmount     float64
	AvailableCashAmount float64
	CreditAmount        float64
	MybankCreditAmount  float64
	Currency            string
}

type SDisk

type SDisk struct {
	Attached             bool
	AutoRenewFlagError   bool
	CreateTime           time.Time
	DeadlineError        bool
	DeadlineTime         time.Time
	DifferDaysOfDeadline int
	DiskChargeType       string
	DiskId               string
	DiskName             string
	DiskSize             int
	DiskState            string
	DiskType             string
	DiskUsage            string
	Encrypt              bool
	InstanceId           string
	IsReturnable         bool
	Placement            Placement
	Portable             bool
	RenewFlag            string
	ReturnFailCode       int
	RollbackPercent      int
	Rollbacking          bool
	SnapshotAbility      bool
	DeleteWithInstance   bool
	// contains filtered or unexported fields
}

func (*SDisk) CreateISnapshot

func (self *SDisk) CreateISnapshot(name, desc string) (cloudprovider.ICloudSnapshot, error)

func (*SDisk) Delete

func (self *SDisk) Delete() error

func (*SDisk) GetBillingType

func (self *SDisk) GetBillingType() string

func (*SDisk) GetCacheMode

func (self *SDisk) GetCacheMode() string

func (*SDisk) GetDiskFormat

func (self *SDisk) GetDiskFormat() string

func (*SDisk) GetDiskSizeMB

func (self *SDisk) GetDiskSizeMB() int

func (*SDisk) GetDiskType

func (self *SDisk) GetDiskType() string

func (*SDisk) GetDriver

func (self *SDisk) GetDriver() string

func (*SDisk) GetExpiredAt

func (self *SDisk) GetExpiredAt() time.Time

func (*SDisk) GetFsFormat

func (self *SDisk) GetFsFormat() string

func (*SDisk) GetGlobalId

func (self *SDisk) GetGlobalId() string

func (*SDisk) GetISnapshot

func (self *SDisk) GetISnapshot(snapshotId string) (cloudprovider.ICloudSnapshot, error)

func (*SDisk) GetISnapshots

func (self *SDisk) GetISnapshots() ([]cloudprovider.ICloudSnapshot, error)

func (*SDisk) GetIStorge

func (self *SDisk) GetIStorge() cloudprovider.ICloudStorage

func (*SDisk) GetId

func (self *SDisk) GetId() string

func (*SDisk) GetIsAutoDelete

func (self *SDisk) GetIsAutoDelete() bool

func (*SDisk) GetIsNonPersistent

func (self *SDisk) GetIsNonPersistent() bool

func (*SDisk) GetMetadata

func (self *SDisk) GetMetadata() *jsonutils.JSONDict

func (*SDisk) GetMountpoint

func (self *SDisk) GetMountpoint() string

func (*SDisk) GetName

func (self *SDisk) GetName() string

func (*SDisk) GetStatus

func (self *SDisk) GetStatus() string

func (*SDisk) GetTemplateId

func (self *SDisk) GetTemplateId() string

func (*SDisk) IsEmulated

func (self *SDisk) IsEmulated() bool

func (*SDisk) Refresh

func (self *SDisk) Refresh() error

func (*SDisk) Reset

func (self *SDisk) Reset(snapshotId string) error

func (*SDisk) Resize

func (self *SDisk) Resize(size int64) error

type SDiskSet

type SDiskSet []SDisk

func (SDiskSet) Len

func (v SDiskSet) Len() int

func (SDiskSet) Less

func (v SDiskSet) Less(i, j int) bool

func (SDiskSet) Swap

func (v SDiskSet) Swap(i, j int)

type SEipAddress

type SEipAddress struct {
	AddressId             string    //	EIP的ID,是EIP的唯一标识。
	AddressName           string    //	EIP名称。
	AddressStatus         string    //	EIP状态。
	AddressIp             string    //	外网IP地址
	InstanceId            string    //	绑定的资源实例ID。可能是一个CVM,NAT。
	CreatedTime           time.Time //	创建时间。按照ISO8601标准表示,并且使用UTC时间。格式为:YYYY-MM-DDThh:mm:ssZ。
	NetworkInterfaceId    string    //	绑定的弹性网卡ID
	PrivateAddressIp      string    //	绑定的资源内网ip
	IsArrears             bool      //	资源隔离状态。true表示eip处于隔离状态,false表示资源处于未隔离装填
	IsBlocked             bool      //	资源封堵状态。true表示eip处于封堵状态,false表示eip处于未封堵状态
	IsEipDirectConnection bool      //	eip是否支持直通模式。true表示eip支持直通模式,false表示资源不支持直通模式
	AddressType           string    //	eip资源类型,包括"CalcIP","WanIP","EIP","AnycastEIP"。其中"CalcIP"表示设备ip,“WanIP”表示普通公网ip,“EIP”表示弹性公网ip,“AnycastEip”表示加速EIP
	CascadeRelease        bool      //	eip是否在解绑后自动释放。true表示eip将会在解绑后自动释放,false表示eip在解绑后不会自动释放
	// contains filtered or unexported fields
}

func (*SEipAddress) Associate

func (self *SEipAddress) Associate(instanceId string) error

func (*SEipAddress) ChangeBandwidth

func (self *SEipAddress) ChangeBandwidth(bw int) error

func (*SEipAddress) Delete

func (self *SEipAddress) Delete() error

func (*SEipAddress) Dissociate

func (self *SEipAddress) Dissociate() error

func (*SEipAddress) GetAssociationExternalId

func (self *SEipAddress) GetAssociationExternalId() string

func (*SEipAddress) GetAssociationType

func (self *SEipAddress) GetAssociationType() string

func (*SEipAddress) GetBandwidth

func (self *SEipAddress) GetBandwidth() int

func (*SEipAddress) GetGlobalId

func (self *SEipAddress) GetGlobalId() string

func (*SEipAddress) GetId

func (self *SEipAddress) GetId() string

func (*SEipAddress) GetInternetChargeType

func (self *SEipAddress) GetInternetChargeType() string

func (*SEipAddress) GetIpAddr

func (self *SEipAddress) GetIpAddr() string

func (*SEipAddress) GetManagerId

func (self *SEipAddress) GetManagerId() string

func (*SEipAddress) GetMetadata

func (self *SEipAddress) GetMetadata() *jsonutils.JSONDict

func (*SEipAddress) GetMode

func (self *SEipAddress) GetMode() string

func (*SEipAddress) GetName

func (self *SEipAddress) GetName() string

func (*SEipAddress) GetStatus

func (self *SEipAddress) GetStatus() string

func (*SEipAddress) IsEmulated

func (self *SEipAddress) IsEmulated() bool

func (*SEipAddress) Refresh

func (self *SEipAddress) Refresh() error

type SHost

type SHost struct {
	// contains filtered or unexported fields
}

func (*SHost) CreateVM

func (self *SHost) CreateVM(name string, imgId string, sysDiskSize int, cpu int, memMB int,
	vswitchId string, ipAddr string, desc string, passwd string,
	storageType string, diskSizes []int, publicKey string, secgroupId string, userData string) (cloudprovider.ICloudVM, error)

func (*SHost) GetAccessIp

func (self *SHost) GetAccessIp() string

func (*SHost) GetAccessMac

func (self *SHost) GetAccessMac() string

func (*SHost) GetCpuCount

func (self *SHost) GetCpuCount() int8

func (*SHost) GetCpuDesc

func (self *SHost) GetCpuDesc() string

func (*SHost) GetCpuMhz

func (self *SHost) GetCpuMhz() int

func (*SHost) GetEnabled

func (self *SHost) GetEnabled() bool

func (*SHost) GetGlobalId

func (self *SHost) GetGlobalId() string

func (*SHost) GetHostStatus

func (self *SHost) GetHostStatus() string

func (*SHost) GetHostType

func (self *SHost) GetHostType() string

func (*SHost) GetIStorageById

func (self *SHost) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SHost) GetIStorages

func (self *SHost) GetIStorages() ([]cloudprovider.ICloudStorage, error)

func (*SHost) GetIVMById

func (self *SHost) GetIVMById(gid string) (cloudprovider.ICloudVM, error)

func (*SHost) GetIVMs

func (self *SHost) GetIVMs() ([]cloudprovider.ICloudVM, error)

func (*SHost) GetIWires

func (self *SHost) GetIWires() ([]cloudprovider.ICloudWire, error)

func (*SHost) GetId

func (self *SHost) GetId() string

func (*SHost) GetInstanceById

func (self *SHost) GetInstanceById(instanceId string) (*SInstance, error)

func (*SHost) GetManagerId

func (self *SHost) GetManagerId() string

func (*SHost) GetMemSizeMB

func (self *SHost) GetMemSizeMB() int

func (*SHost) GetMetadata

func (self *SHost) GetMetadata() *jsonutils.JSONDict

func (*SHost) GetName

func (self *SHost) GetName() string

func (*SHost) GetNodeCount

func (self *SHost) GetNodeCount() int8

func (*SHost) GetSN

func (self *SHost) GetSN() string

func (*SHost) GetStatus

func (self *SHost) GetStatus() string

func (*SHost) GetStorageSizeMB

func (self *SHost) GetStorageSizeMB() int

func (*SHost) GetStorageType

func (self *SHost) GetStorageType() string

func (*SHost) GetSysInfo

func (self *SHost) GetSysInfo() jsonutils.JSONObject

func (*SHost) IsEmulated

func (self *SHost) IsEmulated() bool

func (*SHost) Refresh

func (self *SHost) Refresh() error

type SImage

type SImage struct {
	ImageId            string          //	镜像ID
	OsName             string          //	镜像操作系统
	ImageType          string          //	镜像类型
	CreatedTime        time.Time       //	镜像创建时间
	ImageName          string          //	镜像名称
	ImageDescription   string          //	镜像描述
	ImageSize          int             //	镜像大小
	Architecture       string          //	镜像架构
	ImageState         ImageStatusType //	镜像状态
	Platform           string          //	镜像来源平台
	ImageCreator       string          //	镜像创建者
	ImageSource        string          //	镜像来源
	SyncPercent        int             //	同步百分比
	IsSupportCloudinit bool            //	镜像是否支持cloud-init
	// contains filtered or unexported fields
}

func (*SImage) Delete

func (self *SImage) Delete() error

func (*SImage) GetGlobalId

func (self *SImage) GetGlobalId() string

func (*SImage) GetIStoragecache

func (self *SImage) GetIStoragecache() cloudprovider.ICloudStoragecache

func (*SImage) GetId

func (self *SImage) GetId() string

func (*SImage) GetMetadata

func (self *SImage) GetMetadata() *jsonutils.JSONDict

func (*SImage) GetName

func (self *SImage) GetName() string

func (*SImage) GetStatus

func (self *SImage) GetStatus() string

func (*SImage) IsEmulated

func (self *SImage) IsEmulated() bool

func (*SImage) Refresh

func (self *SImage) Refresh() error

type SInstance

type SInstance struct {
	Placement           Placement
	InstanceId          string
	InstanceType        string
	CPU                 int8
	Memory              int
	RestrictState       string //NORMAL EXPIRED PROTECTIVELY_ISOLATED
	InstanceName        string
	InstanceChargeType  InstanceChargeType  //PREPAID:表示预付费,即包年包月 POSTPAID_BY_HOUR:表示后付费,即按量计费 CDHPAID:CDH付费,即只对CDH计费,不对CDH上的实例计费。
	SystemDisk          SystemDisk          //实例系统盘信息。
	DataDisks           []DataDisk          //实例数据盘信息。只包含随实例购买的数据盘。
	PrivateIpAddresses  []string            //实例主网卡的内网IP列表。
	PublicIpAddresses   []string            //实例主网卡的公网IP列表。
	InternetAccessible  InternetAccessible  //实例带宽信息。
	VirtualPrivateCloud VirtualPrivateCloud //实例所属虚拟私有网络信息。
	ImageId             string              //	生产实例所使用的镜像ID。
	RenewFlag           string              //	自动续费标识。取值范围:NOTIFY_AND_MANUAL_RENEW:表示通知即将过期,但不自动续费 NOTIFY_AND_AUTO_RENEW:表示通知即将过期,而且自动续费 DISABLE_NOTIFY_AND_MANUAL_RENEW:表示不通知即将过期,也不自动续费。
	CreatedTime         time.Time           //	创建时间。按照ISO8601标准表示,并且使用UTC时间。格式为:YYYY-MM-DDThh:mm:ssZ。
	ExpiredTime         time.Time           //	到期时间。按照ISO8601标准表示,并且使用UTC时间。格式为:YYYY-MM-DDThh:mm:ssZ。
	OsName              string              //	操作系统名称。
	SecurityGroupIds    []string            //	实例所属安全组。该参数可以通过调用 DescribeSecurityGroups 的返回值中的sgId字段来获取。
	LoginSettings       LoginSettings       //实例登录设置。目前只返回实例所关联的密钥。
	InstanceState       string              //	实例状态。取值范围:PENDING:表示创建中 LAUNCH_FAILED:表示创建失败 RUNNING:表示运行中 STOPPED:表示关机 STARTING:表示开机中 STOPPING:表示关机中 REBOOTING:表示重启中 SHUTDOWN:表示停止待销毁 TERMINATING:表示销毁中。
	Tags                []Tag
	// contains filtered or unexported fields
}

func (*SInstance) AttachDisk

func (self *SInstance) AttachDisk(diskId string) error

func (*SInstance) ChangeConfig

func (self *SInstance) ChangeConfig(instanceId string, ncpu int, vmem int) error

func (*SInstance) DeleteVM

func (self *SInstance) DeleteVM() error

func (*SInstance) DeployVM

func (self *SInstance) DeployVM(name string, password string, publicKey string, deleteKeypair bool, description string) error

func (*SInstance) DetachDisk

func (self *SInstance) DetachDisk(diskId string) error

func (*SInstance) GetBillingType

func (self *SInstance) GetBillingType() string

func (*SInstance) GetBios

func (self *SInstance) GetBios() string

func (*SInstance) GetBootOrder

func (self *SInstance) GetBootOrder() string

func (*SInstance) GetCreateTime

func (self *SInstance) GetCreateTime() time.Time

func (*SInstance) GetExpiredAt

func (self *SInstance) GetExpiredAt() time.Time

func (*SInstance) GetGlobalId

func (self *SInstance) GetGlobalId() string

func (*SInstance) GetHypervisor

func (self *SInstance) GetHypervisor() string

func (*SInstance) GetIDisks

func (self *SInstance) GetIDisks() ([]cloudprovider.ICloudDisk, error)

func (*SInstance) GetIEIP

func (self *SInstance) GetIEIP() (cloudprovider.ICloudEIP, error)

func (*SInstance) GetIHost

func (self *SInstance) GetIHost() cloudprovider.ICloudHost

func (*SInstance) GetINics

func (self *SInstance) GetINics() ([]cloudprovider.ICloudNic, error)

func (*SInstance) GetId

func (self *SInstance) GetId() string

func (*SInstance) GetMachine

func (self *SInstance) GetMachine() string

func (*SInstance) GetMetadata

func (self *SInstance) GetMetadata() *jsonutils.JSONDict

func (*SInstance) GetName

func (self *SInstance) GetName() string

func (*SInstance) GetOSName

func (self *SInstance) GetOSName() string

func (*SInstance) GetOSType

func (self *SInstance) GetOSType() string

func (*SInstance) GetStatus

func (self *SInstance) GetStatus() string

func (*SInstance) GetVNCInfo

func (self *SInstance) GetVNCInfo() (jsonutils.JSONObject, error)

func (*SInstance) GetVcpuCount

func (self *SInstance) GetVcpuCount() int8

func (*SInstance) GetVdi

func (self *SInstance) GetVdi() string

func (*SInstance) GetVga

func (self *SInstance) GetVga() string

func (*SInstance) GetVmemSizeMB

func (self *SInstance) GetVmemSizeMB() int

func (*SInstance) IsEmulated

func (self *SInstance) IsEmulated() bool

func (*SInstance) RebuildRoot

func (self *SInstance) RebuildRoot(imageId string, passwd string, publicKey string, sysSizeGB int) (string, error)

func (*SInstance) Refresh

func (self *SInstance) Refresh() error

func (*SInstance) StartVM

func (self *SInstance) StartVM() error

func (*SInstance) StopVM

func (self *SInstance) StopVM(isForce bool) error

func (*SInstance) SyncSecurityGroup

func (self *SInstance) SyncSecurityGroup(secgroupId string, name string, rules []secrules.SecurityRule) error

func (*SInstance) UpdateUserData

func (self *SInstance) UpdateUserData(userData string) error

func (*SInstance) UpdateVM

func (self *SInstance) UpdateVM(name string) error

type SInstanceNic

type SInstanceNic struct {
	// contains filtered or unexported fields
}

func (*SInstanceNic) GetDriver

func (self *SInstanceNic) GetDriver() string

func (*SInstanceNic) GetINetwork

func (self *SInstanceNic) GetINetwork() cloudprovider.ICloudNetwork

func (*SInstanceNic) GetIP

func (self *SInstanceNic) GetIP() string

func (*SInstanceNic) GetMAC

func (self *SInstanceNic) GetMAC() string

type SInstanceType

type SInstanceType struct {
	Zone              string //	可用区。
	InstanceType      string //	实例机型。
	InstanceFamily    string //	实例机型系列。
	GPU               int    //	GPU核数,单位:核。
	CPU               int    //	CPU核数,单位:核。
	Memory            int    //	内存容量,单位:GB。
	CbsSupport        string //	是否支持云硬盘。取值范围:TRUE:表示支持云硬盘;FALSE:表示不支持云硬盘。
	InstanceTypeState string //	机型状态。取值范围:AVAILABLE:表示机型可用;UNAVAILABLE:表示机型不可用。
}

type SKeypair

type SKeypair struct {
	AssociatedInstanceIds []string
	CreateTime            time.Time
	Description           string
	KeyId                 string
	KeyName               string
	PublicKey             string
}

type SLocalDisk

type SLocalDisk struct {
	DiskId    string
	DiskSize  float32
	DisktType string
	DiskUsage string
	// contains filtered or unexported fields
}

func (*SLocalDisk) CreateISnapshot

func (self *SLocalDisk) CreateISnapshot(name, desc string) (cloudprovider.ICloudSnapshot, error)

func (*SLocalDisk) Delete

func (self *SLocalDisk) Delete() error

func (*SLocalDisk) GetBillingType

func (self *SLocalDisk) GetBillingType() string

func (*SLocalDisk) GetCacheMode

func (self *SLocalDisk) GetCacheMode() string

func (*SLocalDisk) GetDiskFormat

func (self *SLocalDisk) GetDiskFormat() string

func (*SLocalDisk) GetDiskSizeMB

func (self *SLocalDisk) GetDiskSizeMB() int

func (*SLocalDisk) GetDiskType

func (self *SLocalDisk) GetDiskType() string

func (*SLocalDisk) GetDriver

func (self *SLocalDisk) GetDriver() string

func (*SLocalDisk) GetExpiredAt

func (self *SLocalDisk) GetExpiredAt() time.Time

func (*SLocalDisk) GetFsFormat

func (self *SLocalDisk) GetFsFormat() string

func (*SLocalDisk) GetGlobalId

func (self *SLocalDisk) GetGlobalId() string

func (*SLocalDisk) GetISnapshot

func (self *SLocalDisk) GetISnapshot(snapshotId string) (cloudprovider.ICloudSnapshot, error)

func (*SLocalDisk) GetISnapshots

func (self *SLocalDisk) GetISnapshots() ([]cloudprovider.ICloudSnapshot, error)

func (*SLocalDisk) GetIStorge

func (self *SLocalDisk) GetIStorge() cloudprovider.ICloudStorage

func (*SLocalDisk) GetId

func (self *SLocalDisk) GetId() string

func (*SLocalDisk) GetIsAutoDelete

func (self *SLocalDisk) GetIsAutoDelete() bool

func (*SLocalDisk) GetIsNonPersistent

func (self *SLocalDisk) GetIsNonPersistent() bool

func (*SLocalDisk) GetMetadata

func (self *SLocalDisk) GetMetadata() *jsonutils.JSONDict

func (*SLocalDisk) GetMountpoint

func (self *SLocalDisk) GetMountpoint() string

func (*SLocalDisk) GetName

func (self *SLocalDisk) GetName() string

func (*SLocalDisk) GetStatus

func (self *SLocalDisk) GetStatus() string

func (*SLocalDisk) GetTemplateId

func (self *SLocalDisk) GetTemplateId() string

func (*SLocalDisk) IsEmulated

func (self *SLocalDisk) IsEmulated() bool

func (*SLocalDisk) Refresh

func (self *SLocalDisk) Refresh() error

func (*SLocalDisk) Reset

func (self *SLocalDisk) Reset(snapshotId string) error

func (*SLocalDisk) Resize

func (self *SLocalDisk) Resize(size int64) error

type SLocalStorage

type SLocalStorage struct {
	// contains filtered or unexported fields
}

func (*SLocalStorage) CreateIDisk

func (self *SLocalStorage) CreateIDisk(name string, sizeGb int, desc string) (cloudprovider.ICloudDisk, error)

func (*SLocalStorage) GetCapacityMB

func (self *SLocalStorage) GetCapacityMB() int

func (*SLocalStorage) GetEnabled

func (self *SLocalStorage) GetEnabled() bool

func (*SLocalStorage) GetGlobalId

func (self *SLocalStorage) GetGlobalId() string

func (*SLocalStorage) GetIDisk

func (self *SLocalStorage) GetIDisk(idStr string) (cloudprovider.ICloudDisk, error)

func (*SLocalStorage) GetIDisks

func (self *SLocalStorage) GetIDisks() ([]cloudprovider.ICloudDisk, error)

func (*SLocalStorage) GetIStoragecache

func (self *SLocalStorage) GetIStoragecache() cloudprovider.ICloudStoragecache

func (*SLocalStorage) GetIZone

func (self *SLocalStorage) GetIZone() cloudprovider.ICloudZone

func (*SLocalStorage) GetId

func (self *SLocalStorage) GetId() string

func (*SLocalStorage) GetManagerId

func (self *SLocalStorage) GetManagerId() string

func (*SLocalStorage) GetMediumType

func (self *SLocalStorage) GetMediumType() string

func (*SLocalStorage) GetMetadata

func (self *SLocalStorage) GetMetadata() *jsonutils.JSONDict

func (*SLocalStorage) GetName

func (self *SLocalStorage) GetName() string

func (*SLocalStorage) GetStatus

func (self *SLocalStorage) GetStatus() string

func (*SLocalStorage) GetStorageConf

func (self *SLocalStorage) GetStorageConf() jsonutils.JSONObject

func (*SLocalStorage) GetStorageType

func (self *SLocalStorage) GetStorageType() string

func (*SLocalStorage) IsEmulated

func (self *SLocalStorage) IsEmulated() bool

func (*SLocalStorage) Refresh

func (self *SLocalStorage) Refresh() error

type SNetwork

type SNetwork struct {
	CidrBlock               string
	Zone                    string
	SubnetId                string
	VpcId                   string
	SubnetName              string
	AvailableIpAddressCount int
	CreatedTime             time.Time
	EnableBroadcast         bool
	IsDefault               bool
	RouteTableId            string
	// contains filtered or unexported fields
}

func (*SNetwork) Delete

func (self *SNetwork) Delete() error

func (*SNetwork) GetAllocTimeoutSeconds

func (self *SNetwork) GetAllocTimeoutSeconds() int

func (*SNetwork) GetGateway

func (self *SNetwork) GetGateway() string

func (*SNetwork) GetGlobalId

func (self *SNetwork) GetGlobalId() string

func (*SNetwork) GetIWire

func (self *SNetwork) GetIWire() cloudprovider.ICloudWire

func (*SNetwork) GetId

func (self *SNetwork) GetId() string

func (*SNetwork) GetIpEnd

func (self *SNetwork) GetIpEnd() string

func (*SNetwork) GetIpMask

func (self *SNetwork) GetIpMask() int8

func (*SNetwork) GetIpStart

func (self *SNetwork) GetIpStart() string

func (*SNetwork) GetIsPublic

func (self *SNetwork) GetIsPublic() bool

func (*SNetwork) GetMetadata

func (self *SNetwork) GetMetadata() *jsonutils.JSONDict

func (*SNetwork) GetName

func (self *SNetwork) GetName() string

func (*SNetwork) GetServerType

func (self *SNetwork) GetServerType() string

func (*SNetwork) GetStatus

func (self *SNetwork) GetStatus() string

func (*SNetwork) IsEmulated

func (self *SNetwork) IsEmulated() bool

func (*SNetwork) Refresh

func (self *SNetwork) Refresh() error

type SQcloudClient

type SQcloudClient struct {
	AppID     string
	SecretID  string
	SecretKey string
	// contains filtered or unexported fields
}

func NewQcloudClient

func NewQcloudClient(providerId string, providerName string, secretID string, secretKey string) (*SQcloudClient, error)

func (*SQcloudClient) GetIHostById

func (client *SQcloudClient) GetIHostById(id string) (cloudprovider.ICloudHost, error)

func (*SQcloudClient) GetIRegionById

func (client *SQcloudClient) GetIRegionById(id string) (cloudprovider.ICloudRegion, error)

func (*SQcloudClient) GetIRegions

func (client *SQcloudClient) GetIRegions() []cloudprovider.ICloudRegion

func (*SQcloudClient) GetIStorageById

func (client *SQcloudClient) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SQcloudClient) GetIStoragecacheById

func (client *SQcloudClient) GetIStoragecacheById(id string) (cloudprovider.ICloudStoragecache, error)

func (*SQcloudClient) GetIVpcById

func (client *SQcloudClient) GetIVpcById(id string) (cloudprovider.ICloudVpc, error)

func (*SQcloudClient) GetRegion

func (client *SQcloudClient) GetRegion(regionId string) *SRegion

func (*SQcloudClient) GetRegions

func (client *SQcloudClient) GetRegions() []SRegion

func (*SQcloudClient) GetSubAccounts

func (client *SQcloudClient) GetSubAccounts() ([]cloudprovider.SSubAccount, error)

func (*SQcloudClient) QueryAccountBalance

func (client *SQcloudClient) QueryAccountBalance() (*SAccountBalance, error)

type SRegion

type SRegion struct {
	Region      string
	RegionName  string
	RegionState string

	Latitude  float64
	Longitude float64
	// contains filtered or unexported fields
}

func (*SRegion) AddressGroupList

func (self *SRegion) AddressGroupList(groupId, groupName string, offset, limit int) ([]AddressTemplateGroup, int, error)

func (*SRegion) AddressList

func (self *SRegion) AddressList(addressId, addressName string, offset, limit int) ([]AddressTemplate, int, error)

func (*SRegion) AllocateEIP

func (region *SRegion) AllocateEIP(name string, bwMbps int, chargeType TInternetChargeType) (*SEipAddress, error)

func (*SRegion) AssociateEip

func (region *SRegion) AssociateEip(eipId string, instanceId string) error

func (*SRegion) AttachDisk

func (self *SRegion) AttachDisk(instanceId string, diskId string) error

func (*SRegion) AttachKeypair

func (self *SRegion) AttachKeypair(instanceId string, keypairId string) error

func (*SRegion) ChangeVMConfig

func (self *SRegion) ChangeVMConfig(zoneId string, instanceId string, ncpu int, vmem int, disks []*SDisk) error

func (*SRegion) CreateDisk

func (self *SRegion) CreateDisk(zoneId string, category string, name string, sizeGb int, desc string) (string, error)

func (*SRegion) CreateEIP

func (region *SRegion) CreateEIP(name string, bwMbps int, chargeType string) (cloudprovider.ICloudEIP, error)

func (*SRegion) CreateIVpc

func (self *SRegion) CreateIVpc(name string, desc string, cidr string) (cloudprovider.ICloudVpc, error)

func (*SRegion) CreateInstance

func (self *SRegion) CreateInstance(name string, imageId string, instanceType string, securityGroupId string,
	zoneId string, desc string, passwd string, disks []SDisk, networkId string, ipAddr string,
	keypair string, userData string) (string, error)

func (*SRegion) CreateInstanceSimple

func (self *SRegion) CreateInstanceSimple(name string, imgId string, cpu int, memGB int, storageType string, dataDiskSizesGB []int, networkId string, passwd string, publicKey string) (*SInstance, error)

func (*SRegion) CreateKeyPair

func (self *SRegion) CreateKeyPair(name string) (*SKeypair, error)

func (*SRegion) CreateNetwork

func (self *SRegion) CreateNetwork(zoneId string, vpcId string, name string, cidr string, desc string) (string, error)

func (*SRegion) CreateSecurityGroup

func (self *SRegion) CreateSecurityGroup(name, description string) (*SSecurityGroup, error)

func (*SRegion) CreateSnapshot

func (self *SRegion) CreateSnapshot(diskId, name, desc string) (string, error)

func (*SRegion) DeallocateEIP

func (region *SRegion) DeallocateEIP(eipId string) error

func (*SRegion) DeleteDisk

func (self *SRegion) DeleteDisk(diskId string) error

func (*SRegion) DeleteImage

func (self *SRegion) DeleteImage(imageId string) error

func (*SRegion) DeleteNetwork

func (self *SRegion) DeleteNetwork(networkId string) error

func (*SRegion) DeleteSecurityGroup

func (self *SRegion) DeleteSecurityGroup(secGroupId string) error

func (*SRegion) DeleteSnapshot

func (self *SRegion) DeleteSnapshot(snapshotId string) error

func (*SRegion) DeleteVM

func (self *SRegion) DeleteVM(instanceId string) error

func (*SRegion) DeleteVpc

func (self *SRegion) DeleteVpc(vpcId string) error

func (*SRegion) DeployVM

func (self *SRegion) DeployVM(instanceId string, name string, password string, keypairName string, deleteKeypair bool, description string) error

func (*SRegion) DetachDisk

func (self *SRegion) DetachDisk(instanceId string, diskId string) error

func (*SRegion) DetachKeyPair

func (self *SRegion) DetachKeyPair(instanceId string, keypairId string) error

func (*SRegion) DissociateEip

func (region *SRegion) DissociateEip(eipId string) error

func (*SRegion) GetClient

func (self *SRegion) GetClient() *SQcloudClient

func (*SRegion) GetCosClient

func (self *SRegion) GetCosClient() (*cos.Client, error)

func (*SRegion) GetDisk

func (self *SRegion) GetDisk(diskId string) (*SDisk, error)

func (*SRegion) GetDisks

func (self *SRegion) GetDisks(instanceId string, zoneId string, category string, diskIds []string, offset int, limit int) ([]SDisk, int, error)

func (*SRegion) GetEip

func (region *SRegion) GetEip(eipId string) (*SEipAddress, error)

func (*SRegion) GetEips

func (region *SRegion) GetEips(eipId string, offset int, limit int) ([]SEipAddress, int, error)

func (*SRegion) GetGlobalId

func (self *SRegion) GetGlobalId() string

func (*SRegion) GetIEipById

func (self *SRegion) GetIEipById(eipId string) (cloudprovider.ICloudEIP, error)

func (*SRegion) GetIEips

func (self *SRegion) GetIEips() ([]cloudprovider.ICloudEIP, error)

func (*SRegion) GetIHostById

func (self *SRegion) GetIHostById(id string) (cloudprovider.ICloudHost, error)

func (*SRegion) GetISnapshotById

func (self *SRegion) GetISnapshotById(snapshotId string) (cloudprovider.ICloudSnapshot, error)

func (*SRegion) GetISnapshots

func (self *SRegion) GetISnapshots() ([]cloudprovider.ICloudSnapshot, error)

func (*SRegion) GetIStorageById

func (self *SRegion) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SRegion) GetIStoragecacheById

func (self *SRegion) GetIStoragecacheById(id string) (cloudprovider.ICloudStoragecache, error)

func (*SRegion) GetIVpcById

func (self *SRegion) GetIVpcById(id string) (cloudprovider.ICloudVpc, error)

func (*SRegion) GetIVpcs

func (self *SRegion) GetIVpcs() ([]cloudprovider.ICloudVpc, error)

func (*SRegion) GetIZoneById

func (self *SRegion) GetIZoneById(id string) (cloudprovider.ICloudZone, error)

func (*SRegion) GetIZones

func (self *SRegion) GetIZones() ([]cloudprovider.ICloudZone, error)

func (*SRegion) GetId

func (self *SRegion) GetId() string

func (*SRegion) GetImage

func (self *SRegion) GetImage(imageId string) (*SImage, error)

func (*SRegion) GetImageByName

func (self *SRegion) GetImageByName(name string) (*SImage, error)

func (*SRegion) GetImageStatus

func (self *SRegion) GetImageStatus(imageId string) (ImageStatusType, error)

func (*SRegion) GetImages

func (self *SRegion) GetImages(status string, owner string, imageIds []string, name string, offset int, limit int) ([]SImage, int, error)

func (*SRegion) GetInstance

func (self *SRegion) GetInstance(instanceId string) (*SInstance, error)

func (*SRegion) GetInstanceStatus

func (self *SRegion) GetInstanceStatus(instanceId string) (string, error)

func (*SRegion) GetInstanceTypes

func (self *SRegion) GetInstanceTypes() ([]SInstanceType, error)

func (*SRegion) GetInstanceVNCUrl

func (self *SRegion) GetInstanceVNCUrl(instanceId string) (string, error)

func (*SRegion) GetInstances

func (self *SRegion) GetInstances(zoneId string, ids []string, offset int, limit int) ([]SInstance, int, error)

func (*SRegion) GetKeypairs

func (self *SRegion) GetKeypairs(name string, keyIds []string, offset int, limit int) ([]SKeypair, int, error)

func (*SRegion) GetLatitude

func (self *SRegion) GetLatitude() float32

func (*SRegion) GetLongitude

func (self *SRegion) GetLongitude() float32

func (*SRegion) GetMatchInstanceTypes

func (self *SRegion) GetMatchInstanceTypes(cpu int, memMB int, gpu int, zoneId string) ([]SInstanceType, error)

func (*SRegion) GetMetadata

func (self *SRegion) GetMetadata() *jsonutils.JSONDict

func (*SRegion) GetName

func (self *SRegion) GetName() string

func (*SRegion) GetNetwork

func (self *SRegion) GetNetwork(networkId string) (*SNetwork, error)

func (*SRegion) GetNetworks

func (self *SRegion) GetNetworks(ids []string, vpcId string, offset int, limit int) ([]SNetwork, int, error)

func (*SRegion) GetProvider

func (self *SRegion) GetProvider() string

func (*SRegion) GetSecurityGroupDetails

func (self *SRegion) GetSecurityGroupDetails(secGroupId string) (*SSecurityGroup, error)

func (*SRegion) GetSecurityGroups

func (self *SRegion) GetSecurityGroups(vpcId string, offset int, limit int) ([]SSecurityGroup, int, error)

func (*SRegion) GetSnapshots

func (self *SRegion) GetSnapshots(instanceId string, diskId string, snapshotName string, snapshotIds []string, offset int, limit int) ([]SSnapshot, int, error)

func (*SRegion) GetStatus

func (self *SRegion) GetStatus() string

func (*SRegion) GetVpcs

func (self *SRegion) GetVpcs(vpcIds []string, offset int, limit int) ([]SVpc, int, error)

func (*SRegion) ImportImage

func (self *SRegion) ImportImage(name string, osArch string, osType string, osVersion string, imageUrl string) (*SImage, error)

func (*SRegion) ImportKeypair

func (self *SRegion) ImportKeypair(name string, pubKey string) (*SKeypair, error)

func (*SRegion) IsEmulated

func (self *SRegion) IsEmulated() bool

func (*SRegion) Refresh

func (self *SRegion) Refresh() error

func (*SRegion) ReplaceSystemDisk

func (self *SRegion) ReplaceSystemDisk(instanceId string, imageId string, passwd string, keypairName string, sysDiskSizeGB int) error

func (*SRegion) ResetDisk

func (self *SRegion) ResetDisk(diskId, snapshotId string) error

func (*SRegion) ResizeDisk

func (self *SRegion) ResizeDisk(diskId string, sizeGb int64) error

func (*SRegion) StartVM

func (self *SRegion) StartVM(instanceId string) error

func (*SRegion) StopVM

func (self *SRegion) StopVM(instanceId string, isForce bool) error

func (*SRegion) UpdateEipBandwidth

func (region *SRegion) UpdateEipBandwidth(eipId string, bw int) error

func (*SRegion) UpdateInstancePassword

func (self *SRegion) UpdateInstancePassword(instId string, passwd string) error

func (*SRegion) UpdateVM

func (self *SRegion) UpdateVM(instanceId string, hostname string) error

type SSecurityGroup

type SSecurityGroup struct {
	SecurityGroupId        string    //		安全组实例ID,例如:sg-ohuuioma。
	SecurityGroupName      string    //		安全组名称,可任意命名,但不得超过60个字符。
	SecurityGroupDesc      string    //		安全组备注,最多100个字符。
	ProjectId              string    //		项目id,默认0。可在qcloud控制台项目管理页面查询到。
	IsDefault              bool      // 	是否是默认安全组,默认安全组不支持删除。
	CreatedTime            time.Time // 	安全组创建时间。
	SecurityGroupPolicySet SecurityGroupPolicySet
	// contains filtered or unexported fields
}

func (*SSecurityGroup) GetDescription

func (self *SSecurityGroup) GetDescription() string

func (*SSecurityGroup) GetGlobalId

func (self *SSecurityGroup) GetGlobalId() string

func (*SSecurityGroup) GetId

func (self *SSecurityGroup) GetId() string

func (*SSecurityGroup) GetMetadata

func (self *SSecurityGroup) GetMetadata() *jsonutils.JSONDict

func (*SSecurityGroup) GetName

func (self *SSecurityGroup) GetName() string

func (*SSecurityGroup) GetRules

func (self *SSecurityGroup) GetRules() ([]secrules.SecurityRule, error)

func (*SSecurityGroup) GetStatus

func (self *SSecurityGroup) GetStatus() string

func (*SSecurityGroup) IsEmulated

func (self *SSecurityGroup) IsEmulated() bool

func (*SSecurityGroup) Refresh

func (self *SSecurityGroup) Refresh() error

type SSnapshot

type SSnapshot struct {
	SnapshotId       string             //	快照ID。
	Placement        Placement          //	快照所在的位置。
	DiskUsage        string             //	创建此快照的云硬盘类型。取值范围:SYSTEM_DISK:系统盘 DATA_DISK:数据盘。
	DiskId           string             //	创建此快照的云硬盘ID。
	DiskSize         int32              //	创建此快照的云硬盘大小,单位GB。
	SnapshotState    SnapshotStatusType //	快照的状态。取值范围: NORMAL:正常 CREATING:创建中 ROLLBACKING:回滚中 COPYING_FROM_REMOTE:跨地域复制快照拷贝中。
	SnapshotName     string             //	快照名称,用户自定义的快照别名。调用ModifySnapshotAttribute可修改此字段。
	Percent          int                //	快照创建进度百分比,快照创建成功后此字段恒为100。
	CreateTime       time.Time          //	快照的创建时间。
	DeadlineTime     time.Time          //	快照到期时间。如果快照为永久保留,此字段为空。
	Encrypt          bool               //	是否为加密盘创建的快照。取值范围:true:该快照为加密盘创建的 false:非加密盘创建的快照。
	IsPermanent      bool               //	是否为永久快照。取值范围: true:永久快照 false:非永久快照。
	CopyingToRegions []string           //	快照正在跨地域复制的目的地域,默认取值为[]。
	CopyFromRemote   bool               //	是否为跨地域复制的快照。取值范围:true:表示为跨地域复制的快照。 false:本地域的快照。
	// contains filtered or unexported fields
}

func (*SSnapshot) Delete

func (self *SSnapshot) Delete() error

func (*SSnapshot) GetDiskId

func (self *SSnapshot) GetDiskId() string

func (*SSnapshot) GetDiskType

func (self *SSnapshot) GetDiskType() string

func (*SSnapshot) GetGlobalId

func (self *SSnapshot) GetGlobalId() string

func (*SSnapshot) GetId

func (self *SSnapshot) GetId() string

func (*SSnapshot) GetManagerId

func (self *SSnapshot) GetManagerId() string

func (*SSnapshot) GetMetadata

func (self *SSnapshot) GetMetadata() *jsonutils.JSONDict

func (*SSnapshot) GetName

func (self *SSnapshot) GetName() string

func (*SSnapshot) GetRegionId

func (self *SSnapshot) GetRegionId() string

func (*SSnapshot) GetSize

func (self *SSnapshot) GetSize() int32

func (*SSnapshot) GetStatus

func (self *SSnapshot) GetStatus() string

func (*SSnapshot) IsEmulated

func (self *SSnapshot) IsEmulated() bool

func (*SSnapshot) Refresh

func (self *SSnapshot) Refresh() error

type SStorage

type SStorage struct {
	// contains filtered or unexported fields
}

func (*SStorage) CreateIDisk

func (self *SStorage) CreateIDisk(name string, sizeGb int, desc string) (cloudprovider.ICloudDisk, error)

func (*SStorage) GetCapacityMB

func (self *SStorage) GetCapacityMB() int

func (*SStorage) GetEnabled

func (self *SStorage) GetEnabled() bool

func (*SStorage) GetGlobalId

func (self *SStorage) GetGlobalId() string

func (*SStorage) GetIDisk

func (self *SStorage) GetIDisk(idStr string) (cloudprovider.ICloudDisk, error)

func (*SStorage) GetIDisks

func (self *SStorage) GetIDisks() ([]cloudprovider.ICloudDisk, error)

func (*SStorage) GetIStoragecache

func (self *SStorage) GetIStoragecache() cloudprovider.ICloudStoragecache

func (*SStorage) GetIZone

func (self *SStorage) GetIZone() cloudprovider.ICloudZone

func (*SStorage) GetId

func (self *SStorage) GetId() string

func (*SStorage) GetManagerId

func (self *SStorage) GetManagerId() string

func (*SStorage) GetMediumType

func (self *SStorage) GetMediumType() string

func (*SStorage) GetMetadata

func (self *SStorage) GetMetadata() *jsonutils.JSONDict

func (*SStorage) GetName

func (self *SStorage) GetName() string

func (*SStorage) GetStatus

func (self *SStorage) GetStatus() string

func (*SStorage) GetStorageConf

func (self *SStorage) GetStorageConf() jsonutils.JSONObject

func (*SStorage) GetStorageType

func (self *SStorage) GetStorageType() string

func (*SStorage) IsEmulated

func (self *SStorage) IsEmulated() bool

func (*SStorage) Refresh

func (self *SStorage) Refresh() error

type SStoragecache

type SStoragecache struct {
	// contains filtered or unexported fields
}

func (*SStoragecache) CreateIImage

func (self *SStoragecache) CreateIImage(snapshoutId, imageName, osType, imageDesc string) (cloudprovider.ICloudImage, error)

func (*SStoragecache) DownloadImage

func (self *SStoragecache) DownloadImage(userCred mcclient.TokenCredential, imageId string, extId string, path string) (jsonutils.JSONObject, error)

func (*SStoragecache) GetGlobalId

func (self *SStoragecache) GetGlobalId() string

func (*SStoragecache) GetIImages

func (self *SStoragecache) GetIImages() ([]cloudprovider.ICloudImage, error)

func (*SStoragecache) GetId

func (self *SStoragecache) GetId() string

func (*SStoragecache) GetManagerId

func (self *SStoragecache) GetManagerId() string

func (*SStoragecache) GetMetadata

func (self *SStoragecache) GetMetadata() *jsonutils.JSONDict

func (*SStoragecache) GetName

func (self *SStoragecache) GetName() string

func (*SStoragecache) GetStatus

func (self *SStoragecache) GetStatus() string

func (*SStoragecache) IsEmulated

func (self *SStoragecache) IsEmulated() bool

func (*SStoragecache) Refresh

func (self *SStoragecache) Refresh() error

func (*SStoragecache) UploadImage

func (self *SStoragecache) UploadImage(userCred mcclient.TokenCredential, imageId string, osArch, osType, osDist string, extId string, isForce bool) (string, error)

type SVpc

type SVpc struct {
	CidrBlock       string
	CreatedTime     time.Time
	DhcpOptionsId   string
	DnsServerSet    []string
	DomainName      string
	EnableMulticast bool
	IsDefault       bool
	VpcId           string
	VpcName         string
	// contains filtered or unexported fields
}

func (*SVpc) Delete

func (self *SVpc) Delete() error

func (*SVpc) GetCidrBlock

func (self *SVpc) GetCidrBlock() string

func (*SVpc) GetGlobalId

func (self *SVpc) GetGlobalId() string

func (*SVpc) GetISecurityGroups

func (self *SVpc) GetISecurityGroups() ([]cloudprovider.ICloudSecurityGroup, error)

func (*SVpc) GetIWireById

func (self *SVpc) GetIWireById(wireId string) (cloudprovider.ICloudWire, error)

func (*SVpc) GetIWires

func (self *SVpc) GetIWires() ([]cloudprovider.ICloudWire, error)

func (*SVpc) GetId

func (self *SVpc) GetId() string

func (*SVpc) GetIsDefault

func (self *SVpc) GetIsDefault() bool

func (*SVpc) GetManagerId

func (self *SVpc) GetManagerId() string

func (*SVpc) GetMetadata

func (self *SVpc) GetMetadata() *jsonutils.JSONDict

func (*SVpc) GetName

func (self *SVpc) GetName() string

func (*SVpc) GetRegion

func (self *SVpc) GetRegion() cloudprovider.ICloudRegion

func (*SVpc) GetStatus

func (self *SVpc) GetStatus() string

func (*SVpc) IsEmulated

func (self *SVpc) IsEmulated() bool

func (*SVpc) Refresh

func (self *SVpc) Refresh() error

func (*SVpc) SyncSecurityGroup

func (self *SVpc) SyncSecurityGroup(secgroupId string, name string, rules []secrules.SecurityRule) (string, error)

type SWire

type SWire struct {
	// contains filtered or unexported fields
}

func (*SWire) CreateINetwork

func (self *SWire) CreateINetwork(name string, cidr string, desc string) (cloudprovider.ICloudNetwork, error)

func (*SWire) GetBandwidth

func (self *SWire) GetBandwidth() int

func (*SWire) GetGlobalId

func (self *SWire) GetGlobalId() string

func (*SWire) GetINetworkById

func (self *SWire) GetINetworkById(netid string) (cloudprovider.ICloudNetwork, error)

func (*SWire) GetINetworks

func (self *SWire) GetINetworks() ([]cloudprovider.ICloudNetwork, error)

func (*SWire) GetIVpc

func (self *SWire) GetIVpc() cloudprovider.ICloudVpc

func (*SWire) GetIZone

func (self *SWire) GetIZone() cloudprovider.ICloudZone

func (*SWire) GetId

func (self *SWire) GetId() string

func (*SWire) GetMetadata

func (self *SWire) GetMetadata() *jsonutils.JSONDict

func (*SWire) GetName

func (self *SWire) GetName() string

func (*SWire) GetNetworkById

func (self *SWire) GetNetworkById(networkId string) *SNetwork

func (*SWire) GetStatus

func (self *SWire) GetStatus() string

func (*SWire) IsEmulated

func (self *SWire) IsEmulated() bool

func (*SWire) Refresh

func (self *SWire) Refresh() error

type SZone

type SZone struct {
	Zone      string
	ZoneId    string
	ZoneName  string
	ZoneState string
	// contains filtered or unexported fields
}

func (*SZone) GetGlobalId

func (self *SZone) GetGlobalId() string

func (*SZone) GetIHostById

func (self *SZone) GetIHostById(id string) (cloudprovider.ICloudHost, error)

func (*SZone) GetIHosts

func (self *SZone) GetIHosts() ([]cloudprovider.ICloudHost, error)

func (*SZone) GetIRegion

func (self *SZone) GetIRegion() cloudprovider.ICloudRegion

func (*SZone) GetIStorageById

func (self *SZone) GetIStorageById(id string) (cloudprovider.ICloudStorage, error)

func (*SZone) GetIStorages

func (self *SZone) GetIStorages() ([]cloudprovider.ICloudStorage, error)

func (*SZone) GetIWires

func (self *SZone) GetIWires() ([]cloudprovider.ICloudWire, error)

func (*SZone) GetId

func (self *SZone) GetId() string

func (*SZone) GetMetadata

func (self *SZone) GetMetadata() *jsonutils.JSONDict

func (*SZone) GetName

func (self *SZone) GetName() string

func (*SZone) GetStatus

func (self *SZone) GetStatus() string

func (*SZone) IsEmulated

func (self *SZone) IsEmulated() bool

func (*SZone) Refresh

func (self *SZone) Refresh() error

type SecurityGroupPolicy

type SecurityGroupPolicy struct {
	PolicyIndex       int                          // 安全组规则索引号。
	Protocol          string                       // 协议, 取值: TCP,UDP, ICMP。
	Port              string                       // 端口(all, 离散port, range)。
	ServiceTemplate   ServiceTemplateSpecification // 协议端口ID或者协议端口组ID。ServiceTemplate和Protocol+Port互斥。
	CidrBlock         string                       // 网段或IP(互斥)。
	SecurityGroupId   string                       // 已绑定安全组的网段或IP。
	AddressTemplate   AddressTemplateSpecification // IP地址ID或者ID地址组ID。
	Action            string                       // ACCEPT 或 DROP。
	PolicyDescription string                       // 安全组规则描述。
	// contains filtered or unexported fields
}

func (*SecurityGroupPolicy) String

func (self *SecurityGroupPolicy) String() string

type SecurityGroupPolicySet

type SecurityGroupPolicySet struct {
	Version string
	Egress  []SecurityGroupPolicy //	出站规则。
	Ingress []SecurityGroupPolicy //	入站规则。
}

type SecurityGroupRuleSet

type SecurityGroupRuleSet []SecurityGroupPolicy

func (SecurityGroupRuleSet) Len

func (v SecurityGroupRuleSet) Len() int

func (SecurityGroupRuleSet) Less

func (v SecurityGroupRuleSet) Less(i, j int) bool

func (SecurityGroupRuleSet) Swap

func (v SecurityGroupRuleSet) Swap(i, j int)

type ServiceTemplateSpecification

type ServiceTemplateSpecification struct {
	ServiceId      string //	协议端口ID,例如:ppm-f5n1f8da。
	ServiceGroupId string //	协议端口组ID,例如:ppmg-f5n1f8da。
}

type SnapshotStatusType

type SnapshotStatusType string
const (
	SnapshotStatusAccomplished SnapshotStatusType = "NORMAL"
	SnapshotStatusProgress     SnapshotStatusType = "CREATING"
	SnapshotStatusFailed       SnapshotStatusType = "failed"
)

type SystemDisk

type SystemDisk struct {
	DiskType string  //系统盘类型。系统盘类型限制详见CVM实例配置。取值范围:LOCAL_BASIC:本地硬盘 LOCAL_SSD:本地SSD硬盘 CLOUD_BASIC:普通云硬盘 CLOUD_SSD:SSD云硬盘 CLOUD_PREMIUM:高性能云硬盘 默认取值:CLOUD_BASIC。
	DiskId   string  //	系统盘ID。LOCAL_BASIC 和 LOCAL_SSD 类型没有ID。暂时不支持该参数。
	DiskSize float32 //系统盘大小,单位:GB。默认值为 50
}

type TInternetChargeType

type TInternetChargeType string

type Tag

type Tag struct {
	Key   string
	Value string
}

type VirtualPrivateCloud

type VirtualPrivateCloud struct {
	VpcId              string   //	私有网络ID,形如vpc-xxx。有效的VpcId可通过登录控制台查询;也可以调用接口 DescribeVpcEx ,从接口返回中的unVpcId字段获取。
	SubnetId           string   //	私有网络子网ID,形如subnet-xxx。有效的私有网络子网ID可通过登录控制台查询;也可以调用接口 DescribeSubnets ,从接口返回中的unSubnetId字段获取。
	AsVpcGateway       bool     //	是否用作公网网关。公网网关只有在实例拥有公网IP以及处于私有网络下时才能正常使用。取值范围:TRUE:表示用作公网网关 FALSE:表示不用作公网网关 默认取值:FALSE。
	PrivateIpAddresses []string //	私有网络子网 IP 数组,在创建实例、修改实例vpc属性操作中可使用此参数。当前仅批量创建多台实例时支持传入相同子网的多个 IP。
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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