ctyun

package
v0.3.10-0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 29 Imported by: 3

Documentation

Index

Constants

View Source
const (
	CTYUN_API_HOST          = "https://api.ctyun.cn"
	CLOUD_PROVIDER_CTYUN    = api.CLOUD_PROVIDER_CTYUN
	CLOUD_PROVIDER_CTYUN_CN = "天翼云"
	CLOUD_PROVIDER_CTYUN_EN = "Ctyun"
	CTYUN_DEFAULT_REGION    = "cn-bj4"

	CTYUN_API_VERSION = "2019-11-22"
)
View Source
const (
	ImageOwnerPublic string = "gold"    // 公共镜像:gold
	ImageOwnerSelf   string = "private" // 私有镜像:private
	ImageOwnerShared string = "shared"  // 共享镜像:shared
)

Variables

View Source
var LatitudeAndLongitude = map[string]cloudprovider.SGeographicInfo{
	"cn-beijing1":   {Latitude: 39.997743, Longitude: 116.304542, City: api.CITY_BEI_JING, CountryCode: api.COUNTRY_CODE_CN},
	"cn-hz1":        {Latitude: 30.274084, Longitude: 120.155067, City: api.CITY_HANG_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-gslz1":      {Latitude: 36.0613769373, Longitude: 103.8341600069, City: api.CITY_LAN_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-sxty1":      {Latitude: 37.8705857132, Longitude: 112.5506634865, City: api.CITY_TAI_YUAN, CountryCode: api.COUNTRY_CODE_CN},
	"cn-sh1":        {Latitude: 31.210344, Longitude: 121.455364, City: api.CITY_SHANG_HAI, CountryCode: api.COUNTRY_CODE_CN},
	"cn-gz1":        {Latitude: 26.6470035286, Longitude: 106.6302113880, City: api.CITY_GUI_YANG, CountryCode: api.COUNTRY_CODE_CN},
	"cn-sdqd1":      {Latitude: 36.067108, Longitude: 120.382607, City: api.CITY_QING_DAO, CountryCode: api.COUNTRY_CODE_CN},
	"cn-tj1":        {Latitude: 39.0850853357, Longitude: 117.1993482089, City: api.CITY_TIAN_JIN, CountryCode: api.COUNTRY_CODE_CN},
	"cn-xjcj1":      {Latitude: 43.8266013700, Longitude: 87.6168405804, City: api.CITY_WU_LU_MU_QI, CountryCode: api.COUNTRY_CODE_CN},
	"cn-cq1":        {Latitude: 29.431585, Longitude: 106.912254, City: api.CITY_CHONG_QING, CountryCode: api.COUNTRY_CODE_CN},
	"cn-gxnn1":      {Latitude: 22.8167372565, Longitude: 108.3669005333, City: api.CITY_NAN_NING, CountryCode: api.COUNTRY_CODE_CN},
	"cn-hazz1":      {Latitude: 34.7533581487, Longitude: 113.6313915479, City: api.CITY_ZHENG_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-ynkm1":      {Latitude: 24.8796595146, Longitude: 102.8332118852, City: api.CITY_KUN_MING, CountryCode: api.COUNTRY_CODE_CN},
	"cn-xian1":      {Latitude: 34.3412614674, Longitude: 108.9398165260, City: api.CITY_XI_AN, CountryCode: api.COUNTRY_CODE_CN},
	"cn-hihk1":      {Latitude: 20.0442268036, Longitude: 110.1998910288, City: api.CITY_HAI_KOU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-ahwh1":      {Latitude: 31.3524675159, Longitude: 118.4331307290, City: api.CITY_WU_HU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-fz1":        {Latitude: 26.0741979397, Longitude: 119.2964466153, City: api.CITY_FU_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-nmhh1":      {Latitude: 40.842358, Longitude: 111.749992, City: api.CITY_HU_HE_HAO_TE, CountryCode: api.COUNTRY_CODE_CN},
	"cn-shanghai2":  {Latitude: 31.210344, Longitude: 121.455364, City: api.CITY_SHANG_HAI, CountryCode: api.COUNTRY_CODE_CN},
	"cn-snxy1":      {Latitude: 34.3412614674, Longitude: 108.9398165260, City: api.CITY_XI_AN, CountryCode: api.COUNTRY_CODE_CN},
	"cn-hbwh1":      {Latitude: 30.5927599029, Longitude: 114.3052387810, City: api.CITY_WU_HAN, CountryCode: api.COUNTRY_CODE_CN},
	"cn-hncs1":      {Latitude: 28.2277765095, Longitude: 112.9388453666, City: api.CITY_CHANG_SHA, CountryCode: api.COUNTRY_CODE_CN},
	"cn-guangzhou2": {Latitude: 23.12911, Longitude: 113.264385, City: api.CITY_GUANG_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-guizhou2":   {Latitude: 26.6470035286, Longitude: 106.6302113880, City: api.CITY_GUI_YANG, CountryCode: api.COUNTRY_CODE_CN},
	"cn-jssz1":      {Latitude: 31.2983479333, Longitude: 120.5831894861, City: api.CITY_SU_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-sccd1":      {Latitude: 30.572815, Longitude: 104.066803, City: api.CITY_CHENG_DU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-guangzhou3": {Latitude: 23.12911, Longitude: 113.264385, City: api.CITY_GUANG_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-shanghai3":  {Latitude: 31.210344, Longitude: 121.455364, City: api.CITY_SHANG_HAI, CountryCode: api.COUNTRY_CODE_CN},
	"cn-neimeng4":   {Latitude: 40.842358, Longitude: 111.749992, City: api.CITY_HU_HE_HAO_TE, CountryCode: api.COUNTRY_CODE_CN},
	"cn-beijing3":   {Latitude: 39.904202, Longitude: 116.407394, City: api.CITY_BEI_JING, CountryCode: api.COUNTRY_CODE_CN},
	"cn-baoding1":   {Latitude: 38.8739745619, Longitude: 115.4646082830, City: api.CITY_BAO_DING, CountryCode: api.COUNTRY_CODE_CN},
	"cn-nj2":        {Latitude: 32.0584065670, Longitude: 118.7964897811, City: api.CITY_NAN_JING, CountryCode: api.COUNTRY_CODE_CN},
	"cn-gdgz1":      {Latitude: 23.12911, Longitude: 113.264385, City: api.CITY_GUANG_ZHOU, CountryCode: api.COUNTRY_CODE_CN},
	"cn-bj1":        {Latitude: 39.904202, Longitude: 116.407394, City: api.CITY_BEI_JING, CountryCode: api.COUNTRY_CODE_CN},
	"cn-bj4":        {Latitude: 39.904202, Longitude: 116.407394, City: api.CITY_BEI_JING, CountryCode: api.COUNTRY_CODE_CN},
	"cn-neimeng5":   {Latitude: 40.842358, Longitude: 111.749992, City: api.CITY_HU_HE_HAO_TE, CountryCode: api.COUNTRY_CODE_CN},
	"cn-shanghai5":  {Latitude: 31.210344, Longitude: 121.455364, City: api.CITY_SHANG_HAI, CountryCode: api.COUNTRY_CODE_CN},
	"cn-sh6":        {Latitude: 31.210344, Longitude: 121.455364, City: api.CITY_SHANG_HAI, CountryCode: api.COUNTRY_CODE_CN},
	"cn-gdfs2":      {Latitude: 23.0218629843, Longitude: 113.1219225896, City: api.CITY_FO_SHAN, CountryCode: api.COUNTRY_CODE_CN},
}

Functions

func GetBucketName

func GetBucketName(regionId string, imageId string) string

Types

type Address

type Address struct {
	Addr               string `json:"addr"`
	OSEXTIPSType       string `json:"OS-EXT-IPS:type"`
	Version            int64  `json:"version"`
	OSEXTIPSMACMACAddr string `json:"OS-EXT-IPS-MAC:mac_addr"`
}

type Attachment

type Attachment struct {
	VolumeID     string `json:"volume_id"`
	AttachmentID string `json:"attachment_id"`
	AttachedAt   string `json:"attached_at"`
	ServerID     string `json:"server_id"`
	Device       string `json:"device"`
	ID           string `json:"id"`
}

type CtyunClientConfig

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

func NewSCtyunClientConfig

func NewSCtyunClientConfig(accessKey, accessSecret string, options *cloudprovider.SCtyunExtraOptions) *CtyunClientConfig

func (*CtyunClientConfig) CloudproviderConfig

func (cfg *CtyunClientConfig) CloudproviderConfig(cpcfg cloudprovider.ProviderConfig) *CtyunClientConfig

func (*CtyunClientConfig) Debug

func (cfg *CtyunClientConfig) Debug(debug bool) *CtyunClientConfig

func (*CtyunClientConfig) ProjectId

func (cfg *CtyunClientConfig) ProjectId(projectId string) *CtyunClientConfig

type CtyunTags

type CtyunTags struct {
}

func (*CtyunTags) GetSysTags

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

func (*CtyunTags) GetTags

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

func (*CtyunTags) SetTags

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

type DiskDetails

type DiskDetails struct {
	ID                  string `json:"id"`
	ResEbsID            string `json:"resEbsId"`
	Size                int64  `json:"size"`
	Name                string `json:"name"`
	RegionID            string `json:"regionId"`
	AccountID           string `json:"accountId"`
	UserID              string `json:"userId"`
	HostID              string `json:"hostId"`
	OrderID             string `json:"orderId"`
	Status              int64  `json:"status"`
	Type                string `json:"type"`
	VolumeStatus        int64  `json:"volumeStatus"`
	CreateDate          int64  `json:"createDate"`
	DueDate             int64  `json:"dueDate"`
	ZoneID              string `json:"zoneId"`
	ZoneName            string `json:"zoneName"`
	IsSysVolume         int64  `json:"isSysVolume"`
	IsPackaged          int64  `json:"isPackaged"`
	WorkOrderResourceID string `json:"workOrderResourceId"`
	IsFreeze            int64  `json:"isFreeze"`
}

type FixedIP

type FixedIP struct {
	IPAddress string `json:"ip_address"`
	SubnetID  string `json:"subnet_id"`
}

type FlavorObj

type FlavorObj struct {
	Name    string `json:"name"`
	CPUNum  int    `json:"cpuNum"`
	MemSize int    `json:"memSize"`
	ID      string `json:"id"`
}

type Image

type Image struct {
	Id string `json:"id"`
}

type InstanceDetails

type InstanceDetails struct {
	HostID     string      `json:"hostId"`
	Name       string      `json:"name"`
	Status     string      `json:"status"`
	PrivateIPS []PrivateIP `json:"privateIps"`
	PublicIPS  []PublicIP  `json:"publicIps"`
	Volumes    []Volume    `json:"volumes"`
	Created    string      `json:"created"`
	FlavorObj  FlavorObj   `json:"flavorObj"`
}

type Metadata

type Metadata struct {
	OrderID          string `json:"orderID"`
	AttachedMode     string `json:"attached_mode"`
	ResourceSpecCode string `json:"resourceSpecCode"`
	ProductID        string `json:"productID"`
	Readonly         string `json:"readonly"`
}

type PrivateIP

type PrivateIP struct {
	ID      string `json:"id"`
	Address string `json:"address"`
}

type Profile

type Profile struct {
	OrderID   string `json:"order_id"`
	RegionID  string `json:"region_id"`
	UserID    string `json:"user_id"`
	ProductID string `json:"product_id"`
}

type PublicIP

type PublicIP struct {
	ID        string `json:"id"`
	Address   string `json:"address"`
	Bandwidth string `json:"bandwidth"`
}

type PublicP

type PublicP struct {
	ID        string `json:"id"`
	Address   string `json:"address"`
	Bandwidth string `json:"bandwidth"`
}

type PublicipInfo

type PublicipInfo struct {
	PublicipType    string `json:"publicip_type"`
	PublicipAddress string `json:"publicip_address"`
	IPVersion       int64  `json:"ip_version"`
	PublicipID      string `json:"publicip_id"`
}

type ResourceConfigMap

type ResourceConfigMap struct {
	AvailabilityZone string            `json:"availability_zone"`
	Value            string            `json:"value"`
	Number           string            `json:"number"`
	IsSystemVolume   bool              `json:"isSystemVolume"`
	VolumeType       string            `json:"volumeType"`
	Size             int64             `json:"size"`
	ZoneID           string            `json:"zoneId"`
	RegionID         string            `json:"regionId"`
	Version          string            `json:"version"`
	CycleCnt         int64             `json:"cycleCnt"`
	CycleType        int64             `json:"cycleType"`
	ResEbsID         string            `json:"resEbsId"`
	ActualResourceID string            `json:"actualResourceId"`
	SecurityGroups   []SecurityGroupID `json:"security_groups"`
}

type SBandwidth

type SBandwidth struct {
	PublicipInfo        []PublicipInfo `json:"publicip_info"`
	EnterpriseProjectID string         `json:"enterprise_project_id"`
	Name                string         `json:"name"`
	ID                  string         `json:"id"`
	ShareType           string         `json:"share_type"`
	Size                int64          `json:"size"`
	TenantID            string         `json:"tenant_id"`
	ChargeMode          string         `json:"charge_mode"`
	BandwidthType       string         `json:"bandwidth_type"`
}

type SCrmUser

type SCrmUser struct {
	LoginName   string `json:"loginName"`
	LoginEmail  string `json:"loginEmail"`
	RootUserid  string `json:"rootUserid"`
	CreateDate  int64  `json:"createDate"`
	AccountType int64  `json:"accountType"`
	Status      int64  `json:"status"`
	Province    string `json:"province"`
	City        string `json:"city"`
	Mobilephone string `json:"mobilephone"`
	Postpaid    int64  `json:"postpaid"`
	Channel     int64  `json:"channel"`
	AuditStatus string `json:"auditStatus"`
	AuditMsg    string `json:"auditMsg"`
}

type SCtyunClient

type SCtyunClient struct {
	*CtyunClientConfig
	// contains filtered or unexported fields
}

func NewSCtyunClient

func NewSCtyunClient(cfg *CtyunClientConfig) (*SCtyunClient, error)

func (*SCtyunClient) DoGet

func (client *SCtyunClient) DoGet(apiName string, queries map[string]string) (jsonutils.JSONObject, error)

func (*SCtyunClient) DoPost

func (client *SCtyunClient) DoPost(apiName string, params map[string]jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SCtyunClient) FetchProjects

func (self *SCtyunClient) FetchProjects() ([]SProject, error)

func (*SCtyunClient) GetAccessEnv

func (self *SCtyunClient) GetAccessEnv() string

func (*SCtyunClient) GetAccountId

func (client *SCtyunClient) GetAccountId() string

func (*SCtyunClient) GetCapabilities

func (self *SCtyunClient) GetCapabilities() []string

func (*SCtyunClient) GetCloudRegionExternalIdPrefix

func (self *SCtyunClient) GetCloudRegionExternalIdPrefix() string

func (*SCtyunClient) GetIProjects

func (self *SCtyunClient) GetIProjects() ([]cloudprovider.ICloudProject, error)

func (*SCtyunClient) GetIRegionById

func (self *SCtyunClient) GetIRegionById(id string) (cloudprovider.ICloudRegion, error)

func (*SCtyunClient) GetIRegions

func (self *SCtyunClient) GetIRegions() []cloudprovider.ICloudRegion

func (*SCtyunClient) GetRegion

func (self *SCtyunClient) GetRegion(regionId string) *SRegion

func (*SCtyunClient) GetRegions

func (self *SCtyunClient) GetRegions() []SRegion

func (*SCtyunClient) GetSubAccounts

func (self *SCtyunClient) GetSubAccounts() ([]cloudprovider.SSubAccount, error)

type SDisk

type SDisk struct {
	multicloud.SDisk
	CtyunTags
	multicloud.SBillingBase

	ID                  string       `json:"id"`
	Status              string       `json:"status"`
	Name                string       `json:"name"`
	CreatedAt           int64        `json:"created_at"`
	UpdatedAt           string       `json:"updated_at"`
	Multiattach         bool         `json:"multiattach"`
	ReplicationStatus   string       `json:"replication_status"`
	SizeGB              int64        `json:"size"`
	Metadata            Metadata     `json:"metadata"`
	VolumeType          string       `json:"volume_type"`
	UserID              string       `json:"user_id"`
	Shareable           bool         `json:"shareable"`
	Encrypted           bool         `json:"encrypted"`
	Bootable            string       `json:"bootable"`
	AvailabilityZone    string       `json:"availability_zone"`
	Attachments         []Attachment `json:"attachments"`
	MasterOrderID       string       `json:"masterOrderId"`
	WorkOrderResourceID string       `json:"workOrderResourceId"`
	ExpireTime          int64        `json:"expireTime"`
	IsFreeze            int64        `json:"isFreeze"`
	// contains filtered or unexported fields
}

http://ctyun-api-url/apiproxy/v3/ondemand/queryVolumes

func (*SDisk) CreateISnapshot

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

func (*SDisk) Delete

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

func (*SDisk) GetAccessPath

func (self *SDisk) GetAccessPath() string

func (*SDisk) GetBillingType

func (self *SDisk) GetBillingType() string

func (*SDisk) GetCacheMode

func (self *SDisk) GetCacheMode() string

func (*SDisk) GetCreatedAt

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

func (*SDisk) GetDiskDetails

func (self *SDisk) GetDiskDetails() (*DiskDetails, error)

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

func (self *SDisk) GetExtSnapshotPolicyIds() ([]string, error)

POST http://ctyun-api-url/apiproxy/v3/ondemand/updateDiskBackupPolicy

func (*SDisk) GetFsFormat

func (self *SDisk) GetFsFormat() string

func (*SDisk) GetGlobalId

func (self *SDisk) GetGlobalId() string

func (*SDisk) GetISnapshots

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

no snapshot api opened

func (*SDisk) GetIStorage

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

func (*SDisk) GetIStorageId

func (self *SDisk) GetIStorageId() string

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

func (self *SDisk) GetMountpoint() string

func (*SDisk) GetName

func (self *SDisk) GetName() string

func (*SDisk) GetProjectId

func (self *SDisk) GetProjectId() string

func (*SDisk) GetStatus

func (self *SDisk) GetStatus() string

func (*SDisk) GetSysTags

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

func (*SDisk) GetTemplateId

func (self *SDisk) GetTemplateId() string

func (*SDisk) IsEmulated

func (self *SDisk) IsEmulated() bool

func (*SDisk) Rebuild

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

func (*SDisk) Refresh

func (self *SDisk) Refresh() error

func (*SDisk) Reset

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

func (*SDisk) Resize

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

type SDiskBackup

type SDiskBackup struct {
	multicloud.SResourceBase
	CtyunTags

	Status           string `json:"status"`
	Description      string `json:"description"`
	AvailabilityZone string `json:"availability_zone"`
	VolumeID         string `json:"volume_id"`
	FailReason       string `json:"fail_reason"`
	ID               string `json:"id"`
	Size             int32  `json:"size"`
	Container        string `json:"container"`
	Name             string `json:"name"`
	CreatedAt        string `json:"created_at"`
	// contains filtered or unexported fields
}

func (*SDiskBackup) Delete

func (self *SDiskBackup) Delete() error

func (*SDiskBackup) GetDiskId

func (self *SDiskBackup) GetDiskId() string

func (*SDiskBackup) GetDiskType

func (self *SDiskBackup) GetDiskType() string

func (*SDiskBackup) GetGlobalId

func (self *SDiskBackup) GetGlobalId() string

func (*SDiskBackup) GetId

func (self *SDiskBackup) GetId() string

func (*SDiskBackup) GetName

func (self *SDiskBackup) GetName() string

func (*SDiskBackup) GetProjectId

func (self *SDiskBackup) GetProjectId() string

func (*SDiskBackup) GetSizeMb

func (self *SDiskBackup) GetSizeMb() int32

func (*SDiskBackup) GetStatus

func (self *SDiskBackup) GetStatus() string

func (*SDiskBackup) IsEmulated

func (self *SDiskBackup) IsEmulated() bool

func (*SDiskBackup) Refresh

func (self *SDiskBackup) Refresh() error

type SDiskBacupPolicy

type SDiskBacupPolicy struct {
	multicloud.SResourceBase
	CtyunTags

	PolicyResourceCount int64           `json:"policy_resource_count"`
	BackupPolicyName    string          `json:"backup_policy_name"`
	ScheduledPolicy     ScheduledPolicy `json:"scheduled_policy"`
	BackupPolicyID      string          `json:"backup_policy_id"`
	// contains filtered or unexported fields
}

func (*SDiskBacupPolicy) GetGlobalId

func (self *SDiskBacupPolicy) GetGlobalId() string

func (*SDiskBacupPolicy) GetId

func (self *SDiskBacupPolicy) GetId() string

func (*SDiskBacupPolicy) GetName

func (self *SDiskBacupPolicy) GetName() string

func (*SDiskBacupPolicy) GetProjectId

func (self *SDiskBacupPolicy) GetProjectId() string

func (*SDiskBacupPolicy) GetRepeatWeekdays

func (self *SDiskBacupPolicy) GetRepeatWeekdays() ([]int, error)

func (*SDiskBacupPolicy) GetRetentionDays

func (self *SDiskBacupPolicy) GetRetentionDays() int

func (*SDiskBacupPolicy) GetStatus

func (self *SDiskBacupPolicy) GetStatus() string

func (*SDiskBacupPolicy) GetTimePoints

func (self *SDiskBacupPolicy) GetTimePoints() ([]int, error)

func (*SDiskBacupPolicy) IsActivated

func (self *SDiskBacupPolicy) IsActivated() bool

func (*SDiskBacupPolicy) IsEmulated

func (self *SDiskBacupPolicy) IsEmulated() bool

func (*SDiskBacupPolicy) Refresh

func (self *SDiskBacupPolicy) Refresh() error

type SDiskDetails

type SDiskDetails struct {
	HostID     string      `json:"hostId"`
	Name       string      `json:"name"`
	Status     string      `json:"status"`
	PrivateIPS []PrivateIP `json:"privateIps"`
	PublicIPS  []PublicIP  `json:"publicIps"`
	Volumes    []Volume    `json:"volumes"`
	Created    string      `json:"created"`
	FlavorObj  FlavorObj   `json:"flavorObj"`
}

type SEip

type SEip struct {
	multicloud.SEipBase
	CtyunTags

	IPVersion           int64   `json:"ip_version"`
	BandwidthShareType  string  `json:"bandwidth_share_type"`
	Type                string  `json:"type"`
	PrivateIPAddress    string  `json:"private_ip_address"`
	EnterpriseProjectID string  `json:"enterprise_project_id"`
	Status              string  `json:"status"`
	PublicIPAddress     string  `json:"public_ip_address"`
	ID                  string  `json:"id"`
	TenantID            string  `json:"tenant_id"`
	Profile             Profile `json:"profile"`
	BandwidthName       string  `json:"bandwidth_name"`
	BandwidthID         string  `json:"bandwidth_id"`
	PortID              string  `json:"port_id"`
	BandwidthSize       int     `json:"bandwidth_size"`
	CreateTime          int64   `json:"create_time"`
	MasterOrderID       string  `json:"masterOrderId"`
	WorkOrderResourceID string  `json:"workOrderResourceId"`
	ExpireTime          int64   `json:"expireTime"`
	IsFreeze            int64   `json:"isFreeze"`
	// contains filtered or unexported fields
}

func (*SEip) Associate

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

func (*SEip) ChangeBandwidth

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

func (*SEip) Delete

func (self *SEip) Delete() error

func (*SEip) Dissociate

func (self *SEip) Dissociate() error

func (*SEip) GetAssociationExternalId

func (self *SEip) GetAssociationExternalId() string

eip查询接口未返回 绑定的实例ID/网卡port id。导致不能正常找出关联的主机

func (*SEip) GetAssociationType

func (self *SEip) GetAssociationType() string

func (*SEip) GetBillingType

func (self *SEip) GetBillingType() string

func (*SEip) GetCreatedAt

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

func (*SEip) GetExpiredAt

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

func (*SEip) GetGlobalId

func (self *SEip) GetGlobalId() string

func (*SEip) GetINetworkId

func (self *SEip) GetINetworkId() string

func (*SEip) GetId

func (self *SEip) GetId() string

func (*SEip) GetInternetChargeType

func (self *SEip) GetInternetChargeType() string

func (*SEip) GetIpAddr

func (self *SEip) GetIpAddr() string

func (*SEip) GetMode

func (self *SEip) GetMode() string

func (*SEip) GetName

func (self *SEip) GetName() string

func (*SEip) GetProjectId

func (self *SEip) GetProjectId() string

func (*SEip) GetStatus

func (self *SEip) GetStatus() string

func (*SEip) IsEmulated

func (self *SEip) IsEmulated() bool

func (*SEip) Refresh

func (self *SEip) Refresh() error

type SHost

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

func (*SHost) CreateVM

func (*SHost) GetAccessIp

func (self *SHost) GetAccessIp() string

func (*SHost) GetAccessMac

func (self *SHost) GetAccessMac() string

func (*SHost) GetCpuCount

func (self *SHost) GetCpuCount() int

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

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

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(id string) (cloudprovider.ICloudVM, error)

http://ctyun-api-url/apiproxy/v3/ondemand/queryVMDetail

http://ctyun-api-url/apiproxy/v3/queryVMDetail

func (*SHost) GetIWires

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

func (*SHost) GetId

func (self *SHost) GetId() string

func (*SHost) GetIsMaintenance

func (self *SHost) GetIsMaintenance() bool

func (*SHost) GetMemSizeMB

func (self *SHost) GetMemSizeMB() int

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

func (self *SHost) GetVersion() string

func (*SHost) IsEmulated

func (self *SHost) IsEmulated() bool

func (*SHost) Refresh

func (self *SHost) Refresh() error

type SImage

type SImage struct {
	multicloud.SImageBase
	CtyunTags

	ID        string `json:"id"`
	OSType    string `json:"osType"`
	Platform  string `json:"platform"`
	Name      string `json:"name"`
	OSBit     int64  `json:"osBit"`
	OSVersion string `json:"osVersion"`
	MinRAM    int64  `json:"minRam"`
	MinDisk   int64  `json:"minDisk"`
	ImageType string `json:"imageType"`
	Virtual   bool   `json:"virtual"`
	// contains filtered or unexported fields
}

http://ctyun-api-url/apiproxy/v3/order/getImages

func (*SImage) Delete

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

func (*SImage) GetBios

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

func (*SImage) GetCreateTime

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

func (*SImage) GetCreatedAt

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

func (*SImage) GetFullOsName

func (self *SImage) GetFullOsName() string

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

func (self *SImage) GetImageFormat() string

func (*SImage) GetImageStatus

func (self *SImage) GetImageStatus() string

func (*SImage) GetImageType

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

func (*SImage) GetMinOsDiskSizeGb

func (self *SImage) GetMinOsDiskSizeGb() int

func (*SImage) GetMinRamSizeMb

func (self *SImage) GetMinRamSizeMb() int

func (*SImage) GetName

func (self *SImage) GetName() string

func (*SImage) GetOsArch

func (self *SImage) GetOsArch() string

func (*SImage) GetOsDist

func (self *SImage) GetOsDist() string

func (*SImage) GetOsLang

func (self *SImage) GetOsLang() string

func (*SImage) GetOsType

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

func (*SImage) GetOsVersion

func (self *SImage) GetOsVersion() string

func (*SImage) GetSizeByte

func (self *SImage) GetSizeByte() int64

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 {
	multicloud.SInstanceBase
	CtyunTags
	multicloud.SBillingBase

	HostID                           string               `json:"hostId"`
	ID                               string               `json:"id"`
	Name                             string               `json:"name"`
	Status                           string               `json:"status"`
	TenantID                         string               `json:"tenant_id"`
	Metadata                         Metadata             `json:"metadata"`
	Image                            Image                `json:"image"`
	Flavor                           FlavorObj            `json:"flavor"`
	Addresses                        map[string][]Address `json:"addresses"`
	UserID                           string               `json:"user_id"`
	Created                          time.Time            `json:"created"`
	DueDate                          *time.Time           `json:"dueDate"`
	SecurityGroups                   []SecurityGroup      `json:"security_groups"`
	OSEXTAZAvailabilityZone          string               `json:"OS-EXT-AZ:availability_zone"`
	OSExtendedVolumesVolumesAttached []Volume             `json:"os-extended-volumes:volumes_attached"`
	MasterOrderId                    string               `json:"masterOrderId"`
	// contains filtered or unexported fields
}

func (*SInstance) AssignSecurityGroup

func (self *SInstance) AssignSecurityGroup(secgroupId string) error

func (*SInstance) AttachDisk

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

func (*SInstance) ChangeConfig

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

func (*SInstance) DeleteVM

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

func (*SInstance) DeployVM

func (self *SInstance) DeployVM(ctx context.Context, name string, username string, password string, publicKey string, deleteKeypair bool, description string) error

func (*SInstance) DetachDisk

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

func (*SInstance) GetBillingType

func (self *SInstance) GetBillingType() string

func (*SInstance) GetBios

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

func (*SInstance) GetBootOrder

func (self *SInstance) GetBootOrder() string

func (*SInstance) GetCreatedAt

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

func (*SInstance) GetDetails

func (self *SInstance) GetDetails() (*InstanceDetails, error)

func (*SInstance) GetError

func (self *SInstance) GetError() error

func (*SInstance) GetExpiredAt

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

func (*SInstance) GetFullOsName

func (self *SInstance) GetFullOsName() string

func (*SInstance) GetGlobalId

func (self *SInstance) GetGlobalId() string

func (*SInstance) GetHostname

func (self *SInstance) GetHostname() string

func (*SInstance) GetHypervisor

func (self *SInstance) GetHypervisor() string

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

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

func (*SInstance) GetInstanceType

func (self *SInstance) GetInstanceType() string

func (*SInstance) GetMachine

func (self *SInstance) GetMachine() string

func (*SInstance) GetName

func (self *SInstance) GetName() string

func (*SInstance) GetOsArch

func (self *SInstance) GetOsArch() string

func (*SInstance) GetOsDist

func (self *SInstance) GetOsDist() string

func (*SInstance) GetOsLang

func (self *SInstance) GetOsLang() string

func (*SInstance) GetOsType

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

func (*SInstance) GetOsVersion

func (self *SInstance) GetOsVersion() string

func (*SInstance) GetProjectId

func (self *SInstance) GetProjectId() string

func (*SInstance) GetSecurityGroupIds

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

func (*SInstance) GetStatus

func (self *SInstance) GetStatus() string

func (*SInstance) GetVcpuCount

func (self *SInstance) GetVcpuCount() int

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

func (self *SInstance) NextDeviceName() (string, error)

func (*SInstance) RebuildRoot

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

func (*SInstance) Refresh

func (self *SInstance) Refresh() error

func (*SInstance) Renew

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

func (*SInstance) SetSecurityGroups

func (self *SInstance) SetSecurityGroups(secgroupIds []string) error

func (*SInstance) StartVM

func (self *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

func (self *SInstance) UpdateVM(ctx context.Context, name string) error

type SInstanceNic

type SInstanceNic struct {
	FixedIPS  []FixedIP `json:"fixed_ips"`
	PortState string    `json:"port_state"`
	PortID    string    `json:"port_id"`
	MACAddr   string    `json:"mac_addr"`
	NetID     string    `json:"net_id"`

	cloudprovider.DummyICloudNic
	// contains filtered or unexported fields
}

func (*SInstanceNic) GetDriver

func (self *SInstanceNic) GetDriver() string

func (*SInstanceNic) GetINetworkId

func (self *SInstanceNic) GetINetworkId() string

func (*SInstanceNic) GetIP

func (self *SInstanceNic) GetIP() string

func (*SInstanceNic) GetId

func (self *SInstanceNic) GetId() string

func (*SInstanceNic) GetMAC

func (self *SInstanceNic) GetMAC() string

func (*SInstanceNic) InClassicNetwork

func (self *SInstanceNic) InClassicNetwork() bool

type SKeypair

type SKeypair struct {
	Fingerprint string `json:"fingerprint"`
	Name        string `json:"name"`
	PublicKey   string `json:"public_key"`
}

GET http://ctyun-api-url/apiproxy/v3/querySSH POST http://ctyun-api-url/apiproxy/v3/deleteSSH

type SNetwork

type SNetwork struct {
	multicloud.SResourceBase
	CtyunTags

	CIDR            string `json:"cidr"`
	FirstDcn        string `json:"firstDcn"`
	Gateway         string `json:"gateway"`
	Name            string `json:"name"`
	NeutronSubnetID string `json:"neutronSubnetId"`
	RegionID        string `json:"regionId"`
	ResVLANID       string `json:"resVlanId"`
	SecondDcn       string `json:"secondDcn"`
	VLANStatus      string `json:"vlanStatus"`
	VpcID           string `json:"vpcId"`
	ZoneID          string `json:"zoneId"`
	ZoneName        string `json:"zoneName"`
	// 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) GetName

func (self *SNetwork) GetName() string

func (*SNetwork) GetProjectId

func (self *SNetwork) GetProjectId() string

func (*SNetwork) GetPublicScope

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

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 SOrder

type SOrder struct {
	OrderItemID        string            `json:"orderItemId"`
	InstanceID         string            `json:"instanceId"`
	AccountID          string            `json:"accountId"`
	UserID             string            `json:"userId"`
	InnerOrderID       string            `json:"innerOrderId"`
	InnerOrderItemID   string            `json:"innerOrderItemId"`
	ProductID          string            `json:"productId"`
	MasterOrderID      string            `json:"masterOrderId"`
	OrderID            string            `json:"orderId"`
	MasterResourceID   string            `json:"masterResourceId"`
	ResourceID         string            `json:"resourceId"`
	ServiceTag         string            `json:"serviceTag"`
	ResourceType       string            `json:"resourceType"`
	ResourceInfo       string            `json:"resourceInfo"`
	StartDate          int64             `json:"startDate"`
	ExpireDate         int64             `json:"expireDate"`
	CreateDate         int64             `json:"createDate"`
	UpdateDate         int64             `json:"updateDate"`
	Status             int64             `json:"status"`
	WorkOrderID        string            `json:"workOrderId"`
	WorkOrderItemID    string            `json:"workOrderItemId"`
	SalesEntryID       string            `json:"salesEntryId"`
	OrderStatus        int64             `json:"orderStatus"`
	ToOndemand         string            `json:"toOndemand"`
	ItemValue          string            `json:"itemValue"`
	ChargingStatus     int64             `json:"chargingStatus"`
	ChargingDate       int64             `json:"chargingDate"`
	ResourceConfig     string            `json:"resourceConfig"`
	AutoToOnDemand     bool              `json:"autoToOnDemand"`
	BuildingChannel    int64             `json:"buildingChannel"`
	IsPlatformSpecific bool              `json:"isPlatformSpecific"`
	BillingOwner       int64             `json:"billingOwner"`
	IsPackage          bool              `json:"isPackage"`
	CanRelease         bool              `json:"canRelease"`
	IsChargeOff        bool              `json:"isChargeOff"`
	IsPublicTest       int64             `json:"isPublicTest"`
	Master             bool              `json:"master"`
	ResourceConfigMap  ResourceConfigMap `json:"resourceConfigMap"`
}

type SProject

type SProject struct {
	Enabled     bool   `json:"enabled"`
	Name        string `json:"name"`
	Description string `json:"description"`
	ID          string `json:"id"`
}

GET http://ctyun-api-url/apiproxy/v3/ondemand/queryProjectIds

func (*SProject) GetHealthStatus

func (self *SProject) GetHealthStatus() string

func (*SProject) GetRegionID

func (self *SProject) GetRegionID() string

type SRegion

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

	RegionName     string
	Description    string `json:"description"`
	ID             string `json:"id"`
	ParentRegionID string `json:"parent_region_id"`
	Type           string `json:"type"`
	// contains filtered or unexported fields
}

func (*SRegion) AddSecurityGroupRules

func (self *SRegion) AddSecurityGroupRules(secGrpId string, rule cloudprovider.SecurityRule) error

func (*SRegion) ApplySnapshotPolicyToDisks

func (self *SRegion) ApplySnapshotPolicyToDisks(snapshotPolicyId string, diskId string) error

func (*SRegion) AssignSecurityGroup

func (self *SRegion) AssignSecurityGroup(vmId, securityGroupRuleId string) error

POST http://ctyun-api-url/apiproxy/v3/addSecurityGroup 绑定安全组

func (*SRegion) AssociateEip

func (self *SRegion) AssociateEip(publicIpId, networkCardId string) error

这里networkCardId 实际指的是port id

func (*SRegion) AttachDisk

func (self *SRegion) AttachDisk(vmId, volumeId, device string) (string, error)

func (*SRegion) BindingDiskBackupPolicy

func (self *SRegion) BindingDiskBackupPolicy(policyId, resourceId, resourceType string) error

func (*SRegion) CancelSnapshotPolicyToDisks

func (self *SRegion) CancelSnapshotPolicyToDisks(snapshotPolicyId string, diskId string) error

func (*SRegion) ChangeBandwidthEip

func (self *SRegion) ChangeBandwidthEip(name, publicIpId, sizeMb string) error

func (*SRegion) ChangeVMConfig

func (self *SRegion) ChangeVMConfig(vmId, flavorId string) (string, error)

func (*SRegion) CreateDisk

func (self *SRegion) CreateDisk(zoneId, name, diskType, size string) (*SDisk, error)

func (*SRegion) CreateDiskBackup

func (self *SRegion) CreateDiskBackup(name, volumeId, desc string) (string, error)

func (*SRegion) CreateDiskBackupPolicy

func (self *SRegion) CreateDiskBackupPolicy(name, startTime, frequency, rententionNum, firstBackup, status string) error

func (*SRegion) CreateEIP

func (self *SRegion) CreateEIP(eip *cloudprovider.SEip) (cloudprovider.ICloudEIP, error)

func (*SRegion) CreateEip

func (self *SRegion) CreateEip(zoneId, name, size, shareType, chargeType string) (*SEip, error)

func (*SRegion) CreateISecurityGroup

func (*SRegion) CreateIVpc

func (*SRegion) CreateInstance

func (self *SRegion) CreateInstance(zoneId, name, imageId, osType, flavorRef, vpcid, subnetId, secGroupId, adminPass, volumetype string, volumeSize int, dataDisks []cloudprovider.SDiskInfo) (string, error)

创建主机接口目前没有绑定密钥的参数选项,不支持绑定密码。 但是重装系统接口支持绑定密钥

func (*SRegion) CreateNetwork

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

func (*SRegion) CreateSecurityGroup

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

func (*SRegion) CreateSecurityGroupRule

func (self *SRegion) CreateSecurityGroupRule(groupId, direction, ethertype, protocol, remoteIpPrefix string, portRangeMin, portRangeMax int64) error

func (*SRegion) CreateSnapshotPolicy

func (self *SRegion) CreateSnapshotPolicy(*cloudprovider.SnapshotPolicyInput) (string, error)

func (*SRegion) CreateVpc

func (self *SRegion) CreateVpc(name, cidr string) (*SVpc, error)

func (*SRegion) DeleteDisk

func (self *SRegion) DeleteDisk(volumeId string) (string, error)

func (*SRegion) DeleteDiskBackup

func (self *SRegion) DeleteDiskBackup(vbsId string) (string, error)

func (*SRegion) DeleteEip

func (self *SRegion) DeleteEip(publicIpId string) error

func (*SRegion) DeleteNetwork

func (self *SRegion) DeleteNetwork(vpcId, subnetId string) error

func (*SRegion) DeleteSecurityGroup

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

func (*SRegion) DeleteSecurityGroupRule

func (self *SRegion) DeleteSecurityGroupRule(securityGroupRuleId string) error

func (*SRegion) DeleteSnapshotPolicy

func (self *SRegion) DeleteSnapshotPolicy(policyId string) error

func (*SRegion) DeleteVM

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

func (*SRegion) DeleteVpc

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

func (*SRegion) DetachDisk

func (self *SRegion) DetachDisk(vmId, volumeId, device string) (string, error)

func (*SRegion) DissociateEip

func (self *SRegion) DissociateEip(publicIpId string) error

func (*SRegion) FetchProjects

func (self *SRegion) FetchProjects() ([]SProject, error)

func (*SRegion) GetCapabilities

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

func (*SRegion) GetClient

func (self *SRegion) GetClient() *SCtyunClient

func (*SRegion) GetCrmUser

func (self *SRegion) GetCrmUser(t string, crmBizId string, accountId string) (*SCrmUser, error)

func (*SRegion) GetDisk

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

func (*SRegion) GetDiskBackup

func (self *SRegion) GetDiskBackup(diskId string, backupId string) (*SDiskBackup, error)

func (*SRegion) GetDiskBackupPolices

func (self *SRegion) GetDiskBackupPolices() ([]SDiskBacupPolicy, error)

func (*SRegion) GetDiskBackupPolicy

func (self *SRegion) GetDiskBackupPolicy(policyId string) (*SDiskBacupPolicy, error)

func (*SRegion) GetDiskBackups

func (self *SRegion) GetDiskBackups(diskId string) ([]SDiskBackup, error)

func (*SRegion) GetDiskDetailByDiskId

func (self *SRegion) GetDiskDetailByDiskId(diskId string) (*DiskDetails, error)

func (*SRegion) GetDisks

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

func (*SRegion) GetEip

func (self *SRegion) GetEip(eipId string) (*SEip, error)

func (*SRegion) GetEips

func (self *SRegion) GetEips() ([]SEip, error)

func (*SRegion) GetGeographicInfo

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

func (*SRegion) GetGlobalId

func (self *SRegion) GetGlobalId() string

func (*SRegion) GetI18n

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

func (*SRegion) GetIDiskById

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

func (*SRegion) GetIEipById

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

func (*SRegion) GetIHostById

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

func (*SRegion) GetIHosts

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

func (*SRegion) GetISecurityGroupById

func (self *SRegion) GetISecurityGroupById(secgroupId string) (cloudprovider.ICloudSecurityGroup, error)

func (*SRegion) GetISecurityGroupByName

func (*SRegion) GetISnapshotById

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

func (*SRegion) GetISnapshotPolicies

func (self *SRegion) GetISnapshotPolicies() ([]cloudprovider.ICloudSnapshotPolicy, error)

func (*SRegion) GetISnapshotPolicyById

func (self *SRegion) GetISnapshotPolicyById(snapshotPolicyId string) (cloudprovider.ICloudSnapshotPolicy, 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) GetIStoragecaches

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

func (*SRegion) GetIStorages

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

func (*SRegion) GetIVMById

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

func (*SRegion) GetIVpcById

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

func (*SRegion) GetIZoneById

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

func (*SRegion) GetId

func (self *SRegion) GetId() string

func (*SRegion) GetImage

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

func (*SRegion) GetImages

func (self *SRegion) GetImages(imageType string) ([]SImage, error)

func (*SRegion) GetInstanceFlavors

func (self *SRegion) GetInstanceFlavors() ([]FlavorObj, error)

func (*SRegion) GetInstanceVNCUrl

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

func (*SRegion) GetInstances

func (self *SRegion) GetInstances(instanceId string) ([]SInstance, error)

func (*SRegion) GetJob

func (self *SRegion) GetJob(jobId string) (jsonutils.JSONObject, error)

vm & nic job

func (*SRegion) GetKeypair

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

func (*SRegion) GetKeypairs

func (self *SRegion) GetKeypairs() ([]SKeypair, int, error)

GET http://ctyun-api-url/apiproxy/v3/querySSH

func (*SRegion) GetName

func (self *SRegion) GetName() string

func (*SRegion) GetNetwork

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

func (*SRegion) GetNetwroks

func (self *SRegion) GetNetwroks(vpcId string) ([]SNetwork, error)

func (*SRegion) GetNics

func (self *SRegion) GetNics(vmId string) ([]SInstanceNic, error)

func (*SRegion) GetOrder

func (self *SRegion) GetOrder(orderId string) ([]SOrder, error)

func (*SRegion) GetProvider

func (self *SRegion) GetProvider() string

func (*SRegion) GetSecurityGroupDetails

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

func (*SRegion) GetSecurityGroupRules

func (self *SRegion) GetSecurityGroupRules(secgroupId string) ([]SSecurityGroupRule, error)

func (*SRegion) GetSecurityGroups

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

func (*SRegion) GetStatus

func (self *SRegion) GetStatus() string

func (*SRegion) GetVMById

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

func (*SRegion) GetVMDetails

func (self *SRegion) GetVMDetails(vmId string) (*InstanceDetails, error)

func (*SRegion) GetVMs

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

func (*SRegion) GetVbsJob

func (self *SRegion) GetVbsJob(jobId string) (jsonutils.JSONObject, error)

查询云硬盘备份JOB状态信息

func (*SRegion) GetVolumeJob

func (self *SRegion) GetVolumeJob(jobId string) (jsonutils.JSONObject, error)

查询云硬盘JOB状态信息

func (*SRegion) GetVpc

func (self *SRegion) GetVpc(vpcId string) (*SVpc, error)

func (*SRegion) GetVpcs

func (self *SRegion) GetVpcs() ([]SVpc, error)

func (*SRegion) ImportKeypair

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

POST http://ctyun-api-url/apiproxy/v3/createSSH

func (*SRegion) IsEmulated

func (self *SRegion) IsEmulated() bool

func (*SRegion) RebuildVM

func (self *SRegion) RebuildVM(vmId, adminPass, keyName string) (string, error)

func (*SRegion) Refresh

func (self *SRegion) Refresh() error

func (*SRegion) RenewVM

func (self *SRegion) RenewVM(vmId string, bc *billing.SBillingCycle) ([]string, error)

POST http://ctyun-api-url/apiproxy/v3/order/placeRenewOrder 续订

func (*SRegion) ResetVMPassword

func (self *SRegion) ResetVMPassword(vmId, password string) error

func (*SRegion) ResizeDisk

func (self *SRegion) ResizeDisk(volumeId string, newSizeGB string) (string, error)

func (*SRegion) RestartVM

func (self *SRegion) RestartVM(vmId string) error

func (*SRegion) RestoreDisk

func (self *SRegion) RestoreDisk(volumeId, backupId string) (string, error)

func (*SRegion) StartVM

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

func (*SRegion) StopVM

func (self *SRegion) StopVM(vmId string) error

func (*SRegion) SwitchVMOs

func (self *SRegion) SwitchVMOs(vmId, adminPass, keyName, imageRef string) (string, error)

func (*SRegion) UnBindDiskBackupPolicy

func (self *SRegion) UnBindDiskBackupPolicy(policyId, resourceId string) error

func (*SRegion) UnsignSecurityGroup

func (self *SRegion) UnsignSecurityGroup(vmId, securityGroupRuleId string) error

POST http://ctyun-api-url/apiproxy/v3/removeSecurityGroup 解绑安全组

func (*SRegion) UpdateSnapshotPolicy

func (self *SRegion) UpdateSnapshotPolicy(*cloudprovider.SnapshotPolicyInput, string) error

type SSecurityGroup

type SSecurityGroup struct {
	multicloud.SSecurityGroup
	CtyunTags

	ResSecurityGroupID string `json:"resSecurityGroupId"`
	Name               string `json:"name"`
	AccountID          string `json:"accountId"`
	UserID             string `json:"userId"`
	RegionID           string `json:"regionId"`
	ZoneID             string `json:"zoneId"`
	VpcID              string `json:"vpcId"`
	CreateDate         int64  `json:"createDate"`
	Status             int64  `json:"status"`
	// contains filtered or unexported fields
}

func (*SSecurityGroup) Delete

func (self *SSecurityGroup) Delete() error

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

func (self *SSecurityGroup) GetName() string

func (*SSecurityGroup) GetRules

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

func (*SSecurityGroup) GetSecurityRule

func (self *SSecurityGroup) GetSecurityRule(remoteRule SSecurityGroupRule) (cloudprovider.SecurityRule, error)

func (*SSecurityGroup) GetStatus

func (self *SSecurityGroup) GetStatus() string

func (*SSecurityGroup) GetVpcId

func (self *SSecurityGroup) GetVpcId() string

func (*SSecurityGroup) IsEmulated

func (self *SSecurityGroup) IsEmulated() bool

func (*SSecurityGroup) Refresh

func (self *SSecurityGroup) Refresh() error

func (*SSecurityGroup) SyncRules

func (self *SSecurityGroup) SyncRules(common, inAdds, outAdds, inDels, outDels []cloudprovider.SecurityRule) error

type SSecurityGroupRule

type SSecurityGroupRule struct {
	PortRangeMax    int64  `json:"port_range_max"`
	SecurityGroupID string `json:"security_group_id"`
	RemoteGroupId   string `json:"remote_group_id"`
	Description     string `json:"description"`
	RemoteIPPrefix  string `json:"remote_ip_prefix"`
	Protocol        string `json:"protocol"`
	Ethertype       string `json:"ethertype"`
	UpdatedAt       string `json:"updated_at"`
	Direction       string `json:"direction"`
	TenantID        string `json:"tenant_id"`
	ID              string `json:"id"`
	ProjectID       string `json:"project_id"`
	PortRangeMin    int64  `json:"port_range_min"`
	CreatedAt       string `json:"created_at"`
	// contains filtered or unexported fields
}

type SStorage

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

func (*SStorage) CreateIDisk

func (*SStorage) GetCapacityMB

func (self *SStorage) GetCapacityMB() int64

func (*SStorage) GetCapacityUsedMB

func (self *SStorage) GetCapacityUsedMB() int64

func (*SStorage) GetEnabled

func (self *SStorage) GetEnabled() bool

func (*SStorage) GetGlobalId

func (self *SStorage) GetGlobalId() string

func (*SStorage) GetIDiskById

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

func (*SStorage) GetIDisks

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

http://ctyun-api-url/apiproxy/v3/ondemand/queryVolumes

http://ctyun-api-url/apiproxy/v3/queryDataDisks

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

func (self *SStorage) GetMediumType() string

func (*SStorage) GetMountPoint

func (self *SStorage) GetMountPoint() string

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

func (self *SStorage) IsSysDiskStore() bool

func (*SStorage) Refresh

func (self *SStorage) Refresh() error

type SStoragecache

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

func (*SStoragecache) CreateIImage

func (self *SStoragecache) CreateIImage(snapshotId, 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) GetICloudImages

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

func (*SStoragecache) GetICustomizedCloudImages

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

func (*SStoragecache) GetIImageById

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

func (*SStoragecache) GetId

func (self *SStoragecache) GetId() string

func (*SStoragecache) GetName

func (self *SStoragecache) GetName() string

func (*SStoragecache) GetPath

func (self *SStoragecache) GetPath() 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(ctx context.Context, userCred mcclient.TokenCredential, image *cloudprovider.SImageCreateOption, update func(progress float32)) (string, error)

type SVncInfo

type SVncInfo struct {
	Type string `json:"type"`
	URL  string `json:"url"`
}

type SVpc

type SVpc struct {
	multicloud.SVpc
	CtyunTags

	ResVpcID   string `json:"resVpcId"`
	Name       string `json:"name"`
	CIDR       string `json:"cidr"`
	ZoneID     string `json:"zoneId"`
	ZoneName   string `json:"zoneName"`
	VpcStatus  string `json:"vpcStatus"`
	RegionID   string `json:"regionId"`
	CreateDate int64  `json:"createDate"`
	// 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) GetIRouteTableById

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

func (*SVpc) GetIRouteTables

func (self *SVpc) GetIRouteTables() ([]cloudprovider.ICloudRouteTable, 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) 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

type SWire

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

func (*SWire) CreateINetwork

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

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

func (*SWire) GetId

func (self *SWire) GetId() string

func (*SWire) GetName

func (self *SWire) GetName() string

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 {
	multicloud.SResourceBase
	CtyunTags

	RegionID string `json:"regionId"`
	ZoneID   string `json:"zoneId"`
	ZoneName string `json:"zoneName"`
	ZoneType string `json:"zoneType"`
	// contains filtered or unexported fields
}

func (*SZone) GetGlobalId

func (self *SZone) GetGlobalId() string

func (*SZone) GetI18n

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

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

type ScheduledPolicy struct {
	RententionNum               int    `json:"rentention_num"`
	StartTime                   string `json:"start_time"`
	Status                      string `json:"status"`
	RemainFirstBackupOfCurMonth string `json:"remain_first_backup_of_curMonth"`
	Frequency                   int    `json:"frequency"`
}

type SecurityGroup

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

type SecurityGroupID

type SecurityGroupID struct {
	ID string `json:"id"`
}

type Volume

type Volume struct {
	ID       string `json:"id"`
	Status   string `json:"status"`
	Type     string `json:"type"`
	Size     string `json:"size"`
	Name     string `json:"name"`
	Bootable bool   `json:"bootable"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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