Documentation
¶
Index ¶
- Variables
- type ACLType
- type AliyunClient
- func (ac *AliyunClient) Close() error
- func (ac *AliyunClient) EcCreateSecurityGroup(regionId string, sg SecurityGroup) (string, error)
- func (ac *AliyunClient) EcCreateVps(regionId string, tmpl VpsCreationTmpl) (string, error)
- func (ac *AliyunClient) EcDeleteSecurityGroup(regionId, securityGroupId string) error
- func (ac *AliyunClient) EcDeleteVps(regionId string, vpsIds []string, force bool) error
- func (ac *AliyunClient) EcListImages(regionId string) ([]SysImage, error)
- func (ac *AliyunClient) EcListOnDemandSpecs(regionId string) (*VpsSpecList, error)
- func (ac *AliyunClient) EcListSecurityGroups(regionId string) ([]SecurityGroup, error)
- func (ac *AliyunClient) EcListSpotSpecs(regionId string) (*VpsSpecList, error)
- func (ac *AliyunClient) EcListSwitches(regionId, zoneId string) ([]string, error)
- func (ac *AliyunClient) EcListVps(regionId string) ([]VpsInfo, error)
- func (ac *AliyunClient) EcStartVps(regionId, vpsId string) error
- func (ac *AliyunClient) GetBalance() (*Balance, error)
- func (ac *AliyunClient) ListRegions() ([]string, error)
- func (ac *AliyunClient) ListZones(regionId string) ([]string, error)
- func (ac *AliyunClient) ObsDeleteBucket(regionId, bucketName string, deleteIfNotEmpty *bool) error
- func (ac *AliyunClient) ObsDeleteObject(regionId, bucketName, blobId string) error
- func (ac *AliyunClient) ObsGetObject(regionId, bucketName, blobId string) ([]byte, error)
- func (ac *AliyunClient) ObsGetObjectSize(regionId, bucketName, blobId string) (*gvolume.Volume, error)
- func (ac *AliyunClient) ObsIsBucketExist(regionId, bucketName string) (bool, error)
- func (ac *AliyunClient) ObsListBuckets(regionId string) ([]string, error)
- func (ac *AliyunClient) ObsListObjectKeys(regionId string, bucketName string) ([]string, error)
- func (ac *AliyunClient) ObsNewBucket(regionId, bucketName string) error
- func (ac *AliyunClient) ObsRenameObject(regionId, bucketName, oldObjectKey, newObjectKey string) error
- func (ac *AliyunClient) ObsScanObjectKeys(regionId, bucketName, pageToken string) ([]string, string, error)
- func (ac *AliyunClient) ObsUpsertObject(regionId, bucketName, blobId string, blob []byte) error
- func (ac *AliyunClient) SmsSendMsg(fromMobile, toMobile, message string) (err error)
- func (ac *AliyunClient) SmsSendTmpl(regionId string, mobiles []string, sign, tmpl string, params map[string]string) error
- type Auth
- type Balance
- type ChargeType
- type CheapestSpotVpsScanner
- type Cloud
- type Endpoint
- type GCPClient
- type InternetChargeType
- type Platform
- type PlatformInfo
- type Production
- type RegionInfo
- type Retry
- func (c *Retry) Close() (err error)
- func (c *Retry) EcCreateSecurityGroup(regionId string, sg SecurityGroup) (securityGroupId string, err error)
- func (c *Retry) EcCreateVps(regionId string, tmpl VpsCreationTmpl) (res string, err error)
- func (c *Retry) EcDeleteSecurityGroup(regionId, securityGroupId string) (err error)
- func (c *Retry) EcDeleteVps(regionId string, vpsIds []string, force bool) (err error)
- func (c *Retry) EcListImages(regionId string) (res []SysImage, err error)
- func (c *Retry) EcListSecurityGroups(regionId string) (res []SecurityGroup, err error)
- func (c *Retry) EcListSpotSpecs(regionId string) (res *VpsSpecList, err error)
- func (c *Retry) EcListSwitches(regionId, zoneId string) (res []string, err error)
- func (c *Retry) EcListVps(regionId string) (res []VpsInfo, err error)
- func (c *Retry) EcStartVps(regionId, vpsId string) (err error)
- func (c *Retry) GetBalance() (balance *Balance, err error)
- func (c *Retry) ListRegions() (names []string, err error)
- func (c *Retry) ListZones(regionId string) (names []string, err error)
- func (c *Retry) ObsDeleteBucket(regionId, bucketName string, deleteIfNotEmpty *bool) (err error)
- func (c *Retry) ObsDeleteObject(regionId, bucketName, blobId string) (err error)
- func (c *Retry) ObsGetObject(regionId, bucketName, blobId string) (val []byte, err error)
- func (c *Retry) ObsGetObjectSize(regionId, bucketName, objectKey string) (vol *gvolume.Volume, err error)
- func (c *Retry) ObsIsBucketExist(regionId, bucketName string) (exist bool, err error)
- func (c *Retry) ObsListBuckets(regionId string) (names []string, err error)
- func (c *Retry) ObsListObjectKeys(regionId, bucketName string) (keys []string, err error)
- func (c *Retry) ObsNewBucket(regionId, bucketName string) (err error)
- func (c *Retry) ObsRenameObject(regionId, bucketName, oldKey, newKey string) (err error)
- func (c *Retry) ObsScanObjectKeys(regionId, bucketName, pageToken string) (keys []string, nextPageToken string, err error)
- func (c *Retry) ObsUpsertObject(regionId, bucketName, blobId string, blob []byte) (err error)
- func (c *Retry) SetRetry(retry uint8)
- func (c *Retry) SetRetryInterval(dur time.Duration)
- func (c *Retry) SmsSendMsg(fromMobile, toMobile, message string) (err error)
- func (c *Retry) SmsSendTmpl(regionId string, mobiles []string, sign, tmpl string, params map[string]string) (err error)
- type RetryCloud
- type SecurityGroup
- type SecurityPermission
- type SpotStrategy
- type SysImage
- type TwilioClient
- func (t *TwilioClient) Close() error
- func (t *TwilioClient) EcCreateSecurityGroup(regionId string, sg SecurityGroup) (string, error)
- func (t *TwilioClient) EcCreateVps(regionId string, tmpl VpsCreationTmpl) (string, error)
- func (t *TwilioClient) EcDeleteSecurityGroup(regionId, securityGroupId string) error
- func (t *TwilioClient) EcDeleteVps(regionId string, vpsIds []string, force bool) error
- func (t *TwilioClient) EcListImages(regionId string) ([]SysImage, error)
- func (t *TwilioClient) EcListSecurityGroups(regionId string) ([]SecurityGroup, error)
- func (t *TwilioClient) EcListSpotSpecs(regionId string) (*VpsSpecList, error)
- func (t *TwilioClient) EcListSwitches(regionId, zoneId string) ([]string, error)
- func (t *TwilioClient) EcListVps(regionId string) ([]VpsInfo, error)
- func (t *TwilioClient) EcStartVps(regionId, vpsId string) error
- func (t *TwilioClient) FcListFunctions(regionId, service string) ([]string, error)
- func (t *TwilioClient) GetBalance() (*Balance, error)
- func (t *TwilioClient) ListRegions() ([]string, error)
- func (t *TwilioClient) ListZones(regionId string) ([]string, error)
- func (t *TwilioClient) ObsDeleteBucket(regionId, bucketName string, deleteIfNotEmpty *bool) error
- func (t *TwilioClient) ObsDeleteObject(regionId, bucketName, objectKey string) error
- func (t *TwilioClient) ObsGetObject(regionId, bucketName, objectKey string) ([]byte, error)
- func (t *TwilioClient) ObsGetObjectSize(regionId, bucketName, objectKey string) (*gvolume.Volume, error)
- func (t *TwilioClient) ObsIsBucketExist(regionId, bucketName string) (bool, error)
- func (t *TwilioClient) ObsListBuckets(regionId string) ([]string, error)
- func (t *TwilioClient) ObsListObjectKeys(regionId string, bucketName string) ([]string, error)
- func (t *TwilioClient) ObsNewBucket(regionId, bucketName string) error
- func (t *TwilioClient) ObsRenameObject(regionId, bucketName, oldObjectKey, newObjectKey string) error
- func (t *TwilioClient) ObsScanObjectKeys(regionId, bucketName, pageToken string) ([]string, string, error)
- func (t *TwilioClient) ObsUpsertObject(regionId, bucketName, objectKey string, objectVal []byte) error
- func (t *TwilioClient) SmsSendMsg(fromMobile, toMobile, message string) error
- func (t *TwilioClient) SmsSendTmpl(regionId string, mobiles []string, sign, tmpl string, params map[string]string) error
- type VpsCreationTmpl
- type VpsInfo
- type VpsSpec
- type VpsSpecEx
- type VpsSpecExList
- type VpsSpecList
Constants ¶
This section is empty.
Variables ¶
View Source
var ( VPS = Production("vps") OBS = Production("obs") FC = Production("fc") Aliyun = enrollPlatform("aliyun", PlatformInfo{SupportPrepaid: true, SupportPostpaid: false}) AWS = enrollPlatform("aws", PlatformInfo{SupportPrepaid: false, SupportPostpaid: true}) GCP = enrollPlatform("gcp", PlatformInfo{SupportPrepaid: false, SupportPostpaid: true}) Twilio = enrollPlatform("twilio", PlatformInfo{SupportPrepaid: true, SupportPostpaid: false}) )
View Source
var ( PrePaid = ChargeType("prepaid") // Yearly package or monthly package. PostPaid = ChargeType("postpaid") // Pay on demand. PayByBandwidth = InternetChargeType("PayByBandwidth") PayByTraffic = InternetChargeType("PayByTraffic") SpotWithMaxPrice = SpotStrategy("SpotWithMaxPrice") SpotAsPriceGo = SpotStrategy("SpotAsPriceGo") )
Functions ¶
This section is empty.
Types ¶
type ACLType ¶
type ACLType string
ACLType bucket/object ACL
const ( // ACLPrivate definition : private read and write ACLPrivate ACLType = "private" // ACLPublicRead definition : public read and private write ACLPublicRead ACLType = "public-read" // ACLPublicReadWrite definition : public read and public write ACLPublicReadWrite ACLType = "public-read-write" )
type AliyunClient ¶
type AliyunClient struct {
// contains filtered or unexported fields
}
func (*AliyunClient) Close ¶
func (ac *AliyunClient) Close() error
func (*AliyunClient) EcCreateSecurityGroup ¶
func (ac *AliyunClient) EcCreateSecurityGroup(regionId string, sg SecurityGroup) (string, error)
func (*AliyunClient) EcCreateVps ¶
func (ac *AliyunClient) EcCreateVps(regionId string, tmpl VpsCreationTmpl) (string, error)
func (*AliyunClient) EcDeleteSecurityGroup ¶
func (ac *AliyunClient) EcDeleteSecurityGroup(regionId, securityGroupId string) error
func (*AliyunClient) EcDeleteVps ¶
func (ac *AliyunClient) EcDeleteVps(regionId string, vpsIds []string, force bool) error
func (*AliyunClient) EcListImages ¶
func (ac *AliyunClient) EcListImages(regionId string) ([]SysImage, error)
func (*AliyunClient) EcListOnDemandSpecs ¶
func (ac *AliyunClient) EcListOnDemandSpecs(regionId string) (*VpsSpecList, error)
func (*AliyunClient) EcListSecurityGroups ¶
func (ac *AliyunClient) EcListSecurityGroups(regionId string) ([]SecurityGroup, error)
func (*AliyunClient) EcListSpotSpecs ¶
func (ac *AliyunClient) EcListSpotSpecs(regionId string) (*VpsSpecList, error)
func (*AliyunClient) EcListSwitches ¶
func (ac *AliyunClient) EcListSwitches(regionId, zoneId string) ([]string, error)
func (*AliyunClient) EcListVps ¶
func (ac *AliyunClient) EcListVps(regionId string) ([]VpsInfo, error)
func (*AliyunClient) EcStartVps ¶
func (ac *AliyunClient) EcStartVps(regionId, vpsId string) error
func (*AliyunClient) GetBalance ¶
func (ac *AliyunClient) GetBalance() (*Balance, error)
func (*AliyunClient) ListRegions ¶
func (ac *AliyunClient) ListRegions() ([]string, error)
func (*AliyunClient) ListZones ¶
func (ac *AliyunClient) ListZones(regionId string) ([]string, error)
func (*AliyunClient) ObsDeleteBucket ¶
func (ac *AliyunClient) ObsDeleteBucket(regionId, bucketName string, deleteIfNotEmpty *bool) error
func (*AliyunClient) ObsDeleteObject ¶
func (ac *AliyunClient) ObsDeleteObject(regionId, bucketName, blobId string) error
func (*AliyunClient) ObsGetObject ¶
func (ac *AliyunClient) ObsGetObject(regionId, bucketName, blobId string) ([]byte, error)
func (*AliyunClient) ObsGetObjectSize ¶
func (ac *AliyunClient) ObsGetObjectSize(regionId, bucketName, blobId string) (*gvolume.Volume, error)
func (*AliyunClient) ObsIsBucketExist ¶
func (ac *AliyunClient) ObsIsBucketExist(regionId, bucketName string) (bool, error)
func (*AliyunClient) ObsListBuckets ¶
func (ac *AliyunClient) ObsListBuckets(regionId string) ([]string, error)
func (*AliyunClient) ObsListObjectKeys ¶
func (ac *AliyunClient) ObsListObjectKeys(regionId string, bucketName string) ([]string, error)
func (*AliyunClient) ObsNewBucket ¶
func (ac *AliyunClient) ObsNewBucket(regionId, bucketName string) error
func (*AliyunClient) ObsRenameObject ¶
func (ac *AliyunClient) ObsRenameObject(regionId, bucketName, oldObjectKey, newObjectKey string) error
func (*AliyunClient) ObsScanObjectKeys ¶
func (ac *AliyunClient) ObsScanObjectKeys(regionId, bucketName, pageToken string) ([]string, string, error)
func (*AliyunClient) ObsUpsertObject ¶
func (ac *AliyunClient) ObsUpsertObject(regionId, bucketName, blobId string, blob []byte) error
func (*AliyunClient) SmsSendMsg ¶
func (ac *AliyunClient) SmsSendMsg(fromMobile, toMobile, message string) (err error)
func (*AliyunClient) SmsSendTmpl ¶
type CheapestSpotVpsScanner ¶
type CheapestSpotVpsScanner struct {
// contains filtered or unexported fields
}
func NewCheapestSpotVpsScanner ¶
func NewCheapestSpotVpsScanner(cli Cloud) *CheapestSpotVpsScanner
func (*CheapestSpotVpsScanner) GetCheapestNonCreditSpotVpsSpec ¶
func (s *CheapestSpotVpsScanner) GetCheapestNonCreditSpotVpsSpec() *VpsSpecExList
func (*CheapestSpotVpsScanner) Scan ¶
func (s *CheapestSpotVpsScanner) Scan() error
type Cloud ¶
type Cloud interface {
ListRegions() ([]string, error)
ListZones(regionId string) ([]string, error)
GetBalance() (*Balance, error)
EcListSpotSpecs(regionId string) (*VpsSpecList, error)
EcListImages(regionId string) ([]SysImage, error)
EcListVps(regionId string) ([]VpsInfo, error)
EcListSecurityGroups(regionId string) ([]SecurityGroup, error)
EcCreateSecurityGroup(regionId string, sg SecurityGroup) (string, error)
EcDeleteSecurityGroup(regionId, securityGroupId string) error
EcListSwitches(regionId, zoneId string) ([]string, error)
EcCreateVps(regionId string, tmpl VpsCreationTmpl) (string, error)
EcStartVps(regionId, vpsId string) error
EcDeleteVps(regionId string, vpsIds []string, force bool) error
ObsIsBucketExist(regionId, bucketName string) (bool, error)
ObsNewBucket(regionId, bucketName string) error
ObsDeleteBucket(regionId, bucketName string, deleteIfNotEmpty *bool) error
ObsListBuckets(regionId string) ([]string, error)
ObsListObjectKeys(regionId, bucketName string) ([]string, error)
ObsScanObjectKeys(regionId, bucketName, pageToken string) ([]string, string, error)
ObsGetObjectSize(regionId, bucketName, objectKey string) (*gvolume.Volume, error)
ObsGetObject(regionId, bucketName, objectKey string) ([]byte, error)
ObsUpsertObject(regionId, bucketName, objectKey string, objectVal []byte) error
ObsRenameObject(regionId, bucketName, oldObjectKey, newObjectKey string) error
ObsDeleteObject(regionId, bucketName, objectKey string) error
SmsSendTmpl(regionId string, mobiles []string, sign, tmpl string, params map[string]string) error
SmsSendMsg(fromMobile, toMobile, message string) error
Close() error
}
TODO:RegionId 要不要优化掉 AWS Lambda的demo https://github.com/razeone/serverless-blog-api/blob/master/hello/main.go
type PlatformInfo ¶
type Production ¶
type Production string
type RegionInfo ¶
type RegionInfo struct {
Country string
City string
Endpoints map[Production]Endpoint
}
type Retry ¶
type Retry struct {
// contains filtered or unexported fields
}
func (*Retry) EcCreateSecurityGroup ¶
func (c *Retry) EcCreateSecurityGroup(regionId string, sg SecurityGroup) (securityGroupId string, err error)
func (*Retry) EcCreateVps ¶
func (c *Retry) EcCreateVps(regionId string, tmpl VpsCreationTmpl) (res string, err error)
func (*Retry) EcDeleteSecurityGroup ¶
func (*Retry) EcDeleteVps ¶
func (*Retry) EcListImages ¶
func (*Retry) EcListSecurityGroups ¶
func (c *Retry) EcListSecurityGroups(regionId string) (res []SecurityGroup, err error)
func (*Retry) EcListSpotSpecs ¶
func (c *Retry) EcListSpotSpecs(regionId string) (res *VpsSpecList, err error)
func (*Retry) EcListSwitches ¶
func (*Retry) EcStartVps ¶
func (*Retry) GetBalance ¶
func (*Retry) ListRegions ¶
func (*Retry) ObsDeleteBucket ¶
func (*Retry) ObsDeleteObject ¶
func (*Retry) ObsGetObject ¶
func (*Retry) ObsGetObjectSize ¶
func (*Retry) ObsIsBucketExist ¶
func (*Retry) ObsListBuckets ¶
func (*Retry) ObsListObjectKeys ¶
func (*Retry) ObsNewBucket ¶
func (*Retry) ObsRenameObject ¶
func (*Retry) ObsScanObjectKeys ¶
func (*Retry) ObsUpsertObject ¶
func (*Retry) SetRetryInterval ¶
func (*Retry) SmsSendMsg ¶
type RetryCloud ¶
type SecurityGroup ¶
type SecurityGroup struct {
Id string
Name string
Permissions []SecurityPermission
}
type SecurityPermission ¶
type TwilioClient ¶
type TwilioClient struct {
// contains filtered or unexported fields
}
func (*TwilioClient) Close ¶
func (t *TwilioClient) Close() error
func (*TwilioClient) EcCreateSecurityGroup ¶
func (t *TwilioClient) EcCreateSecurityGroup(regionId string, sg SecurityGroup) (string, error)
func (*TwilioClient) EcCreateVps ¶
func (t *TwilioClient) EcCreateVps(regionId string, tmpl VpsCreationTmpl) (string, error)
func (*TwilioClient) EcDeleteSecurityGroup ¶
func (t *TwilioClient) EcDeleteSecurityGroup(regionId, securityGroupId string) error
func (*TwilioClient) EcDeleteVps ¶
func (t *TwilioClient) EcDeleteVps(regionId string, vpsIds []string, force bool) error
func (*TwilioClient) EcListImages ¶
func (t *TwilioClient) EcListImages(regionId string) ([]SysImage, error)
func (*TwilioClient) EcListSecurityGroups ¶
func (t *TwilioClient) EcListSecurityGroups(regionId string) ([]SecurityGroup, error)
func (*TwilioClient) EcListSpotSpecs ¶
func (t *TwilioClient) EcListSpotSpecs(regionId string) (*VpsSpecList, error)
func (*TwilioClient) EcListSwitches ¶
func (t *TwilioClient) EcListSwitches(regionId, zoneId string) ([]string, error)
func (*TwilioClient) EcListVps ¶
func (t *TwilioClient) EcListVps(regionId string) ([]VpsInfo, error)
func (*TwilioClient) EcStartVps ¶
func (t *TwilioClient) EcStartVps(regionId, vpsId string) error
func (*TwilioClient) FcListFunctions ¶
func (t *TwilioClient) FcListFunctions(regionId, service string) ([]string, error)
func (*TwilioClient) GetBalance ¶
func (t *TwilioClient) GetBalance() (*Balance, error)
Reference: https://github.com/e154/smart-home/blob/08bfcca81c321b893cad87842a4ea40713f62e09/system/twilio/twilio.go#L102 Get balance.
func (*TwilioClient) ListRegions ¶
func (t *TwilioClient) ListRegions() ([]string, error)
func (*TwilioClient) ListZones ¶
func (t *TwilioClient) ListZones(regionId string) ([]string, error)
func (*TwilioClient) ObsDeleteBucket ¶
func (t *TwilioClient) ObsDeleteBucket(regionId, bucketName string, deleteIfNotEmpty *bool) error
func (*TwilioClient) ObsDeleteObject ¶
func (t *TwilioClient) ObsDeleteObject(regionId, bucketName, objectKey string) error
func (*TwilioClient) ObsGetObject ¶
func (t *TwilioClient) ObsGetObject(regionId, bucketName, objectKey string) ([]byte, error)
func (*TwilioClient) ObsGetObjectSize ¶
func (t *TwilioClient) ObsGetObjectSize(regionId, bucketName, objectKey string) (*gvolume.Volume, error)
func (*TwilioClient) ObsIsBucketExist ¶
func (t *TwilioClient) ObsIsBucketExist(regionId, bucketName string) (bool, error)
func (*TwilioClient) ObsListBuckets ¶
func (t *TwilioClient) ObsListBuckets(regionId string) ([]string, error)
func (*TwilioClient) ObsListObjectKeys ¶
func (t *TwilioClient) ObsListObjectKeys(regionId string, bucketName string) ([]string, error)
func (*TwilioClient) ObsNewBucket ¶
func (t *TwilioClient) ObsNewBucket(regionId, bucketName string) error
func (*TwilioClient) ObsRenameObject ¶
func (t *TwilioClient) ObsRenameObject(regionId, bucketName, oldObjectKey, newObjectKey string) error
func (*TwilioClient) ObsScanObjectKeys ¶
func (t *TwilioClient) ObsScanObjectKeys(regionId, bucketName, pageToken string) ([]string, string, error)
func (*TwilioClient) ObsUpsertObject ¶
func (t *TwilioClient) ObsUpsertObject(regionId, bucketName, objectKey string, objectVal []byte) error
func (*TwilioClient) SmsSendMsg ¶
func (t *TwilioClient) SmsSendMsg(fromMobile, toMobile, message string) error
Send SMS.
func (*TwilioClient) SmsSendTmpl ¶
type VpsCreationTmpl ¶
type VpsCreationTmpl struct {
// Zone Id like "cn-hangzhou-c"
ZoneId string
// Start a spot instance.
IsSpot bool
// Open spot instance protection duration, only available on aliyun for now.
// If open "OpenSpotDuration", price will be about a little (10% on aliyun) higher than closing it.
OpenSpotDuration bool
// "SwitchId" required in "vpc" network type, and now only "vpc" network type supported on aliyun,
// "classic" network type is fading away, so "SwitchId" is required.
SwitchId string
// Instance specs like "ecs.g5.large".
Specs string
// Instance name like "my-instance-temp-name".
Name string
// OS image Id like "ubuntu_20_04_x64_20G_alibase_20201120.vhd".
ImageId string
SecurityGroupId string
KeyPair string
Password string
SystemDiskGB int
VpsCharge ChargeType
InternetCharge InternetChargeType
BandWidthMbIn int
BandWidthMbOut int
SpotStrategy SpotStrategy
SpotMaxPrice gdecimal.Decimal
// true: unlimited performance mode, false: limited performance mode.
// Available param option on aliyun.
UnlimitedPerformance bool
}
Create VPS template.
func (VpsCreationTmpl) Verify ¶
func (t VpsCreationTmpl) Verify(platform Platform) error
type VpsInfo ¶
type VpsInfo struct {
Id string
Name string
Specs string // "ecs.g5.large"
InstanceChargeType ChargeType
InternetChargeType ChargeType
SpotPriceLimit float64
SpotStrategy string
SpotStartTime time.Time
NetworkType string // "classic", "vpc"
PrivateIPs []string
PublicIPs []string
RegionId string
ZoneId string
SecurityGroupIds []string
ImageId string
Status string
KeyPairName string
PhysicalCpuNum int
LogicalCpuNum int
GpuNum int
CreationTime time.Time
AutoReleaseTime time.Time
MemorySize gvolume.Volume
SysImageId string
SysImageName string
SysImageOS string
}
Instance is a nested struct in ecs response.
type VpsSpec ¶
type VpsSpec struct {
RegionId string
Id string
IsCredit bool // Is credit instance(突发性能实例) or normal instance.
Currency string
LogicalCpuNum int
MemoryVolume gvolume.Volume
AvailableZoneIds []string
OnDemandPrices map[string]gdecimal.Decimal
SpotPricePerHour map[string]gdecimal.Decimal
}
Instance specification.
type VpsSpecExList ¶
type VpsSpecExList struct {
SpecExs []VpsSpecEx
}
func (*VpsSpecExList) Append ¶
func (vl *VpsSpecExList) Append(newList *VpsSpecExList) *VpsSpecExList
func (VpsSpecExList) Len ¶
func (vl VpsSpecExList) Len() int
func (VpsSpecExList) Less ¶
func (vl VpsSpecExList) Less(i, j int) bool
func (*VpsSpecExList) RemoveCreditInstance ¶
func (vl *VpsSpecExList) RemoveCreditInstance() *VpsSpecExList
func (*VpsSpecExList) Sort ¶
func (vl *VpsSpecExList) Sort() *VpsSpecExList
func (VpsSpecExList) Swap ¶
func (vl VpsSpecExList) Swap(i, j int)
type VpsSpecList ¶
type VpsSpecList struct {
Specs []VpsSpec
}
func (*VpsSpecList) ToSpecExList ¶
func (vsl *VpsSpecList) ToSpecExList() *VpsSpecExList
Click to show internal directories.
Click to hide internal directories.