ctyun

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: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLOUD_PROVIDER_CTYUN    = api.CLOUD_PROVIDER_CTYUN
	CLOUD_PROVIDER_CTYUN_CN = "天翼云"
	CLOUD_PROVIDER_CTYUN_EN = CLOUD_PROVIDER_CTYUN

	SERVICE_ECS   = "ecs"
	SERVICE_VPC   = "vpc"
	SERVICE_IMAGE = "image"
	SERVICE_ACCT  = "acct"
	SERVICE_EBS   = "ebs"
)

Variables

View Source
var CtyunRegionIdMap = map[string]string{
	"07323cf87fa811ea977e0242ac110002": "cn-lasa-4",
	"200000001627":                     "cn-fuzhou-5",
	"200000001681":                     "cn-ln-liaoyang-1",
	"200000001703":                     "cn-sd-qd20-public-ctcloud",
	"200000001704":                     "cn-gx-nn23-public-ctcloud",
	"200000001781":                     "cn-hb-wh41-public-ctcloud",
	"200000001788":                     "cn-wulumuqi-27",
	"200000001790":                     "cn-sh36-public-ctcloud",
	"200000001852":                     "cn-huabei2-public-ctcloud",
	"200000001858":                     "cfbr-fsao1-public-ctcloud",
	"200000001859":                     "cfae-fdxb1-public-ctcloud",
	"200000001860":                     "cfde-ffra1-public-ctcloud",
	"200000001861":                     "cfsg-fsin3-public-ctcloud",
	"200000002368":                     "cn-xinan1-public-ctcloud",
	"200000002401":                     "cn-hn-cs42-public-ctcloud",
	"200000002527":                     "cn-jx-khn5-public-ctcloud",
	"21c52b2a876e11ea9f6a0242ac110002": "cn-hangzhou-2",
	"22c0f506ef1d11ea80620242ac110002": "cn-nanjing-4",
	"276826f4313311eaaae30242ac110002": "cn-wuhan-3",
	"2cdd393e876f11ea98880242ac110002": "cn-yaan-2",
	"4009c41a876e11eabdc50242ac110002": "cn-wuhu-1",
	"415089caaea711eab0790242ac110002": "cn-kunming-2",
	"45d9efdad66f11ec9aab0242ac110002": "cn-hefei2",
	"461f819e6e3e11ea9ad30242ac110002": "cn-fujian-3",
	"49829300a71211ea95240242ac110002": "cn-jinzhong-2",
	"52c69bbc042411ec8dac0242ac110002": "cn-nanjing-5",
	"6019b5007a0b11eab5db0242ac110002": "cn-huhehaote-6",
	"60a39fca876e11ea91cf0242ac110002": "cn-nanjing-3",
	"705213b6876e11eaa5740242ac110002": "cn-haikou-2",
	"7dcbf0ba919c11ea83d60242ac110002": "cn-tianjin-2",
	"8062c840876e11ea9d060242ac110002": "cn-wuhan-5",
	"8d11979c4d5d11eab0520242ac110002": "cn-foshan-3",
	"8ef3dba6876e11ea8c2a0242ac110002": "cn-nanning-2",
	"9833d24065a211eaa6070242ac110002": "cn-chenzhou-4",
	"9859b8964d5d11eaba270242ac110002": "cn-jiangxi-2",
	"990ba31c22ec11eaaebd0242ac110002": "cn-hunan-3",
	"995b39bae63811ec8c4b0242ac110002": "cn-guangzhou-5",
	"a10d954c70f411eab3650242ac110002": "cn-chongqing-2",
	"a17034a4794111eaaa590242ac110002": "cn-shanghai-7",
	"a2ed23940b3911ea98040242ac110002": "cn-shanxi-2",
	"aaf589124d5d11eaa04d0242ac110002": "cn-guiyang-1",
	"ad51908ca3db11ea96c20242ac110002": "cn-haerbin-2",
	"aefabf04a3df11eaa3650242ac110002": "cn-zhengzhou-2",
	"b6bb383e876c11ea8a5e0242ac110002": "cn-beijing-5",
	"b7e069bc876e11eaa4c00242ac110002": "cn-xian-4",
	"bb9fdb42056f11eda1610242ac110002": "cn-huadong1-public-ctcloud",
	"d7d93102848711ea9ff10242ac110002": "cn-fuzhou-4",
	"dc3aceb4412211ecb8e70242ac110002": "cn-xian-5",
	"dff35c48876e11eaadc90242ac110002": "cn-lanzhou-3",
	"eeed8c16e13111e9a5b40242ac110002": "cn-nanjing-2",
}
View Source
var LatitudeAndLongitude = map[string]cloudprovider.SGeographicInfo{
	"cn-beijing-5":   api.RegionBeijing,
	"cn-hangzhou-2":  api.RegionHangzhou,
	"cn-nanjing-4":   api.RegionNanjing,
	"cn-wuhan-3":     api.RegionWuhan,
	"cn-yaan-2":      api.RegionXian,
	"cn-wuhu-1":      api.RegionWuhu,
	"cn-kunming-2":   api.RegionKunming,
	"cn-hefei2":      api.RegionHefei,
	"cn-fujian-3":    api.RegionFujian,
	"cn-jinzhong-2":  api.RegionJinzhong,
	"cn-nanjing-5":   api.RegionNanning,
	"cn-huhehaote-6": api.RegionHuhehaote,
	"cn-nanjing-3":   api.RegionNanjing,
	"cn-haikou-2":    api.RegionHaikou,
	"cn-tianjin-2":   api.RegionTianjin,
	"cn-wuhan-5":     api.RegionWuhan,
	"cn-foshan-3":    api.RegionFoshan,
	"cn-nanning-2":   api.RegionNanning,
	"cn-chenzhou-4":  api.RegionChengzhou,
	"cn-jiangxi-2":   api.RegionJiangxi,
	"cn-hunan-3":     api.RegionChangsha,
	"cn-guangzhou-5": api.RegionGuangzhou,
	"cn-chongqing-2": api.RegionChongqing,
	"cn-shanghai-7":  api.RegionShanghai,
	"cn-shanxi-2":    api.RegionXian,
	"cn-guiyang-1":   api.RegionGuiyang,
	"cn-haerbin-2":   api.RegionHaerbin,
	"cn-zhengzhou-2": api.RegionZhengzhou,
	"cn-xian-4":      api.RegionXian,
	"cn-xian-5":      api.RegionXian,
	"cn-lanzhou-3":   api.RegionLanzhou,
	"cn-nanjing-2":   api.RegionNanjing,
}

Functions

func GetBucketName

func GetBucketName(regionId string, imageId string) string

Types

type CtyunClientConfig

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

func NewSCtyunClientConfig

func NewSCtyunClientConfig(accessKey, accessSecret string) *CtyunClientConfig

func (*CtyunClientConfig) CloudproviderConfig

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

func (*CtyunClientConfig) Debug

func (cfg *CtyunClientConfig) Debug(debug bool) *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 FixedIP

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

type SCtyunClient

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

func NewSCtyunClient

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

func (*SCtyunClient) Do

func (self *SCtyunClient) Do(req *http.Request) (*http.Response, error)

func (*SCtyunClient) GetAccessEnv

func (self *SCtyunClient) GetAccessEnv() string

func (*SCtyunClient) GetAccountId

func (client *SCtyunClient) GetAccountId() string

func (*SCtyunClient) GetBalance

func (self *SCtyunClient) GetBalance()

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(id string) (*SRegion, error)

func (*SCtyunClient) GetRegions

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

func (*SCtyunClient) GetSubAccounts

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

type SDisk

type SDisk struct {
	multicloud.SDisk
	CtyunTags
	multicloud.SBillingBase

	DiskName       string
	DiskFreeze     bool
	IsPackaged     bool
	DiskMode       string
	MultiAttach    bool
	ProjectId      string
	RegionId       string
	DiskType       string
	ExpireTime     string
	IsEncrypt      bool
	DiskSize       int
	AzName         string
	DiskStatus     string
	CreateTime     int64
	DiskId         string
	InstanceId     string
	IsSystemVolume bool
	// contains filtered or unexported fields
}

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

func (self *SDisk) GetDiskFormat() string

func (*SDisk) GetDiskSizeMB

func (self *SDisk) GetDiskSizeMB() int

func (*SDisk) GetDiskType

func (self *SDisk) GetDiskType() string

func (*SDisk) GetDriver

func (self *SDisk) GetDriver() string

func (*SDisk) GetExpiredAt

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

func (*SDisk) GetFsFormat

func (self *SDisk) GetFsFormat() string

func (*SDisk) GetGlobalId

func (self *SDisk) GetGlobalId() string

func (*SDisk) GetISnapshot

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

func (*SDisk) GetISnapshots

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

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

func (self *SDisk) GetTemplateId() string

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 SEip

type SEip struct {
	multicloud.SEipBase
	CtyunTags

	Id               string
	Name             string
	EipAddress       string
	AssociationId    string
	AssociationType  string
	PrivateIPAddress string
	Bandwidth        int
	Status           string
	Tags             string
	CreatedAt        time.Time
	UpdatedAt        time.Time
	ExpiredAt        string
	ProjectId        string
	// contains filtered or unexported fields
}

func (*SEip) Associate

func (self *SEip) Associate(opts *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

func (*SEip) GetAssociationType

func (self *SEip) GetAssociationType() string

func (*SEip) GetBandwidth

func (self *SEip) GetBandwidth() int

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) 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) 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 (host *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)

func (*SHost) GetIVMs

func (self *SHost) GetIVMs() ([]cloudprovider.ICloudVM, 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() int64

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

type SImage

type SImage struct {
	multicloud.SImageBase
	CtyunTags

	Architecture     string
	AzName           string
	BootMode         string
	ContainerFormat  string
	CreatedTime      int
	Description      string
	DestinationUser  string
	DiskFormat       string
	DiskId           string
	DiskSize         int
	ImageClass       string
	ImageId          string
	ImageName        string
	ImageType        string
	MaximumRAM       string
	MinimumRAM       string
	OsDistro         string
	OsType           string
	OsVersion        string
	ProjectId        string
	SharedListLength string
	Size             int64
	SourceServerId   string
	SourceUser       string
	Status           string
	Tags             string
	UpdatedTime      string
	Visibility       string
	// contains filtered or unexported fields
}

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

	AzName         string
	ExpiredTime    string
	CreatedTime    time.Time
	ProjectId      string
	AttachedVolume []string
	InstanceId     string
	DisplayName    string
	InstanceName   string
	OsType         int
	InstanceStatus string
	OnDemand       bool
	KeypairName    string
	Addresses      []struct {
		VpcName     string
		AddressList []struct {
			Addr    string
			Version int
			Type    string
		}
	}
	SecGroupList []struct {
		SecurityGroupName string
		SecurityGroupId   string
	}
	VipInfoList   []interface{}
	AffinityGroup string
	Image         struct {
		ImageId   string
		ImageName string
	}
	Flavor struct {
		FlavorId     string
		FlavorName   string
		FlavorCPU    int
		FlavorRAM    int
		GpuType      string
		GpuCount     string
		GpuVendor    string
		VideoMemSize string
	}
	ResourceId      string
	UpdatedTime     time.Time
	AvailableDay    int
	ZabbixName      string
	PrivateIP       string
	PrivateIPv6     string
	VipCount        int
	VpcId           string
	VpcName         string
	SubnetIDList    []string
	FixedIPList     []string
	FloatingIP      string
	NetworkCardList []SInstanceNic
	// contains filtered or unexported fields
}

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 (*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) 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) GetIDisks

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

func (*SInstance) GetIEIP

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

func (*SInstance) GetIHost

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

func (*SInstance) GetINics

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

func (*SInstance) GetId

func (self *SInstance) GetId() string

func (*SInstance) 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) GetVNCInfo

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

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

type SInstanceNic

type SInstanceNic struct {
	IPv4Address   string
	IPv6Address   []string
	IsMaster      bool
	SubnetCidr    string
	NetworkCardId string
	Gateway       string
	SecurityGroup []string
	SubnetId      string

	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
	KeyPairName string
	KeyPairId   string
	PublicKey   string
}

type SNetwork

type SNetwork struct {
	multicloud.SResourceBase
	CtyunTags

	SubnetId          string
	Name              string
	Description       string
	VpcId             string
	CIDR              string
	AvailableIPCount  int
	GatewayIP         string
	AvailabilityZones []string
	RouteTableId      string
	NetworkAclId      string
	Start             string
	End               string
	Ipv6Enabled       int
	Ipv6CIDR          string
	Ipv6Start         string
	Ipv6End           string
	Ipv6GatewayIP     string
	DnsList           []string
	NtpList           []string
	Type              int
	CreateAt          time.Time
	// 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() rbacscope.TRbacScope

func (*SNetwork) GetServerType

func (self *SNetwork) GetServerType() string

func (*SNetwork) GetStatus

func (self *SNetwork) GetStatus() string

func (*SNetwork) Refresh

func (self *SNetwork) Refresh() error

type SProduct

type SProduct struct {
	Ebs struct {
		StorageType []struct {
			Type string
			Name string
		}
	}
	Other struct {
		Region string
	}
}

type SRegion

type SRegion struct {
	multicloud.SRegion
	multicloud.SNoLbRegion
	multicloud.SNoObjectStorageRegion

	IsMultiZones bool
	RegionParent string
	RegionId     string
	RegionType   string
	ZoneList     []string
	RegionName   string
	// contains filtered or unexported fields
}

func (*SRegion) AssignSecurityGroup

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

func (*SRegion) AssociateEip

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

func (*SRegion) AttachDisk

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

func (*SRegion) AttachKeypair

func (self *SRegion) AttachKeypair(vmId, keyName string) error

func (*SRegion) ChangeBandwidthEip

func (self *SRegion) ChangeBandwidthEip(eipId string, bandwidth int) error

func (*SRegion) ChangeVMConfig

func (self *SRegion) ChangeVMConfig(id, instanceType string) error

func (*SRegion) CreateDisk

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

func (*SRegion) CreateEIP

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

func (*SRegion) CreateEip

func (self *SRegion) CreateEip(opts *cloudprovider.SEip) (*SEip, error)

func (*SRegion) CreateISecurityGroup

func (*SRegion) CreateIVpc

func (*SRegion) CreateInstance

func (self *SRegion) CreateInstance(zoneId string, opts *cloudprovider.SManagedVMCreateConfig) (string, error)

func (*SRegion) CreateNetwork

func (self *SRegion) CreateNetwork(vpcId string, opts *cloudprovider.SNetworkCreateOptions) (*SNetwork, error)

func (*SRegion) CreateSecurityGroup

func (self *SRegion) CreateSecurityGroup(opts *cloudprovider.SecurityGroupCreateInput) (*SSecurityGroup, error)

func (*SRegion) CreateSecurityGroupRule

func (self *SRegion) CreateSecurityGroupRule(groupId string, opts *cloudprovider.SecurityGroupRuleCreateOptions) error

func (*SRegion) CreateVpc

func (self *SRegion) CreateVpc(opts *cloudprovider.VpcCreateOptions) (*SVpc, error)

func (*SRegion) DeleteDisk

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

func (*SRegion) DeleteEip

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

func (*SRegion) DeleteNetwork

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

func (*SRegion) DeleteSecgroupRule

func (self *SRegion) DeleteSecgroupRule(groupId, ruleId string, direction secrules.TSecurityRuleDirection) error

func (*SRegion) DeleteSecurityGroup

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

func (*SRegion) DeleteVM

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

func (*SRegion) DeleteVpc

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

func (*SRegion) DetachDisk

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

func (*SRegion) DetachKeypair

func (self *SRegion) DetachKeypair(vmId, keyName string) error

func (*SRegion) DissociateEip

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

func (*SRegion) GetCapabilities

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

func (*SRegion) GetClient

func (self *SRegion) GetClient() *SCtyunClient

func (*SRegion) GetCloudEnv

func (self *SRegion) GetCloudEnv() string

func (*SRegion) GetDisk

func (self *SRegion) GetDisk(diskId string) (*SDisk, 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(status string) ([]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) GetIEips

func (self *SRegion) GetIEips() ([]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) GetISecurityGroups

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

func (*SRegion) GetISnapshotById

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

func (*SRegion) GetISnapshots

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

func (*SRegion) GetIStorageById

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

func (*SRegion) GetIStoragecacheById

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

func (*SRegion) 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) GetIVMs

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

func (*SRegion) GetIVpcById

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

func (*SRegion) GetIVpcs

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

func (*SRegion) GetIZoneById

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

func (*SRegion) GetIZones

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

func (*SRegion) GetId

func (self *SRegion) GetId() string

func (*SRegion) GetImage

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

func (*SRegion) GetImages

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

func (*SRegion) GetInstance

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

func (*SRegion) GetInstanceVnc

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

func (*SRegion) GetInstances

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

func (*SRegion) GetKeypairs

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

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

func (self *SRegion) GetProduct() (*SProduct, error)

func (*SRegion) GetProvider

func (self *SRegion) GetProvider() string

func (*SRegion) GetResourceId

func (self *SRegion) GetResourceId(orderId string) (string, error)

func (*SRegion) GetSecurityGroup

func (self *SRegion) GetSecurityGroup(id string) (*SSecurityGroup, error)

func (*SRegion) GetSecurityGroups

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

func (*SRegion) GetServerSkus

func (self *SRegion) GetServerSkus(zoneId string) ([]ServerSku, error)

func (*SRegion) GetStatus

func (self *SRegion) GetStatus() string

func (*SRegion) GetVpc

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

func (*SRegion) GetVpcs

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

func (*SRegion) GetZones

func (self *SRegion) GetZones() ([]SZone, error)

func (*SRegion) ImportKeypair

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

func (*SRegion) RebuildRoot

func (self *SRegion) RebuildRoot(vmId string, opts *cloudprovider.SManagedVMRebuildRootConfig) error

func (*SRegion) RenewVM

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

func (*SRegion) ResetVMPassword

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

func (*SRegion) ResizeDisk

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

func (*SRegion) StartVM

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

func (*SRegion) StopVM

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

func (*SRegion) UnsignSecurityGroup

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

func (*SRegion) UpdateSecurityGroupRule

func (self *SRegion) UpdateSecurityGroupRule(groupId, id string, direction secrules.TSecurityRuleDirection, opts *cloudprovider.SecurityGroupRuleUpdateOptions) error

func (*SRegion) UpdateVM

func (self *SRegion) UpdateVM(vmId string, opts cloudprovider.SInstanceUpdateOptions) error

type SSecurityGroup

type SSecurityGroup struct {
	multicloud.SSecurityGroup
	CtyunTags

	SecurityGroupName string
	Id                string
	VMNum             int
	Origin            string
	//VpcName           string
	//VpcId             string
	CreationTime time.Time
	Description  string
	ProjectId    string

	SecurityGroupRuleList []SSecurityGroupRule
	// 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.ISecurityGroupRule, error)

func (*SSecurityGroup) GetStatus

func (self *SSecurityGroup) GetStatus() string

func (*SSecurityGroup) GetTags

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

func (*SSecurityGroup) GetVpcId

func (self *SSecurityGroup) GetVpcId() string

func (*SSecurityGroup) Refresh

func (self *SSecurityGroup) Refresh() error

type SSecurityGroupRule

type SSecurityGroupRule struct {
	Direction       string
	Priority        int
	Ethertype       string
	Protocol        string
	DestCidrIP      string
	Description     string
	Origin          string
	CreateTime      time.Time
	Id              string
	Action          string
	SecurityGroupId string
	Range           string
	// contains filtered or unexported fields
}

func (*SSecurityGroupRule) Delete

func (self *SSecurityGroupRule) Delete() error

func (*SSecurityGroupRule) GetAction

func (*SSecurityGroupRule) GetCIDRs

func (self *SSecurityGroupRule) GetCIDRs() []string

func (*SSecurityGroupRule) GetDescription

func (self *SSecurityGroupRule) GetDescription() string

func (*SSecurityGroupRule) GetDirection

func (self *SSecurityGroupRule) GetDirection() secrules.TSecurityRuleDirection

func (*SSecurityGroupRule) GetGlobalId

func (self *SSecurityGroupRule) GetGlobalId() string

func (*SSecurityGroupRule) GetPorts

func (self *SSecurityGroupRule) GetPorts() string

func (*SSecurityGroupRule) GetPriority

func (self *SSecurityGroupRule) GetPriority() int

func (*SSecurityGroupRule) GetProtocol

func (self *SSecurityGroupRule) GetProtocol() string

func (*SSecurityGroupRule) Update

type SStorage

type SStorage struct {
	multicloud.SStorageBase
	CtyunTags

	Name string
	// 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)

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

type SStoragecache

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

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, image *cloudprovider.SImageCreateOption, update func(progress float32)) (string, error)

type SVpc

type SVpc struct {
	multicloud.SVpc
	CtyunTags

	VpcId          string
	Name           string
	Description    string
	CIDR           string
	Ipv6Enabled    bool
	SubnetIDs      []string
	NatGatewayIDs  []string
	ProjectId      string
	Ipv6CIDRS      []string
	EnableIpv6     bool
	SecondaryCIDRS []string
	// contains filtered or unexported fields
}

func (*SVpc) Delete

func (self *SVpc) Delete() error

func (*SVpc) GetCidrBlock

func (self *SVpc) GetCidrBlock() string

func (*SVpc) GetGlobalId

func (self *SVpc) GetGlobalId() string

func (*SVpc) GetIRouteTableById

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

func (*SVpc) GetIRouteTables

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

func (*SVpc) GetISecurityGroups

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

func (*SVpc) GetIWireById

func (self *SVpc) GetIWireById(id 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) 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) GetINetworks

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

func (*SWire) GetIVpc

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

func (*SWire) GetIZone

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

func (*SWire) GetId

func (self *SWire) GetId() string

func (*SWire) GetName

func (self *SWire) GetName() string

func (*SWire) GetStatus

func (self *SWire) GetStatus() string

func (*SWire) IsEmulated

func (self *SWire) IsEmulated() bool

type SZone

type SZone struct {
	multicloud.SResourceBase
	CtyunTags

	AzDisplayName string
	Name          string
	// 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) GetStorages

func (self *SZone) GetStorages() ([]SStorage, error)

type ServerSku

type ServerSku struct {
	GpuVendor     string  `json:"gpuVendor"`
	CPUInfo       string  `json:"cpuInfo"`
	BaseBandwidth float64 `json:"baseBandwidth"`
	FlavorName    string  `json:"flavorName"`
	VideoMemSize  int     `json:"videoMemSize"`
	FlavorType    string  `json:"flavorType"`
	FlavorSeries  string  `json:"flavorSeries"`
	FlavorRAM     int     `json:"flavorRAM"`
	NicMultiQueue int     `json:"nicMultiQueue"`
	Pps           string  `json:"pps"`
	FlavorCPU     int     `json:"flavorCPU"`
	Bandwidth     int     `json:"bandwidth"`
	GpuType       string  `json:"gpuType"`
	FlavorId      string  `json:"flavorID"`
	GpuCount      int     `json:"gpuCount"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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