ecloud

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLOUD_PROVIDER_ECLOUD    = api.CLOUD_PROVIDER_ECLOUD
	CLOUD_PROVIDER_ECLOUD_CN = "移动云"
	CLOUD_PROVIDER_ECLOUD_EN = "Ecloud"
	CLOUD_API_VERSION        = "2016-12-05"

	ECLOUD_DEFAULT_REGION = "beijing-1"
)
View Source
const (
	MONITOR_FETCH_REQUEST_ACTION   = "v1.dawn.monitor.fetch"
	MONITOR_PRODUCT_REQUEST_ACTION = "v1.dawn.monitor.products"

	MONITOR_FETCH_SERVER_PATH = "/api/edw/edw/api"

	REQUEST_SUCCESS_CODE = "000000"
)

Variables

View Source
var LatitudeAndLongitude = map[string]cloudprovider.SGeographicInfo{
	"guangzhou-2": {Latitude: 23.129110, Longitude: 113.264381, City: api.CITY_GUANG_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"beijing-1":   {Latitude: 39.904202, Longitude: 116.407394, City: api.CITY_BEI_JING, CountryCode: api.COUNTRY_CODE_CN},
	"hunan-1":     {Latitude: 28.2277765095, Longitude: 112.9388453666, City: api.CITY_CHANG_SHA, CountryCode: api.COUNTRY_CODE_CN},
	"wuxi-1":      {Latitude: 31.2983479333, Longitude: 120.5831894861, City: api.CITY_SU_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"dongguan-1":  api.RegionSuzhou,
	"yaan-1":      {Latitude: 30.572815, Longitude: 104.066803, City: api.CITY_CHENG_DU, CountryCode: api.COUNTRY_CODE_CN},
	"zhengzhou-1": {Latitude: 34.7533581487, Longitude: 113.6313915479, City: api.CITY_ZHENG_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"beijing-2":   {Latitude: 39.904202, Longitude: 116.407394, City: api.CITY_BEI_JING, CountryCode: api.COUNTRY_CODE_CN},
	"zhuzhou-1":   {Latitude: 28.2277765095, Longitude: 112.9388453666, City: api.CITY_CHANG_SHA, CountryCode: api.COUNTRY_CODE_CN},
	"jinan-1":     {Latitude: 36.64889911073425, Longitude: 117.11905617575435, City: api.CITY_JI_NAM, CountryCode: api.COUNTRY_CODE_CN},
	"xian-1":      {Latitude: 34.3412614674, Longitude: 108.9398165260, City: api.CITY_XI_AN, CountryCode: api.COUNTRY_CODE_CN},
	"shanghai-1":  {Latitude: 31.210344, Longitude: 121.455364, City: api.CITY_SHANG_HAI, CountryCode: api.COUNTRY_CODE_CN},
	"chongqing-1": {Latitude: 29.431585, Longitude: 106.912254, City: api.CITY_CHONG_QING, CountryCode: api.COUNTRY_CODE_CN},
	"ningbo-1":    {Latitude: 30.274084, Longitude: 120.155067, City: api.CITY_HANG_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"tianjin-1":   {Latitude: 39.0850853357, Longitude: 117.1993482089, City: api.CITY_TIAN_JIN, CountryCode: api.COUNTRY_CODE_CN},
	"jilin-1":     {Latitude: 43.87120919729674, Longitude: 125.3111129463539, City: api.CITY_CHANG_CHUN, CountryCode: api.COUNTRY_CODE_CN},
	"hubei-1":     {Latitude: 32.009075721852206, Longitude: 112.13485327119795, City: api.CITY_XIANG_YANG, CountryCode: api.COUNTRY_CODE_CN},
	"jiangxi-1":   {Latitude: 28.66278309381472, Longitude: 115.82816199879247, City: api.CITY_NAN_CHANG, CountryCode: api.COUNTRY_CODE_CN},
	"gansu-1":     {Latitude: 36.0613769373, Longitude: 103.8341600069, City: api.CITY_LAN_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"shanxi-1":    {Latitude: 37.8705857132, Longitude: 112.5506634865, City: api.CITY_TAI_YUAN, CountryCode: api.COUNTRY_CODE_CN},
	"liaoning-1":  {Latitude: 41.78937667917192, Longitude: 123.43099727316815, City: api.CITY_SHEN_YANG, CountryCode: api.COUNTRY_CODE_CN},
	"yunnan-2":    {Latitude: 24.8796595146, Longitude: 102.8332118852, City: api.CITY_KUN_MING, CountryCode: api.COUNTRY_CODE_CN},
	"hebei-1":     {Latitude: 38.044044256466684, Longitude: 114.50225031469532, City: api.CITY_SHI_JIA_ZHUANG, CountryCode: api.COUNTRY_CODE_CN},
	"fujian-1":    {Latitude: 24.478556505708365, Longitude: 118.0875755539503, City: api.CITY_XIA_MEN, CountryCode: api.COUNTRY_CODE_CN},
	"guangxi-1":   {Latitude: 22.8167372565, Longitude: 108.3669005333, City: api.CITY_NAN_NING, CountryCode: api.COUNTRY_CODE_CN},
	"anhui-1":     {Latitude: 32.62657438299575, Longitude: 116.99779954519057, City: api.CITY_HUAI_NAN, CountryCode: api.COUNTRY_CODE_CN},
	"huhehaote-1": {Latitude: 40.842358, Longitude: 111.749992, City: api.CITY_HU_HE_HAO_TE, CountryCode: api.COUNTRY_CODE_CN},
	"guiyang-1":   {Latitude: 26.6470035286, Longitude: 106.6302113880, City: api.CITY_GUI_YANG, CountryCode: api.COUNTRY_CODE_CN},
}

Functions

This section is empty.

Types

type Datapoint

type Datapoint []string

type EcloudTags

type EcloudTags struct {
}

func (*EcloudTags) GetSysTags

func (self *EcloudTags) GetSysTags() map[string]string

func (*EcloudTags) GetTags

func (self *EcloudTags) GetTags() (map[string]string, error)

func (*EcloudTags) SetTags

func (self *EcloudTags) SetTags(tags map[string]string, replace bool) error

type Entity

type Entity struct {
	ResourceID         string      `json:"resourceId"`
	MetricName         string      `json:"metricName"`
	MetricNameCN       string      `json:"metricNameCn"`
	Unit               string      `json:"unit"`
	MaxValue           int64       `json:"maxValue"`
	AvgValue           int64       `json:"avgValue"`
	MinValue           int64       `json:"minValue"`
	Granularity        string      `json:"granularity"`
	PolymerizeType     string      `json:"polymerizeType"`
	SelectedMetricItem interface{} `json:"selectedMetricItem"`
	MetricItems        interface{} `json:"metricItems"`
	IsChildnode        bool        `json:"isChildnode"`
	Datapoints         []Datapoint `json:"datapoints"`
}

type ErrMissKey

type ErrMissKey struct {
	Key string
	Jo  jsonutils.JSONObject
}

func (ErrMissKey) Error

func (mk ErrMissKey) Error() string

type IRequest

type IRequest interface {
	GetScheme() string
	GetMethod() string
	SetMethod(string)
	GetEndpoint() string
	GetServerPath() string
	GetPort() string
	GetRegionId() string
	GetHeaders() map[string]string
	GetQueryParams() map[string]string
	GetBodyReader() io.Reader
	GetVersion() string
	GetTimestamp() string
	GetReadTimeout() time.Duration
	GetConnectTimeout() time.Duration
	GetHTTPSInsecure() bool
	SetHTTPSInsecure(bool)
	GetUserAgent() map[string]string
	ForMateResponseBody(jrbody jsonutils.JSONObject) (jsonutils.JSONObject, error)
}

type ISigner

type ISigner interface {
	GetName() string
	GetVersion() string
	GetAccessKeyId() string
	GetNonce() string
	Sign(stringToSign, secretPrefix string) string
}

type Metric

type Metric struct {
	Name string `json:"MetricName"`
}

type MetricData

type MetricData struct {
	Entitys []Entity `json:"entity"`
}

type SApiRequest

type SApiRequest struct {
	SJSONRequest
	RegionId string
}

func NewApiRequest

func NewApiRequest(regionId string, serverPath string, query map[string]string, data jsonutils.JSONObject) *SApiRequest

func (*SApiRequest) GetEndpoint

func (rr *SApiRequest) GetEndpoint() string

func (*SApiRequest) GetPort

func (rr *SApiRequest) GetPort() string

func (*SApiRequest) GetScheme

func (rr *SApiRequest) GetScheme() string

type SBaseRequest

type SBaseRequest struct {
	Scheme         string
	Method         string
	Endpoint       string
	ServerPath     string
	Port           string
	RegionId       string
	ReadTimeout    time.Duration
	ConnectTimeout time.Duration

	QueryParams map[string]string
	Headers     map[string]string
	Content     []byte
	// contains filtered or unexported fields
}

func NewBaseRequest

func NewBaseRequest() *SBaseRequest

func (*SBaseRequest) ForMateResponseBody

func (br *SBaseRequest) ForMateResponseBody(jrbody jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SBaseRequest) GetBodyReader

func (br *SBaseRequest) GetBodyReader() io.Reader

func (*SBaseRequest) GetConnectTimeout

func (br *SBaseRequest) GetConnectTimeout() time.Duration

func (*SBaseRequest) GetEndpoint

func (br *SBaseRequest) GetEndpoint() string

func (*SBaseRequest) GetHTTPSInsecure

func (br *SBaseRequest) GetHTTPSInsecure() bool

func (*SBaseRequest) GetHeaders

func (br *SBaseRequest) GetHeaders() map[string]string

func (*SBaseRequest) GetMethod

func (br *SBaseRequest) GetMethod() string

func (*SBaseRequest) GetPort

func (br *SBaseRequest) GetPort() string

func (*SBaseRequest) GetQueryParams

func (br *SBaseRequest) GetQueryParams() map[string]string

func (*SBaseRequest) GetReadTimeout

func (br *SBaseRequest) GetReadTimeout() time.Duration

func (*SBaseRequest) GetRegionId

func (br *SBaseRequest) GetRegionId() string

func (*SBaseRequest) GetScheme

func (br *SBaseRequest) GetScheme() string

func (*SBaseRequest) GetServerPath

func (br *SBaseRequest) GetServerPath() string

func (*SBaseRequest) GetTimestamp

func (br *SBaseRequest) GetTimestamp() string

func (*SBaseRequest) GetUserAgent

func (br *SBaseRequest) GetUserAgent() map[string]string

func (*SBaseRequest) GetVersion

func (br *SBaseRequest) GetVersion() string

func (*SBaseRequest) SetHTTPSInsecure

func (br *SBaseRequest) SetHTTPSInsecure(isInsecure bool)

func (*SBaseRequest) SetMethod

func (br *SBaseRequest) SetMethod(method string)

type SConsoleRequest

type SConsoleRequest struct {
	SJSONRequest
	RegionId string
}

func NewConsoleRequest

func NewConsoleRequest(regionId string, serverPath string, query map[string]string, data jsonutils.JSONObject) *SConsoleRequest

func (*SConsoleRequest) GetEndpoint

func (rr *SConsoleRequest) GetEndpoint() string

func (*SConsoleRequest) GetPort

func (rr *SConsoleRequest) GetPort() string

func (*SConsoleRequest) GetScheme

func (rr *SConsoleRequest) GetScheme() string

type SCreateTime

type SCreateTime struct {
	CreatedTime string
}

func (*SCreateTime) GetCreatedAt

func (c *SCreateTime) GetCreatedAt() time.Time

type SDisk

type SDisk struct {
	multicloud.SDisk
	EcloudTags
	multicloud.SBillingBase
	SZoneRegionBase
	SCreateTime

	ManualAttr SDiskManualAttr

	// 硬盘可挂载主机类型
	AttachServerTypes []string
	AvailabilityZone  string
	BackupId          string
	Description       string
	ID                string
	IsDelete          bool
	IsShare           bool
	// 磁盘所在集群的ID
	Metadata      string
	Name          string
	OperationFlag string
	// 硬盘挂在主机ID列表
	ServerId       []string
	SizeGB         int `json:"size"`
	SourceVolumeId string
	Status         string
	Type           string
	VolumeType     string
	Iscsi          bool
	ProductType    string
	// contains filtered or unexported fields
}

func (*SDisk) CreateISnapshot

func (s *SDisk) CreateISnapshot(ctx context.Context, name string, desc string) (cloudprovider.ICloudSnapshot, error)

func (*SDisk) Delete

func (s *SDisk) Delete(ctx context.Context) error

func (*SDisk) GetAccessPath

func (s *SDisk) GetAccessPath() string

func (*SDisk) GetBillingType

func (d *SDisk) GetBillingType() string

func (*SDisk) GetCacheMode

func (s *SDisk) GetCacheMode() string

func (*SDisk) GetCreatedAt

func (d *SDisk) GetCreatedAt() time.Time

func (*SDisk) GetDiskFormat

func (s *SDisk) GetDiskFormat() string

func (*SDisk) GetDiskSizeMB

func (s *SDisk) GetDiskSizeMB() int

func (*SDisk) GetDiskType

func (s *SDisk) GetDiskType() string

func (*SDisk) GetDriver

func (s *SDisk) GetDriver() string

func (*SDisk) GetExpiredAt

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

func (*SDisk) GetFsFormat

func (s *SDisk) GetFsFormat() string

func (*SDisk) GetGlobalId

func (d *SDisk) GetGlobalId() string

func (*SDisk) GetISnapshot

func (s *SDisk) GetISnapshot(id string) (cloudprovider.ICloudSnapshot, error)

func (*SDisk) GetISnapshots

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

func (*SDisk) GetIStorage

func (s *SDisk) GetIStorage() (cloudprovider.ICloudStorage, error)

func (*SDisk) GetId

func (d *SDisk) GetId() string

func (*SDisk) GetIsAutoDelete

func (s *SDisk) GetIsAutoDelete() bool

func (*SDisk) GetIsNonPersistent

func (s *SDisk) GetIsNonPersistent() bool

func (*SDisk) GetMountpoint

func (s *SDisk) GetMountpoint() string

func (*SDisk) GetName

func (d *SDisk) GetName() string

func (*SDisk) GetProjectId

func (s *SDisk) GetProjectId() string

func (*SDisk) GetStatus

func (d *SDisk) GetStatus() string

func (*SDisk) GetSysTags

func (s *SDisk) GetSysTags() map[string]string

func (*SDisk) GetTemplateId

func (s *SDisk) GetTemplateId() string

func (*SDisk) IsEmulated

func (d *SDisk) IsEmulated() bool

func (*SDisk) Rebuild

func (s *SDisk) Rebuild(ctx context.Context) error

func (*SDisk) Refresh

func (d *SDisk) Refresh() error

func (*SDisk) Reset

func (s *SDisk) Reset(ctx context.Context, snapshotId string) (string, error)

func (*SDisk) Resize

func (s *SDisk) Resize(ctx context.Context, newSizeMB int64) error

type SDiskManualAttr

type SDiskManualAttr struct {
	IsVirtual  bool
	TempalteId string
	ServerId   string
}

type SEcloudClient

type SEcloudClient struct {
	*SEcloudClientConfig
	// contains filtered or unexported fields
}

func NewEcloudClient

func NewEcloudClient(cfg *SEcloudClientConfig) (*SEcloudClient, error)

func (*SEcloudClient) DescribeMetricList

func (self *SEcloudClient) DescribeMetricList(regionId, productType string, metrics []Metric, resourceId string,
	since time.Time, until time.Time) (MetricData, error)

func (*SEcloudClient) GetAccessEnv

func (self *SEcloudClient) GetAccessEnv() string

func (*SEcloudClient) GetAccountId

func (ec *SEcloudClient) GetAccountId() string

func (*SEcloudClient) GetCapabilities

func (ec *SEcloudClient) GetCapabilities() []string

func (*SEcloudClient) GetCloudRegionExternalIdPrefix

func (ec *SEcloudClient) GetCloudRegionExternalIdPrefix() string

func (*SEcloudClient) GetEcsMetrics

func (*SEcloudClient) GetIRegionById

func (ec *SEcloudClient) GetIRegionById(id string) (cloudprovider.ICloudRegion, error)

func (*SEcloudClient) GetIRegions

func (ec *SEcloudClient) GetIRegions() []cloudprovider.ICloudRegion

func (*SEcloudClient) GetMetrics

func (*SEcloudClient) GetRegionById

func (ec *SEcloudClient) GetRegionById(id string) (*SRegion, error)

func (*SEcloudClient) GetSubAccounts

func (ec *SEcloudClient) GetSubAccounts() ([]cloudprovider.SSubAccount, error)

func (*SEcloudClient) TryConnect

func (ec *SEcloudClient) TryConnect() error

type SEcloudClientConfig

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

func NewEcloudClientConfig

func NewEcloudClientConfig(signer ISigner) *SEcloudClientConfig

func (*SEcloudClientConfig) SetCloudproviderConfig

func (cfg *SEcloudClientConfig) SetCloudproviderConfig(cpcfg cloudprovider.ProviderConfig) *SEcloudClientConfig

func (*SEcloudClientConfig) SetDebug

func (cfg *SEcloudClientConfig) SetDebug(debug bool) *SEcloudClientConfig

type SEip

type SEip struct {
	multicloud.SEipBase
	EcloudTags

	BandWidthMbSize int
	BandWidthType   string
	BindType        string
	// 使用,未使用
	Bound bool
	// bandwidthCharge, trafficCharge
	ChargeModeEnum string
	CreateTime     time.Time
	Frozen         bool
	// 备案状态
	IcpStatus     string
	Id            string
	IpType        string
	Ipv6          string
	Name          string //公网IPv4地址
	NicName       string
	PortNetworkId string
	Region        string
	ResourceId    string
	RouterId      string
	// BINDING, UNBOUND, FROZEN
	Status string
	// contains filtered or unexported fields
}

func (*SEip) Associate

func (e *SEip) Associate(conf *cloudprovider.AssociateConfig) error

func (*SEip) ChangeBandwidth

func (e *SEip) ChangeBandwidth(bw int) error

func (*SEip) Delete

func (e *SEip) Delete() error

func (*SEip) Dissociate

func (e *SEip) Dissociate() error

func (*SEip) GetAssociationExternalId

func (e *SEip) GetAssociationExternalId() string

func (*SEip) GetAssociationType

func (e *SEip) GetAssociationType() string

func (*SEip) GetBandwidth

func (e *SEip) GetBandwidth() int

func (*SEip) GetBillingType

func (e *SEip) GetBillingType() string

func (*SEip) GetCreatedAt

func (e *SEip) GetCreatedAt() time.Time

func (*SEip) GetExpiredAt

func (e *SEip) GetExpiredAt() time.Time

func (*SEip) GetGlobalId

func (e *SEip) GetGlobalId() string

func (*SEip) GetINetworkId

func (e *SEip) GetINetworkId() string

func (*SEip) GetId

func (e *SEip) GetId() string

func (*SEip) GetInternetChargeType

func (e *SEip) GetInternetChargeType() string

func (*SEip) GetIpAddr

func (e *SEip) GetIpAddr() string

func (*SEip) GetMode

func (e *SEip) GetMode() string

func (*SEip) GetName

func (e *SEip) GetName() string

func (*SEip) GetProjectId

func (e *SEip) GetProjectId() string

func (*SEip) GetStatus

func (e *SEip) GetStatus() string

func (*SEip) IsEmulated

func (e *SEip) IsEmulated() bool

func (*SEip) Refresh

func (e *SEip) Refresh() error

type SFixedIpDetail

type SFixedIpDetail struct {
	IpAddress     string
	IpVersion     string
	PublicIp      string
	BandWidthSize int
	BandWidthType string
	SubnetId      string
	SubnetName    string
}

type SHost

type SHost struct {
	multicloud.SHostBase
	// contains filtered or unexported fields
}

func (*SHost) CreateVM

func (*SHost) GetAccessIp

func (h *SHost) GetAccessIp() string

func (*SHost) GetAccessMac

func (h *SHost) GetAccessMac() string

func (*SHost) GetCpuCount

func (h *SHost) GetCpuCount() int

func (*SHost) GetCpuDesc

func (h *SHost) GetCpuDesc() string

func (*SHost) GetCpuMhz

func (h *SHost) GetCpuMhz() int

func (*SHost) GetEnabled

func (h *SHost) GetEnabled() bool

func (*SHost) GetGlobalId

func (h *SHost) GetGlobalId() string

func (*SHost) GetHostStatus

func (h *SHost) GetHostStatus() string

func (*SHost) GetHostType

func (h *SHost) GetHostType() string

func (*SHost) GetIHostNics

func (h *SHost) GetIHostNics() ([]cloudprovider.ICloudHostNetInterface, error)

func (*SHost) GetIStorageById

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

func (*SHost) GetIStorages

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

func (*SHost) GetIVMById

func (h *SHost) GetIVMById(id string) (cloudprovider.ICloudVM, error)

func (*SHost) GetIVMs

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

func (*SHost) GetId

func (h *SHost) GetId() string

func (*SHost) GetIsMaintenance

func (h *SHost) GetIsMaintenance() bool

func (*SHost) GetMemSizeMB

func (h *SHost) GetMemSizeMB() int

func (*SHost) GetName

func (h *SHost) GetName() string

func (*SHost) GetNodeCount

func (h *SHost) GetNodeCount() int8

func (*SHost) GetSN

func (h *SHost) GetSN() string

func (*SHost) GetStatus

func (h *SHost) GetStatus() string

func (*SHost) GetStorageSizeMB

func (h *SHost) GetStorageSizeMB() int64

func (*SHost) GetStorageType

func (h *SHost) GetStorageType() string

func (*SHost) GetSysInfo

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

func (*SHost) GetVersion

func (h *SHost) GetVersion() string

func (*SHost) IsEmulated

func (h *SHost) IsEmulated() bool

func (*SHost) Refresh

func (h *SHost) Refresh() error

type SImage

type SImage struct {
	multicloud.SImageBase
	EcloudTags
	SZoneRegionBase

	ImageId         string
	ServerId        string
	ImageAlias      string
	Name            string
	Url             string
	SrourceImageId  string
	Status          string
	SizeMb          int `json:"size"`
	IsPublic        int
	CreateTime      time.Time
	Note            string
	OsType          string
	MinDiskGB       int `json:"minDisk"`
	ImageType       string
	PublicImageType string
	BackupType      string
	BackupWay       string
	SnapshotId      string
	OsName          string
	// contains filtered or unexported fields
}

func (*SImage) Delete

func (self *SImage) Delete(ctx context.Context) error

func (*SImage) GetBios

func (i *SImage) GetBios() cloudprovider.TBiosType

func (*SImage) GetCreatedAt

func (i *SImage) GetCreatedAt() time.Time

func (*SImage) GetFullOsName

func (i *SImage) GetFullOsName() string

func (*SImage) GetGlobalId

func (i *SImage) GetGlobalId() string

func (*SImage) GetIStoragecache

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

func (*SImage) GetId

func (i *SImage) GetId() string

func (*SImage) GetImageFormat

func (i *SImage) GetImageFormat() string

func (*SImage) GetImageStatus

func (self *SImage) GetImageStatus() string

func (*SImage) GetImageType

func (self *SImage) GetImageType() cloudprovider.TImageType

func (*SImage) GetMinOsDiskSizeGb

func (i *SImage) GetMinOsDiskSizeGb() int

func (*SImage) GetMinRamSizeMb

func (i *SImage) GetMinRamSizeMb() int

func (*SImage) GetName

func (i *SImage) GetName() string

func (*SImage) GetOsArch

func (i *SImage) GetOsArch() string

func (*SImage) GetOsDist

func (i *SImage) GetOsDist() string

func (*SImage) GetOsLang

func (i *SImage) GetOsLang() string

func (*SImage) GetOsType

func (i *SImage) GetOsType() cloudprovider.TOsType

func (*SImage) GetOsVersion

func (i *SImage) GetOsVersion() string

func (*SImage) GetSizeByte

func (self *SImage) GetSizeByte() int64

func (*SImage) GetStatus

func (i *SImage) GetStatus() string

func (*SImage) IsEmulated

func (i *SImage) IsEmulated() bool

func (*SImage) Refresh

func (i *SImage) Refresh() error

type SInstance

type SInstance struct {
	multicloud.SInstanceBase
	EcloudTags
	multicloud.SBillingBase
	SZoneRegionBase
	SCreateTime

	Id               string
	Name             string
	Vcpu             int
	Vmemory          int
	KeyName          string
	ImageRef         string
	ImageName        string
	ImageOsType      string
	FlavorRef        string
	SystemDiskSizeGB int `json:"vdisk"`
	SystemDiskId     string
	ServerType       string
	ServerVmType     string
	EcStatus         string
	BootVolumeType   string
	Deleted          int
	Visible          bool
	Region           string
	PortDetail       []SInstanceNic
	// contains filtered or unexported fields
}

func (*SInstance) AttachDisk

func (in *SInstance) AttachDisk(ctx context.Context, diskId string) error

func (*SInstance) ChangeConfig

func (in *SInstance) ChangeConfig(ctx context.Context, config *cloudprovider.SManagedVMChangeConfig) error

func (*SInstance) DeleteVM

func (self *SInstance) DeleteVM(ctx context.Context) error

func (*SInstance) DeployVM

func (*SInstance) DetachDisk

func (in *SInstance) DetachDisk(ctx context.Context, diskId string) error

func (*SInstance) GetBillingType

func (i *SInstance) GetBillingType() string

func (*SInstance) GetBios

func (i *SInstance) GetBios() cloudprovider.TBiosType

func (*SInstance) GetBootOrder

func (self *SInstance) GetBootOrder() string

func (*SInstance) GetError

func (self *SInstance) GetError() error

func (*SInstance) GetExpiredAt

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

func (*SInstance) GetFullOsName

func (i *SInstance) GetFullOsName() string

func (*SInstance) GetGlobalId

func (i *SInstance) GetGlobalId() string

func (*SInstance) GetHostname

func (i *SInstance) GetHostname() string

func (*SInstance) GetHypervisor

func (in *SInstance) GetHypervisor() string

func (*SInstance) GetIDisks

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

func (*SInstance) GetIEIP

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

func (*SInstance) GetIHost

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

func (*SInstance) GetINics

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

func (*SInstance) GetId

func (i *SInstance) GetId() string

func (*SInstance) GetImage

func (i *SInstance) GetImage() (*SImage, error)

func (*SInstance) GetInstanceType

func (i *SInstance) GetInstanceType() string

func (*SInstance) GetMachine

func (i *SInstance) GetMachine() string

func (*SInstance) GetName

func (i *SInstance) GetName() string

func (*SInstance) GetOsArch

func (i *SInstance) GetOsArch() string

func (*SInstance) GetOsDist

func (i *SInstance) GetOsDist() string

func (*SInstance) GetOsLang

func (i *SInstance) GetOsLang() string

func (*SInstance) GetOsType

func (i *SInstance) GetOsType() cloudprovider.TOsType

func (*SInstance) GetOsVersion

func (i *SInstance) GetOsVersion() string

func (*SInstance) GetProjectId

func (in *SInstance) GetProjectId() string

func (*SInstance) GetSecurityGroupIds

func (in *SInstance) GetSecurityGroupIds() ([]string, error)

func (*SInstance) GetStatus

func (i *SInstance) GetStatus() string

func (*SInstance) GetVNCInfo

func (*SInstance) GetVcpuCount

func (in *SInstance) GetVcpuCount() int

func (*SInstance) GetVdi

func (self *SInstance) GetVdi() string

func (*SInstance) GetVga

func (self *SInstance) GetVga() string

func (*SInstance) GetVmemSizeMB

func (in *SInstance) GetVmemSizeMB() int

func (*SInstance) IsEmulated

func (i *SInstance) IsEmulated() bool

func (*SInstance) RebuildRoot

func (self *SInstance) RebuildRoot(ctx context.Context, config *cloudprovider.SManagedVMRebuildRootConfig) (string, error)

func (*SInstance) Refresh

func (i *SInstance) Refresh() error

func (*SInstance) Renew

func (self *SInstance) Renew(bc billing.SBillingCycle) error

func (*SInstance) SetSecurityGroups

func (in *SInstance) SetSecurityGroups(ids []string) error

func (*SInstance) StartVM

func (in *SInstance) StartVM(ctx context.Context) error

func (*SInstance) StopVM

func (self *SInstance) StopVM(ctx context.Context, opts *cloudprovider.ServerStopOptions) error

func (*SInstance) UpdateUserData

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

func (*SInstance) UpdateVM

type SInstanceNic

type SInstanceNic struct {
	cloudprovider.DummyICloudNic
	SInstanceNicDetail

	Id               string
	PrivateIp        string
	FipAddress       string
	FipBandwidthSize int
	PortId           string
	PortName         string
	FixedIpDetails   []SFixedIpDetail
	RouterId         string
	// contains filtered or unexported fields
}

func (*SInstanceNic) GetDriver

func (in *SInstanceNic) GetDriver() string

func (*SInstanceNic) GetINetworkId

func (in *SInstanceNic) GetINetworkId() string

func (*SInstanceNic) GetIP

func (in *SInstanceNic) GetIP() string

func (*SInstanceNic) GetId

func (in *SInstanceNic) GetId() string

func (*SInstanceNic) GetMAC

func (in *SInstanceNic) GetMAC() string

func (*SInstanceNic) InClassicNetwork

func (in *SInstanceNic) InClassicNetwork() bool

type SInstanceNicDetail

type SInstanceNicDetail struct {
	MacAddress     string
	SecurityGroups []SSecurityGroupRef
	Status         int
	ResourceId     string
	CreaetTime     time.Time
	PublicIp       string
	IpId           string
	NetworkId      string
}

type SJSONRequest

type SJSONRequest struct {
	SBaseRequest
	Data jsonutils.JSONObject
}

func NewJSONRequest

func NewJSONRequest(data jsonutils.JSONObject) *SJSONRequest

func (*SJSONRequest) GetBodyReader

func (jr *SJSONRequest) GetBodyReader() io.Reader

type SMonitorRequest

type SMonitorRequest struct {
	SApiRequest
}

func NewMonitorRequest

func NewMonitorRequest(regionId string, serverPath string, query map[string]string, data jsonutils.JSONObject) *SMonitorRequest

func (*SMonitorRequest) ForMateResponseBody

func (br *SMonitorRequest) ForMateResponseBody(jrbody jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SMonitorRequest) GetPort

func (rr *SMonitorRequest) GetPort() string

type SNetwork

type SNetwork struct {
	multicloud.SResourceBase
	EcloudTags
	SZoneRegionBase

	Id       string
	Name     string
	Shared   bool
	Enabled  bool
	EcStatus string
	Subnets  []SSubnet
	// contains filtered or unexported fields
}

func (*SNetwork) Cidr

func (n *SNetwork) Cidr() string

func (*SNetwork) Delete

func (self *SNetwork) Delete() error

func (*SNetwork) GetAllocTimeoutSeconds

func (self *SNetwork) GetAllocTimeoutSeconds() int

func (*SNetwork) GetGateway

func (n *SNetwork) GetGateway() string

func (*SNetwork) GetGlobalId

func (n *SNetwork) GetGlobalId() string

func (*SNetwork) GetIWire

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

func (*SNetwork) GetId

func (n *SNetwork) GetId() string

func (*SNetwork) GetIpEnd

func (n *SNetwork) GetIpEnd() string

func (*SNetwork) GetIpMask

func (n *SNetwork) GetIpMask() int8

func (*SNetwork) GetIpStart

func (n *SNetwork) GetIpStart() string

func (*SNetwork) GetIsPublic

func (self *SNetwork) GetIsPublic() bool

func (*SNetwork) GetName

func (n *SNetwork) GetName() string

func (*SNetwork) GetProjectId

func (n *SNetwork) GetProjectId() string

func (*SNetwork) GetPublicScope

func (self *SNetwork) GetPublicScope() rbacscope.TRbacScope

func (*SNetwork) GetServerType

func (self *SNetwork) GetServerType() string

func (*SNetwork) GetStatus

func (n *SNetwork) GetStatus() string

func (*SNetwork) IsEmulated

func (n *SNetwork) IsEmulated() bool

func (*SNetwork) Refresh

func (n *SNetwork) Refresh() error

type SNovaRequest

type SNovaRequest struct {
	SApiRequest
}

func NewNovaRequest

func NewNovaRequest(ar *SApiRequest) *SNovaRequest

func (*SNovaRequest) GetPort

func (nr *SNovaRequest) GetPort() string

type SRamRoleSigner

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

func NewRamRoleSigner

func NewRamRoleSigner(accessKeyId, accessKeySecret string) *SRamRoleSigner

func (*SRamRoleSigner) GetAccessKeyId

func (s *SRamRoleSigner) GetAccessKeyId() string

func (*SRamRoleSigner) GetName

func (s *SRamRoleSigner) GetName() string

func (*SRamRoleSigner) GetNonce

func (s *SRamRoleSigner) GetNonce() string

func (*SRamRoleSigner) GetVersion

func (s *SRamRoleSigner) GetVersion() string

func (*SRamRoleSigner) Sign

func (s *SRamRoleSigner) Sign(stringToSign, secretPrefix string) string

type SRegion

type SRegion struct {
	cloudprovider.SFakeOnPremiseRegion
	multicloud.SRegion
	multicloud.SNoObjectStorageRegion

	ID   string `json:"id"`
	Name string `json:"Name"`
	// contains filtered or unexported fields
}

func (*SRegion) FindZone

func (r *SRegion) FindZone(zoneRegion string) (*SZone, error)

func (*SRegion) GetCapabilities

func (r *SRegion) GetCapabilities() []string

func (*SRegion) GetClient

func (r *SRegion) GetClient() *SEcloudClient

func (*SRegion) GetDisk

func (s *SRegion) GetDisk(id string) (*SDisk, error)

func (*SRegion) GetDisks

func (s *SRegion) GetDisks() ([]SDisk, error)

func (*SRegion) GetEipById

func (r *SRegion) GetEipById(id string) (*SEip, error)

func (*SRegion) GetGeographicInfo

func (r *SRegion) GetGeographicInfo() cloudprovider.SGeographicInfo

GetLatitude() float32 GetLongitude() float32

func (*SRegion) GetGlobalId

func (r *SRegion) GetGlobalId() string

func (*SRegion) GetI18n

func (r *SRegion) GetI18n() cloudprovider.SModelI18nTable

func (*SRegion) GetIDiskById

func (r *SRegion) GetIDiskById(id string) (cloudprovider.ICloudDisk, error)

func (*SRegion) GetIEipById

func (r *SRegion) GetIEipById(id string) (cloudprovider.ICloudEIP, error)

func (*SRegion) GetIEips

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

func (*SRegion) GetIHostById

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

func (*SRegion) GetIHosts

func (r *SRegion) GetIHosts() ([]cloudprovider.ICloudHost, error)

func (*SRegion) GetIStorageById

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

func (*SRegion) GetIStoragecacheById

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

func (*SRegion) GetIStoragecaches

func (r *SRegion) GetIStoragecaches() ([]cloudprovider.ICloudStoragecache, error)

func (*SRegion) GetIStorages

func (r *SRegion) GetIStorages() ([]cloudprovider.ICloudStorage, error)

func (*SRegion) GetIVMById

func (r *SRegion) GetIVMById(id string) (cloudprovider.ICloudVM, error)

func (*SRegion) GetIVMs

func (region *SRegion) GetIVMs() ([]cloudprovider.ICloudVM, error)

func (*SRegion) GetIVpcById

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

func (*SRegion) GetIVpcs

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

func (*SRegion) GetIZoneById

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

func (*SRegion) GetIZones

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

func (*SRegion) GetId

func (r *SRegion) GetId() string

func (*SRegion) GetImage

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

func (*SRegion) GetImages

func (r *SRegion) GetImages(isPublic bool) ([]SImage, error)

func (*SRegion) GetInstanceById

func (r *SRegion) GetInstanceById(id string) (*SInstance, error)

func (*SRegion) GetInstanceVNCUrl

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

func (*SRegion) GetInstances

func (r *SRegion) GetInstances(zoneRegion string) ([]SInstance, error)

func (*SRegion) GetInstancesWithHost

func (r *SRegion) GetInstancesWithHost(zoneRegion string) ([]SInstance, error)

func (*SRegion) GetName

func (r *SRegion) GetName() string

func (*SRegion) GetNetworkById

func (r *SRegion) GetNetworkById(routerId, zoneRegion, netId string) (*SNetwork, error)

func (*SRegion) GetNetworks

func (r *SRegion) GetNetworks(routerId, zoneRegion string) ([]SNetwork, error)

func (*SRegion) GetProductTypes

func (r *SRegion) GetProductTypes() (jsonutils.JSONObject, error)

func (*SRegion) GetProvider

func (r *SRegion) GetProvider() string

func (*SRegion) GetSnapshots

func (s *SRegion) GetSnapshots(snapshotId string, parentId string, isSystem bool) ([]SSnapshot, error)

func (*SRegion) GetStatus

func (r *SRegion) GetStatus() string

func (*SRegion) GetVMById

func (h *SRegion) GetVMById(vmId string) (*SInstance, error)

func (*SRegion) GetVMs

func (h *SRegion) GetVMs() ([]SInstance, error)

func (*SRegion) IsEmulated

func (r *SRegion) IsEmulated() bool

func (*SRegion) Refresh

func (r *SRegion) Refresh() error

type SSecurityGroupRef

type SSecurityGroupRef struct {
	Id   string
	Name string
}

type SSnapshot

type SSnapshot struct {
	multicloud.SResourceBase
	EcloudTags

	SCreateTime

	BackupType  string
	CreateBy    string
	Description string
	EcType      string
	Id          string
	Name        string
	Size        int
	VolumeId    string
	VolumeType  string
	Status      string
	IsSystem    bool
	SystemDisk  string
	// contains filtered or unexported fields
}

func (*SSnapshot) Delete

func (s *SSnapshot) Delete() error

func (*SSnapshot) GetCreatedAt

func (s *SSnapshot) GetCreatedAt() time.Time

func (*SSnapshot) GetDiskId

func (s *SSnapshot) GetDiskId() string

func (*SSnapshot) GetDiskType

func (s *SSnapshot) GetDiskType() string

func (*SSnapshot) GetGlobalId

func (s *SSnapshot) GetGlobalId() string

func (*SSnapshot) GetId

func (s *SSnapshot) GetId() string

func (*SSnapshot) GetName

func (s *SSnapshot) GetName() string

func (*SSnapshot) GetProjectId

func (s *SSnapshot) GetProjectId() string

func (*SSnapshot) GetSizeMb

func (s *SSnapshot) GetSizeMb() int32

func (*SSnapshot) GetStatus

func (s *SSnapshot) GetStatus() string

type SStorage

type SStorage struct {
	multicloud.SStorageBase
	EcloudTags
	// contains filtered or unexported fields
}

func (*SStorage) CreateIDisk

func (*SStorage) DisableSync

func (s *SStorage) DisableSync() bool

func (*SStorage) GetCapacityMB

func (s *SStorage) GetCapacityMB() int64

func (*SStorage) GetCapacityUsedMB

func (s *SStorage) GetCapacityUsedMB() int64

func (*SStorage) GetEnabled

func (s *SStorage) GetEnabled() bool

func (*SStorage) GetGlobalId

func (s *SStorage) GetGlobalId() string

func (*SStorage) GetIDiskById

func (s *SStorage) GetIDiskById(idStr string) (cloudprovider.ICloudDisk, error)

func (*SStorage) GetIDisks

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

func (*SStorage) GetIStoragecache

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

func (*SStorage) GetIZone

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

func (*SStorage) GetId

func (s *SStorage) GetId() string

func (*SStorage) GetMediumType

func (s *SStorage) GetMediumType() string

func (*SStorage) GetMountPoint

func (s *SStorage) GetMountPoint() string

func (*SStorage) GetName

func (s *SStorage) GetName() string

func (*SStorage) GetStatus

func (s *SStorage) GetStatus() string

func (*SStorage) GetStorageConf

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

func (*SStorage) GetStorageType

func (s *SStorage) GetStorageType() string

func (*SStorage) IsEmulated

func (s *SStorage) IsEmulated() bool

func (*SStorage) IsSysDiskStore

func (s *SStorage) IsSysDiskStore() bool

func (*SStorage) Refresh

func (s *SStorage) Refresh() error

type SStoragecache

type SStoragecache struct {
	multicloud.SResourceBase
	EcloudTags
	// contains filtered or unexported fields
}

func (*SStoragecache) GetGlobalId

func (sc *SStoragecache) GetGlobalId() string

func (*SStoragecache) GetICloudImages

func (sc *SStoragecache) GetICloudImages() ([]cloudprovider.ICloudImage, error)

func (*SStoragecache) GetICustomizedCloudImages

func (sc *SStoragecache) GetICustomizedCloudImages() ([]cloudprovider.ICloudImage, error)

func (*SStoragecache) GetIImageById

func (sc *SStoragecache) GetIImageById(extId string) (cloudprovider.ICloudImage, error)

func (*SStoragecache) GetId

func (sc *SStoragecache) GetId() string

func (*SStoragecache) GetName

func (sc *SStoragecache) GetName() string

func (*SStoragecache) GetPath

func (sc *SStoragecache) GetPath() string

func (*SStoragecache) GetStatus

func (sc *SStoragecache) GetStatus() string

func (*SStoragecache) IsEmulated

func (sc *SStoragecache) IsEmulated() bool

func (*SStoragecache) Refresh

func (sc *SStoragecache) Refresh() error

func (*SStoragecache) UploadImage

func (sc *SStoragecache) UploadImage(ctx context.Context, image *cloudprovider.SImageCreateOption, callback func(progress float32)) (string, error)

type SSubnet

type SSubnet struct {
	Id         string
	Name       string
	NetworkId  string
	Region     string
	GatewayIp  string
	EnableDHCP bool
	Cidr       string
	IpVersion  string
}

type SVpc

type SVpc struct {
	multicloud.SVpc
	EcloudTags

	Id       string
	Name     string
	Region   string
	EcStatus string
	RouterId string
	Scale    string
	UserId   string
	UserName string
	// contains filtered or unexported fields
}

func (*SVpc) Delete

func (v *SVpc) Delete() error

func (*SVpc) GetCidrBlock

func (v *SVpc) GetCidrBlock() string

func (*SVpc) GetGlobalId

func (v *SVpc) GetGlobalId() string

func (*SVpc) GetIRouteTableById

func (v *SVpc) GetIRouteTableById(routeTableId string) (cloudprovider.ICloudRouteTable, error)

func (*SVpc) GetIRouteTables

func (v *SVpc) GetIRouteTables() ([]cloudprovider.ICloudRouteTable, error)

func (*SVpc) GetISecurityGroups

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

func (*SVpc) GetIWireById

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

func (*SVpc) GetIWires

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

func (*SVpc) GetId

func (v *SVpc) GetId() string

func (*SVpc) GetIsDefault

func (v *SVpc) GetIsDefault() bool

func (*SVpc) GetName

func (v *SVpc) GetName() string

func (*SVpc) GetRegion

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

func (*SVpc) GetStatus

func (v *SVpc) GetStatus() string

func (*SVpc) IsEmulated

func (v *SVpc) IsEmulated() bool

func (*SVpc) Refresh

func (v *SVpc) Refresh() error

type SWire

type SWire struct {
	multicloud.SResourceBase
	EcloudTags
	// contains filtered or unexported fields
}

func (*SWire) CreateINetwork

func (*SWire) CreateNetworks

func (w *SWire) CreateNetworks() (*SNetwork, error)

func (*SWire) GetBandwidth

func (w *SWire) GetBandwidth() int

func (*SWire) GetGlobalId

func (w *SWire) GetGlobalId() string

func (*SWire) GetINetworkById

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

func (*SWire) GetINetworks

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

func (*SWire) GetIVpc

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

func (*SWire) GetIZone

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

func (*SWire) GetId

func (w *SWire) GetId() string

func (*SWire) GetName

func (w *SWire) GetName() string

func (*SWire) GetNetworkById

func (w *SWire) GetNetworkById(netId string) (*SNetwork, error)

func (*SWire) GetStatus

func (w *SWire) GetStatus() string

func (*SWire) IsEmulated

func (w *SWire) IsEmulated() bool

func (*SWire) Refresh

func (w *SWire) Refresh() error

type SZone

type SZone struct {
	multicloud.SResourceBase
	EcloudTags

	ID      string `json:"id"`
	Name    string `json:"name"`
	Region  string `json:"region"`
	Deleted bool
	Visible bool
	// contains filtered or unexported fields
}

func (*SZone) GetGlobalId

func (z *SZone) GetGlobalId() string

func (*SZone) GetI18n

func (z *SZone) GetI18n() cloudprovider.SModelI18nTable

func (*SZone) GetIHostById

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

func (*SZone) GetIHosts

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

func (*SZone) GetIRegion

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

func (*SZone) GetIStorageById

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

func (*SZone) GetIStorages

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

func (*SZone) GetId

func (z *SZone) GetId() string

func (*SZone) GetName

func (z *SZone) GetName() string

func (*SZone) GetStatus

func (z *SZone) GetStatus() string

func (*SZone) IsEmulated

func (z *SZone) IsEmulated() bool

func (*SZone) Refresh

func (z *SZone) Refresh() error

type SZoneRegionBase

type SZoneRegionBase struct {
	Region string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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