cloudprovider

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: 31 Imported by: 32

Documentation

Overview

Copyright 2019 Yunion

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	RWAccessTypeRW = TRWAccessType("RW")
	RWAccessTypeR  = TRWAccessType("R")

	UserAccessTypeNoRootSquash = TUserAccessType("no_root_squash")
	UserAccessTypeRootSquash   = TUserAccessType("root_squash")
	UserAccessTypeAllSquash    = TUserAccessType("all_squash")
)
View Source
const (
	CloudVMStatusRunning      = "running"
	CloudVMStatusStopping     = "stopping"
	CloudVMStatusSuspend      = "suspend"
	CloudVMStatusStopped      = "stopped"
	CloudVMStatusChangeFlavor = "change_flavor"
	CloudVMStatusDeploying    = "deploying"
	CloudVMStatusOther        = "other"

	ErrNotFound        = errors.ErrNotFound
	ErrDuplicateId     = errors.ErrDuplicateId
	ErrInvalidStatus   = errors.ErrInvalidStatus
	ErrTimeout         = errors.ErrTimeout
	ErrNotImplemented  = errors.ErrNotImplemented
	ErrNotSupported    = errors.ErrNotSupported
	ErrAccountReadOnly = errors.ErrAccountReadOnly

	ErrInvalidProvider     = httperrors.ErrInvalidProvider
	ErrNoBalancePermission = httperrors.ErrNoBalancePermission
)
View Source
const (
	READ_ONLY_SUFFIX = ".readonly"

	CLOUD_CAPABILITY_PROJECT         = "project"
	CLOUD_CAPABILITY_COMPUTE         = "compute"
	CLOUD_CAPABILITY_NETWORK         = "network"
	CLOUD_CAPABILITY_EIP             = "eip"
	CLOUD_CAPABILITY_LOADBALANCER    = "loadbalancer"
	CLOUD_CAPABILITY_OBJECTSTORE     = "objectstore"
	CLOUD_CAPABILITY_RDS             = "rds"
	CLOUD_CAPABILITY_CACHE           = "cache" // 弹性缓存包含redis、memcached
	CLOUD_CAPABILITY_EVENT           = "event"
	CLOUD_CAPABILITY_CLOUDID         = "cloudid"
	CLOUD_CAPABILITY_DNSZONE         = "dnszone"
	CLOUD_CAPABILITY_PUBLIC_IP       = "public_ip"
	CLOUD_CAPABILITY_INTERVPCNETWORK = "intervpcnetwork"
	CLOUD_CAPABILITY_SAML_AUTH       = "saml_auth"    // 是否支持SAML 2.0
	CLOUD_CAPABILITY_QUOTA           = "quota"        // 配额
	CLOUD_CAPABILITY_NAT             = "nat"          // NAT网关
	CLOUD_CAPABILITY_NAS             = "nas"          // NAS
	CLOUD_CAPABILITY_WAF             = "waf"          // WAF
	CLOUD_CAPABILITY_MONGO_DB        = "mongodb"      // MongoDB
	CLOUD_CAPABILITY_ES              = "es"           // ElasticSearch
	CLOUD_CAPABILITY_KAFKA           = "kafka"        // Kafka
	CLOUD_CAPABILITY_APP             = "app"          // App
	CLOUD_CAPABILITY_CDN             = "cdn"          // CDN
	CLOUD_CAPABILITY_CONTAINER       = "container"    // 容器
	CLOUD_CAPABILITY_IPV6_GATEWAY    = "ipv6_gateway" // IPv6网关
	CLOUD_CAPABILITY_TABLESTORE      = "tablestore"   // 表格存储
	CLOUD_CAPABILITY_MODELARTES      = "modelarts"
	CLOUD_CAPABILITY_MISC            = "misc"
)
View Source
const (
	CLOUD_ENV_PUBLIC_CLOUD  = "public"
	CLOUD_ENV_PRIVATE_CLOUD = "private"
	CLOUD_ENV_ON_PREMISE    = "onpremise"

	CLOUD_ENV_PRIVATE_ON_PREMISE = "private_or_onpremise"
)
View Source
const (
	BackupMethodLogical  = TBackupMethod("Logical")
	BackupMethodPhysical = TBackupMethod("Physical")
	BackupMethodUnknown  = TBackupMethod("")
)
View Source
const (
	PublicZone  = TDnsZoneType("PublicZone")
	PrivateZone = TDnsZoneType("PrivateZone")
)
View Source
const (
	ContinuousTTlRange = TDnsTTLRangeType("ContinuousTTlRange")
	DiscreteTTlRange   = TDnsTTLRangeType("DiscreteTTlRange")
)
View Source
const (
	DnsPolicyTypeSimple           = TDnsPolicyType("Simple")           //简单
	DnsPolicyTypeByCarrier        = TDnsPolicyType("ByCarrier")        //运营商
	DnsPolicyTypeByGeoLocation    = TDnsPolicyType("ByGeoLocation")    //地理区域
	DnsPolicyTypeBySearchEngine   = TDnsPolicyType("BySearchEngine")   //搜索引擎
	DnsPolicyTypeIpRange          = TDnsPolicyType("IpRange")          //自定义IP范围
	DnsPolicyTypeWeighted         = TDnsPolicyType("Weighted")         //加权
	DnsPolicyTypeFailover         = TDnsPolicyType("Failover")         //故障转移
	DnsPolicyTypeMultiValueAnswer = TDnsPolicyType("MultiValueAnswer") //多值应答
	DnsPolicyTypeLatency          = TDnsPolicyType("Latency")          //延迟
)
View Source
const (
	DnsTypeA            = TDnsType("A")
	DnsTypeAAAA         = TDnsType("AAAA")
	DnsTypeCAA          = TDnsType("CAA")
	DnsTypeCNAME        = TDnsType("CNAME")
	DnsTypeMX           = TDnsType("MX")
	DnsTypeNS           = TDnsType("NS")
	DnsTypeSRV          = TDnsType("SRV")
	DnsTypeSOA          = TDnsType("SOA")
	DnsTypeTXT          = TDnsType("TXT")
	DnsTypePTR          = TDnsType("PTR")
	DnsTypeDS           = TDnsType("DS")
	DnsTypeDNSKEY       = TDnsType("DNSKEY")
	DnsTypeIPSECKEY     = TDnsType("IPSECKEY")
	DnsTypeNAPTR        = TDnsType("NAPTR")
	DnsTypeSPF          = TDnsType("SPF")
	DnsTypeSSHFP        = TDnsType("SSHFP")
	DnsTypeTLSA         = TDnsType("TLSA")
	DnsTypeREDIRECT_URL = TDnsType("REDIRECT_URL") //显性URL转发
	DnsTypeFORWARD_URL  = TDnsType("FORWARD_URL")  //隐性URL转发
)
View Source
const (
	DnsProductEnterpriseUltimate   = TDnsProductType("DP_EnterpriseUltimate")
	DnsProductEnterpriseStandard   = TDnsProductType("DP_EnterpriseStandard")
	DnsProductEnterpriseBasic      = TDnsProductType("DP_EnterpriseBasic")
	DnsProductPersonalProfessional = TDnsProductType("DP_PersonalProfessional")
	DnsProductFree                 = TDnsProductType("DP_Free")
)
View Source
const (
	IMAGE_STATUS_ACTIVE  = "active"
	IMAGE_STATUS_QUEUED  = "queued"
	IMAGE_STATUS_SAVING  = "saving"
	IMAGE_STATUS_KILLED  = "killed"
	IMAGE_STATUS_DELETED = "deleted"

	ImageTypeSystem     = TImageType("system")
	ImageTypeCustomized = TImageType("customized")
	ImageTypeShared     = TImageType("shared")
	ImageTypeMarket     = TImageType("market")
)
View Source
const (
	CLOUD_SHELL                 = "cloud-shell"
	CLOUD_SHELL_WITHOUT_ENCRYPT = "cloud-shell-without-encrypt"
	CLOUD_CONFIG                = "cloud-config"
	CLOUD_POWER_SHELL           = "powershell"
	CLOUD_EC2                   = "ec2"
)
View Source
const (
	MongoDBBackupStatusCreating  = TMongoDBBackupStatus("creating")
	MongoDBBackupStatusAvailable = TMongoDBBackupStatus("available")
	MongoDBBackupStatusFailed    = TMongoDBBackupStatus("failed")
	MongoDBBackupStatusUnknown   = TMongoDBBackupStatus("unknown")

	MongoDBBackupMethodPhysical = TMongoDBBackupMethod("physical")
	MongoDBBackupMethodLogical  = TMongoDBBackupMethod("logical")

	MongoDBBackupTypeAuto   = TMongoDBBackupType("auto")
	MongoDBBackupTypeManual = TMongoDBBackupType("manual")
)
View Source
const (
	// 50 MB
	MAX_PUT_OBJECT_SIZEBYTES = int64(1024 * 1024 * 50)

	ACLPrivate         = TBucketACLType(s3cli.CANNED_ACL_PRIVATE)
	ACLAuthRead        = TBucketACLType(s3cli.CANNED_ACL_AUTH_READ)
	ACLPublicRead      = TBucketACLType(s3cli.CANNED_ACL_PUBLIC_READ)
	ACLPublicReadWrite = TBucketACLType(s3cli.CANNED_ACL_PUBLIC_READ_WRITE)
	ACLUnknown         = TBucketACLType("")

	META_HEADER_CACHE_CONTROL       = "Cache-Control"
	META_HEADER_CONTENT_TYPE        = "Content-Type"
	META_HEADER_CONTENT_DISPOSITION = "Content-Disposition"
	META_HEADER_CONTENT_ENCODING    = "Content-Encoding"
	META_HEADER_CONTENT_LANGUAGE    = "Content-Language"
	META_HEADER_CONTENT_MD5         = "Content-MD5"

	META_HEADER_PREFIX = "X-Yunion-Meta-"
)
View Source
const (
	RouteTableAssociaToRouter = RouteTableAssociationType("Router")
	RouteTableAssociaToSubnet = RouteTableAssociationType("Subnet")
)
View Source
const (
	RouteTableTypeSystem = RouteTableType("System")
	RouteTableTypeCustom = RouteTableType("Custom")
)
View Source
const (
	SAML_ENTITY_ID_ALIYUN_ROLE  = "urn:alibaba:cloudcomputing"
	SAML_ENTITY_ID_AWS_CN       = "urn:amazon:webservices:cn-north-1"
	SAML_ENTITY_ID_AWS          = "urn:amazon:webservices"
	SAML_ENTITY_ID_QCLOUD       = "cloud.tencent.com"
	SAML_ENTITY_ID_HUAWEI_CLOUD = "https://auth.huaweicloud.com/"
	SAML_ENTITY_ID_GOOGLE       = "google.com"
	SAML_ENTITY_ID_AZURE        = "urn:federation:MicrosoftOnline"
)
View Source
const DEFAULT_DEST_RULE_ID = "default_dest_rule_id"
View Source
const DEFAULT_SRC_RULE_ID = "default_src_rule_id"
View Source
const ErrAddressCountExceed = errors.Error("ErrAddressCountExceed")
View Source
const (
	ErrNoSuchProvder = errors.Error("no such provider")
)
View Source
const (
	SET_TAGS = "set-tags"
)

Variables

View Source
var (
	DnsPolicyValueEmpty = TDnsPolicyValue("")

	DnsPolicyValueUnicom      = TDnsPolicyValue("unicom")
	DnsPolicyValueTelecom     = TDnsPolicyValue("telecom")
	DnsPolicyValueChinaMobile = TDnsPolicyValue("chinamobile")
	DnsPolicyValueCernet      = TDnsPolicyValue("cernet")
	DnsPolicyValueDrPeng      = TDnsPolicyValue("drpeng")
	DnsPolicyValueBtvn        = TDnsPolicyValue("btvn")

	DnsPolicyValueOversea  = TDnsPolicyValue("oversea")
	DnsPolicyValueMainland = TDnsPolicyValue("mainland")

	DnsPolicyValueBaidu   = TDnsPolicyValue("baidu")
	DnsPolicyValueGoogle  = TDnsPolicyValue("google")
	DnsPolicyValueBing    = TDnsPolicyValue("bing")
	DnsPolicyValueYoudao  = TDnsPolicyValue("youdao")
	DnsPolicyValueSousou  = TDnsPolicyValue("sousou")
	DnsPolicyValueSougou  = TDnsPolicyValue("sougou")
	DnsPolicyValueQihu360 = TDnsPolicyValue("qihu360")
)
View Source
var (
	ElasticipChargeTypeByTraffic   = TElasticipChargeType("traffic")
	ElasticipChargeTypeByBandwidth = TElasticipChargeType("bandwidth")
)
View Source
var (
	OsTypeLinux   = TOsType(osprofile.OS_TYPE_LINUX)
	OsTypeWindows = TOsType(osprofile.OS_TYPE_WINDOWS)
)
View Source
var (
	BIOS = TBiosType("BIOS")
	UEFI = TBiosType("UEFI")
)
View Source
var (
	ALL_RDS_METRIC_TYPES = []TMetricType{
		RDS_METRIC_TYPE_CPU_USAGE,
		RDS_METRIC_TYPE_MEM_USAGE,
		RDS_METRIC_TYPE_NET_BPS_RX,
		RDS_METRIC_TYPE_NET_BPS_TX,

		RDS_METRIC_TYPE_DISK_USAGE,
		RDS_METRIC_TYPE_DISK_READ_BPS,
		RDS_METRIC_TYPE_DISK_WRITE_BPS,
		RDS_METRIC_TYPE_DISK_IO_PERCENT,

		RDS_METRIC_TYPE_CONN_COUNT,
		RDS_METRIC_TYPE_CONN_ACTIVE,
		RDS_METRIC_TYPE_CONN_USAGE,
		RDS_METRIC_TYPE_CONN_FAILED,

		RDS_METRIC_TYPE_QPS,
		RDS_METRIC_TYPE_TPS,
		RDS_METRIC_TYPE_INNODB_READ_BPS,
		RDS_METRIC_TYPE_INNODB_WRITE_BPS,
	}

	ALL_HOST_METRIC_TYPES = []TMetricType{
		HOST_METRIC_TYPE_CPU_USAGE,
		HOST_METRIC_TYPE_MEM_USAGE,
		HOST_METRIC_TYPE_DISK_IO_READ_BPS,
		HOST_METRIC_TYPE_DISK_IO_WRITE_BPS,
		HOST_METRIC_TYPE_NET_BPS_RX,
		HOST_METRIC_TYPE_NET_BPS_TX,
	}

	ALL_VM_METRIC_TYPES = []TMetricType{
		VM_METRIC_TYPE_CPU_USAGE,
		VM_METRIC_TYPE_MEM_USAGE,
		VM_METRIC_TYPE_DISK_USAGE,

		VM_METRIC_TYPE_DISK_IO_READ_BPS,
		VM_METRIC_TYPE_DISK_IO_WRITE_BPS,
		VM_METRIC_TYPE_DISK_IO_READ_IOPS,
		VM_METRIC_TYPE_DISK_IO_WRITE_IOPS,

		VM_METRIC_TYPE_NET_BPS_RX,
		VM_METRIC_TYPE_NET_BPS_TX,
	}

	ALL_REDIS_METRIC_TYPES = []TMetricType{
		REDIS_METRIC_TYPE_CPU_USAGE,
		REDIS_METRIC_TYPE_MEM_USAGE,
		REDIS_METRIC_TYPE_NET_BPS_RX,
		REDIS_METRIC_TYPE_NET_BPS_TX,
		REDIS_METRIC_TYPE_USED_CONN,
		REDIS_METRIC_TYPE_OPT_SES,
		REDIS_METRIC_TYPE_CACHE_KEYS,
		REDIS_METRIC_TYPE_CACHE_EXP_KEYS,
		REDIS_METRIC_TYPE_DATA_MEM_USAGE,
	}

	ALL_LB_METRIC_TYPES = []TMetricType{
		LB_METRIC_TYPE_SNAT_PORT,
		LB_METRIC_TYPE_SNAT_CONN_COUNT,
		LB_METRIC_TYPE_NET_BPS_RX,
		LB_METRIC_TYPE_NET_BPS_TX,
		LB_METRIC_TYPE_HRSP_COUNT,
	}

	ALL_BUCKET_TYPES = []TMetricType{
		BUCKET_METRIC_TYPE_NET_BPS_TX,
		BUCKET_METRIC_TYPE_NET_BPS_RX,
		BUCKET_METRIC_TYPE_LATECY,
		BUCKET_METRYC_TYPE_REQ_COUNT,
	}

	ALL_K8S_NODE_TYPES = []TMetricType{
		K8S_NODE_METRIC_TYPE_CPU_USAGE,
		K8S_NODE_METRIC_TYPE_MEM_USAGE,
	}
)
View Source
var (
	WafTypeCloudFront = TWafType("CloudFront")
	WafTypeRegional   = TWafType("Regional")
	WafTypeDefault    = TWafType("Default")
	WafTypeAppGateway = TWafType("AppGateway")

	WafStatementTypeByteMatch        = TWafStatementType("ByteMatch")
	WafStatementTypeGeoMatch         = TWafStatementType("GeoMatch")
	WafStatementTypeIPSet            = TWafStatementType("IPSet")
	WafStatementTypeLabelMatch       = TWafStatementType("LabelMatch")
	WafStatementTypeManagedRuleGroup = TWafStatementType("ManagedRuleGroup")
	WafStatementTypeRate             = TWafStatementType("Rate")
	WafStatementTypeRegexSet         = TWafStatementType("RegexSet")
	WafStatementTypeRuleGroup        = TWafStatementType("RuleGroup")
	WafStatementTypeSize             = TWafStatementType("Size")
	WafStatementTypeSqliMatch        = TWafStatementType("SqliMatch")
	WafStatementTypeXssMatch         = TWafStatementType("XssMatch")

	WafStatementConditionAnd  = TWafStatementCondition("And")
	WafStatementConditionOr   = TWafStatementCondition("Or")
	WafStatementConditionNot  = TWafStatementCondition("Not")
	WafStatementConditionNone = TWafStatementCondition("")

	WafActionAllow      = TWafAction("Allow")
	WafActionBlock      = TWafAction("Block")
	WafActionLog        = TWafAction("Log")
	WafActionCount      = TWafAction("Count")
	WafActionAlert      = TWafAction("Alert")
	WafActionDetection  = TWafAction("Detection")
	WafActionPrevention = TWafAction("Prevention")
	WafActionNone       = TWafAction("")

	WafMatchFieldBody     = TWafMatchField("Body")
	WafMatchFieldJsonBody = TWafMatchField("JsonBody")
	WafMatchFieldQuery    = TWafMatchField("Query")
	WafMatchFieldMethod   = TWafMatchField("Method")
	WafMatchFiledHeader   = TWafMatchField("Header")
	WafMatchFiledUriPath  = TWafMatchField("UriPath")
	WafMatchFiledPostArgs = TWafMatchField("PostArgs")
	WafMatchFiledCookie   = TWafMatchField("Cookie")

	// size
	WafOperatorEQ = TWafOperator("EQ")
	WafOperatorNE = TWafOperator("NE")
	WafOperatorLE = TWafOperator("LE")
	WafOperatorLT = TWafOperator("LT")
	WafOperatorGE = TWafOperator("GE")
	WafOperatorGT = TWafOperator("GT")

	// string
	WafOperatorExactly      = TWafOperator("Exactly")
	WafOperatorStartsWith   = TWafOperator("StartsWith")
	WafOperatorEndsWith     = TWafOperator("EndsWith")
	WafOperatorContains     = TWafOperator("Contains")
	WafOperatorContainsWord = TWafOperator("ContainsWord")
	WafOperatorRegex        = TWafOperator("Regex")

	WafTextTransformationNone              = TWafTextTransformation("")
	WafTextTransformationCompressWithSpace = TWafTextTransformation("CompressWithSpace")
	WafTextTransformationHtmlEntityDecode  = TWafTextTransformation("HtmlEntityDecode")
	WafTextTransformationLowercase         = TWafTextTransformation("Lowercase")
	WafTextTransformationCmdLine           = TWafTextTransformation("CmdLine")
	WafTextTransformationUrlDecode         = TWafTextTransformation("UrlDecode")

	// azure
	WafTextTransformationTrim        = TWafTextTransformation("Trim")
	WafTextTransformationUrlEncode   = TWafTextTransformation("UrlEncode")
	WafTextTransformationRemoveNulls = TWafTextTransformation("RemoveNulls")
)
View Source
var AwsFailovers = []TDnsPolicyValue{
	TDnsPolicyValue("PRIMARY"),
	TDnsPolicyValue("SECONDARY"),
}
View Source
var AwsGeoLocations = []TDnsPolicyValue{}/* 305 elements not displayed */
View Source
var AwsRegions = []TDnsPolicyValue{
	TDnsPolicyValue("us-east-2"),
	TDnsPolicyValue("us-east-1"),
	TDnsPolicyValue("us-west-1"),
	TDnsPolicyValue("us-west-2"),
	TDnsPolicyValue("af-south-1"),
	TDnsPolicyValue("ap-east-1"),
	TDnsPolicyValue("ap-south-1"),
	TDnsPolicyValue("ap-northeast-3"),
	TDnsPolicyValue("ap-northeast-2"),
	TDnsPolicyValue("ap-southeast-1"),
	TDnsPolicyValue("ap-southeast-2"),
	TDnsPolicyValue("ap-northeast-1"),
	TDnsPolicyValue("ca-central-1"),
	TDnsPolicyValue("cn-north-1"),
	TDnsPolicyValue("cn-northwest-1"),
	TDnsPolicyValue("eu-central-1"),
	TDnsPolicyValue("eu-west-1"),
	TDnsPolicyValue("eu-west-2"),
	TDnsPolicyValue("eu-south-1"),
	TDnsPolicyValue("eu-west-3"),
	TDnsPolicyValue("eu-north-1"),
	TDnsPolicyValue("me-south-1"),
	TDnsPolicyValue("sa-east-1"),
	TDnsPolicyValue("us-gov-east-1"),
	TDnsPolicyValue("us-gov-west-1"),
}
View Source
var TtlRangeAliyunEnterpriseStandard = TTlRange{RangeType: ContinuousTTlRange, TTLMinValue: 60, TTLMaxValue: 86400}
View Source
var TtlRangeAliyunEnterpriseUltimate = TTlRange{RangeType: ContinuousTTlRange, TTLMinValue: 1, TTLMaxValue: 86400}
View Source
var TtlRangeAliyunFree = TTlRange{RangeType: ContinuousTTlRange, TTLMinValue: 600, TTLMaxValue: 86400}
View Source
var TtlRangeAliyunPersonal = TTlRange{RangeType: ContinuousTTlRange, TTLMinValue: 600, TTLMaxValue: 86400}
View Source
var TtlRangeAliyunPvtz = TTlRange{RangeType: DiscreteTTlRange, AllowedTTLs: []int64{5, 10, 15, 20, 30, 60, 120, 300, 600, 1800, 3600, 43200, 86400}}
View Source
var TtlRangeQcloudEnterpriseBasic = TTlRange{RangeType: ContinuousTTlRange, TTLMinValue: 60, TTLMaxValue: 604800}
View Source
var TtlRangeQcloudEnterpriseStandard = TTlRange{RangeType: ContinuousTTlRange, TTLMinValue: 30, TTLMaxValue: 604800}
View Source
var TtlRangeQcloudEnterpriseUltimate = TTlRange{RangeType: ContinuousTTlRange, TTLMinValue: 1, TTLMaxValue: 604800}
View Source
var TtlRangeQcloudFree = TTlRange{RangeType: ContinuousTTlRange, TTLMinValue: 600, TTLMaxValue: 604800}
View Source
var TtlRangeQcloudPersonalProfessional = TTlRange{RangeType: ContinuousTTlRange, TTLMinValue: 120, TTLMaxValue: 604800}

Functions

func CompareDnsRecordSet

func CompareDnsRecordSet(iRecords []ICloudDnsRecordSet, local []DnsRecordSet, debug bool) ([]DnsRecordSet, []DnsRecordSet, []DnsRecordSet, []DnsRecordSet)

func CopyObject

func CopyObject(ctx context.Context, blocksz int64, dstBucket ICloudBucket, dstKey string, srcBucket ICloudBucket, srcKey string, dstMeta http.Header, debug bool) error

func CopyPart

func CopyPart(ctx context.Context,
	iDstBucket ICloudBucket, dstKey string, uploadId string, partNumber int,
	iSrcBucket ICloudBucket, srcKey string, rangeOpt *SGetObjectRange,
) (string, error)

func DeletePrefix

func DeletePrefix(ctx context.Context, bucket ICloudBucket, prefix string) error

func FetchMetaFromHttpHeader

func FetchMetaFromHttpHeader(metaPrefix string, headers http.Header) http.Header

func GetCheckTransport

func GetCheckTransport(ts *http.Transport, check func(*http.Request) (func(resp *http.Response), error)) http.RoundTripper

func GetClientRC

func GetClientRC(name, accessUrl, account, secret, provider string, options *jsonutils.JSONDict) (map[string]string, error)

func GetClouduserpolicyWithSubscriptionProviders

func GetClouduserpolicyWithSubscriptionProviders() []string

func GetDnsCapabilities

func GetDnsCapabilities() map[string]SDnsCapability

func GetOnPremiseProviders

func GetOnPremiseProviders() []string

func GetPrivateProviders

func GetPrivateProviders() []string

func GetProviderCloudEnv

func GetProviderCloudEnv(provider string) string

func GetPublicProviders

func GetPublicProviders() []string

func GetRegistedProviderIds

func GetRegistedProviderIds() []string

func GetSupportCloudIdProvider

func GetSupportCloudIdProvider() []string

func GetSupportCloudgroupProviders

func GetSupportCloudgroupProviders() []string

func ICloudObject2JSONObject

func ICloudObject2JSONObject(obj ICloudObject) jsonutils.JSONObject

func IsError

func IsError(err error, errs []string) bool

func IsPolicyOptionEquals

func IsPolicyOptionEquals(o1, o2 *jsonutils.JSONDict) bool

func IsSupportApp

func IsSupportApp(prod ICloudProvider) bool

func IsSupportCDN

func IsSupportCDN(prod ICloudProvider) bool

func IsSupportCapability

func IsSupportCapability(prod ICloudProvider, capa string) bool

func IsSupportCompute

func IsSupportCompute(prod ICloudProvider) bool

func IsSupportContainer

func IsSupportContainer(prod ICloudProvider) bool

func IsSupportDnsZone

func IsSupportDnsZone(prod ICloudProvider) bool

func IsSupportElasticCache

func IsSupportElasticCache(prod ICloudProvider) bool

func IsSupportElasticSearch

func IsSupportElasticSearch(prod ICloudProvider) bool

func IsSupportInterVpcNetwork

func IsSupportInterVpcNetwork(prod ICloudProvider) bool

func IsSupportKafka

func IsSupportKafka(prod ICloudProvider) bool

func IsSupportLoadbalancer

func IsSupportLoadbalancer(prod ICloudProvider) bool

func IsSupportMiscResources

func IsSupportMiscResources(prod ICloudProvider) bool

func IsSupportModelartsPool

func IsSupportModelartsPool(prod ICloudProvider) bool

func IsSupportMongoDB

func IsSupportMongoDB(prod ICloudProvider) bool

func IsSupportNAS

func IsSupportNAS(prod ICloudProvider) bool

func IsSupportNAT

func IsSupportNAT(prod ICloudProvider) bool

func IsSupportObjectstore

func IsSupportObjectstore(prod ICloudProvider) bool

func IsSupportPolicyValue

func IsSupportPolicyValue(v1 TDnsPolicyValue, arr []TDnsPolicyValue) bool

func IsSupportProject

func IsSupportProject(prod ICloudProvider) bool

func IsSupportQuota

func IsSupportQuota(prod ICloudProvider) bool

func IsSupportRds

func IsSupportRds(prod ICloudProvider) bool

func IsSupportTablestore

func IsSupportTablestore(prod ICloudProvider) bool

func IsSupportWaf

func IsSupportWaf(prod ICloudProvider) bool

func IsSupported

func IsSupported(provider string) bool

func IsUEFI

func IsUEFI(ios IOSInfo) bool

func Makedir

func Makedir(ctx context.Context, bucket ICloudBucket, key string) error

func MergeMeta

func MergeMeta(src http.Header, dst http.Header) http.Header

func MetaToHttpHeader

func MetaToHttpHeader(metaPrefix string, meta http.Header) http.Header

func ObjectSetMeta

func ObjectSetMeta(ctx context.Context,
	bucket ICloudBucket, obj ICloudObject,
	meta http.Header,
) error

func RegisterFactory

func RegisterFactory(factory ICloudProviderFactory)

func RetryOnError

func RetryOnError(tryFunc func() error, errs []string, maxTries int) error

func RetryUntil

func RetryUntil(tryFunc func() (bool, error), maxTries int) error

func SetBucketCORS

func SetBucketCORS(ibucket ICloudBucket, rules []SBucketCORSRule) error

func SetTags

func SetTags(ctx context.Context, res ICloudResource, managerId string, tags map[string]string, replace bool) error

func SortSecurityRule

func SortSecurityRule(rules SecurityRuleSet, isAsc bool, info SecRuleInfo)

func UploadObject

func UploadObject(ctx context.Context, bucket ICloudBucket, key string, blocksz int64, input io.Reader, sizeBytes int64, cannedAcl TBucketACLType, storageClass string, meta http.Header, debug bool) error

func Wait

func Wait(interval time.Duration, timeout time.Duration, callback func() (bool, error)) error

func WaitCreated

func WaitCreated(interval time.Duration, timeout time.Duration, callback func() bool) error

func WaitDeleted

func WaitDeleted(res ICloudResource, interval time.Duration, timeout time.Duration) error

func WaitDeletedWithDelay

func WaitDeletedWithDelay(res ICloudResource, delay time.Duration, interval time.Duration, timeout time.Duration) error

func WaitMultiStatus

func WaitMultiStatus(res ICloudResource, expects []string, interval time.Duration, timeout time.Duration) error

func WaitStatus

func WaitStatus(res ICloudResource, expect string, interval time.Duration, timeout time.Duration) error

func WaitStatusWithDelay

func WaitStatusWithDelay(res ICloudResource, expect string, delay time.Duration, interval time.Duration, timeout time.Duration) error

func WaitStatusWithInstanceErrorCheck

func WaitStatusWithInstanceErrorCheck(res ICloudResource, expect string, interval time.Duration, timeout time.Duration, errCheck func() error) error

Types

type AccessGroupRule

type AccessGroupRule struct {
	Id             string
	ExternalId     string
	Priority       int
	RWAccessType   TRWAccessType
	UserAccessType TUserAccessType
	Source         string
}

func (AccessGroupRule) String

func (self AccessGroupRule) String() string

type AccessGroupRuleInfo

type AccessGroupRuleInfo struct {
	MaxPriority             int
	MinPriority             int
	SupportedUserAccessType []TUserAccessType
	Rules                   AccessGroupRuleSet
}

func GetAccessGroupRuleInfo

func GetAccessGroupRuleInfo(group ICloudAccessGroup) (AccessGroupRuleInfo, error)

func (*AccessGroupRuleInfo) Sort

func (self *AccessGroupRuleInfo) Sort()

type AccessGroupRuleSet

type AccessGroupRuleSet []AccessGroupRule

func CompareAccessGroupRules

func CompareAccessGroupRules(src, dest AccessGroupRuleInfo, debug bool) (common, added, removed AccessGroupRuleSet)

func (AccessGroupRuleSet) Len

func (srs AccessGroupRuleSet) Len() int

func (AccessGroupRuleSet) Less

func (srs AccessGroupRuleSet) Less(i, j int) bool

func (AccessGroupRuleSet) Swap

func (srs AccessGroupRuleSet) Swap(i, j int)

type AssociateConfig

type AssociateConfig struct {
	InstanceId    string
	AssociateType string
	Bandwidth     int
	ChargeType    string
}

type Azs

type Azs struct {
	Az    string `json:"az"`
	Count int    `json:"count"`
}

type CdnCreateOptions

type CdnCreateOptions struct {
	Domain      string
	ServiceType string
	Area        string

	Origins SCdnOrigins
}

type DefaultAction

type DefaultAction struct {
	// Allow, Block, Log, Count, Alert, Detection, Prevention
	Action TWafAction

	// 仅Action为Allow时生效
	InsertHeaders map[string]string
	// 仅Action为Block时生效
	Response string
	// 仅Action为Block时生效
	ResponseCode *int
	// 仅Action为Block时生效
	ResponseHeaders map[string]string
}

+onecloud:model-api-gen

func (DefaultAction) IsZero

func (self DefaultAction) IsZero() bool

func (DefaultAction) String

func (self DefaultAction) String() string

type DiskCreateConfig

type DiskCreateConfig struct {
	Name      string
	SizeGb    int
	Desc      string
	ProjectId string
}

type DnsRecordSet

type DnsRecordSet struct {
	Id         string
	ExternalId string

	Desc string

	Enabled       bool
	DnsName       string
	DnsType       TDnsType
	DnsValue      string
	Status        string
	Ttl           int64
	MxPriority    int64
	PolicyType    TDnsPolicyType
	PolicyValue   TDnsPolicyValue
	PolicyOptions *jsonutils.JSONDict
}

func (DnsRecordSet) Equals

func (record DnsRecordSet) Equals(r DnsRecordSet) bool

func (DnsRecordSet) GetDnsName

func (r DnsRecordSet) GetDnsName() string

func (DnsRecordSet) GetDnsType

func (r DnsRecordSet) GetDnsType() TDnsType

func (DnsRecordSet) GetDnsValue

func (r DnsRecordSet) GetDnsValue() string

func (DnsRecordSet) GetEnabled

func (r DnsRecordSet) GetEnabled() bool

func (DnsRecordSet) GetGlobalId

func (r DnsRecordSet) GetGlobalId() string

func (DnsRecordSet) GetMxPriority

func (r DnsRecordSet) GetMxPriority() int64

func (DnsRecordSet) GetName

func (r DnsRecordSet) GetName() string

func (DnsRecordSet) GetPolicyOptions

func (r DnsRecordSet) GetPolicyOptions() *jsonutils.JSONDict

func (DnsRecordSet) GetPolicyType

func (r DnsRecordSet) GetPolicyType() TDnsPolicyType

func (DnsRecordSet) GetPolicyValue

func (r DnsRecordSet) GetPolicyValue() TDnsPolicyValue

func (DnsRecordSet) GetStatus

func (r DnsRecordSet) GetStatus() string

func (DnsRecordSet) GetTTL

func (r DnsRecordSet) GetTTL() int64

func (DnsRecordSet) String

func (record DnsRecordSet) String() string

type DummyICloudNic

type DummyICloudNic struct{}

func (DummyICloudNic) AssignAddress

func (d DummyICloudNic) AssignAddress(ipAddrs []string) error

func (DummyICloudNic) AssignNAddress

func (d DummyICloudNic) AssignNAddress(count int) ([]string, error)

func (DummyICloudNic) GetDriver

func (d DummyICloudNic) GetDriver() string

func (DummyICloudNic) GetINetworkId

func (d DummyICloudNic) GetINetworkId() string

func (DummyICloudNic) GetIP

func (d DummyICloudNic) GetIP() string

func (DummyICloudNic) GetId

func (d DummyICloudNic) GetId() string

func (DummyICloudNic) GetMAC

func (d DummyICloudNic) GetMAC() string

func (DummyICloudNic) GetSubAddress

func (d DummyICloudNic) GetSubAddress() ([]string, error)

func (DummyICloudNic) InClassicNetwork

func (d DummyICloudNic) InClassicNetwork() bool

func (DummyICloudNic) UnassignAddress

func (d DummyICloudNic) UnassignAddress(ipAddrs []string) error

type ElasticSearchAccessInfo

type ElasticSearchAccessInfo struct {
	Domain           string
	PrivateDomain    string
	Vip              string
	Port             int
	PrivatePort      int
	KibanaUrl        string
	KibanaPrivateUrl string
}

+onecloud:model-api-gen

type FileSystemCraeteOptions

type FileSystemCraeteOptions struct {
	Name           string
	Desc           string
	VpcId          string
	NetworkId      string
	Capacity       int64
	StorageType    string
	Protocol       string
	FileSystemType string
	ZoneId         string

	BillingCycle *billing.SBillingCycle
}

type GlobalVpcCreateOptions

type GlobalVpcCreateOptions struct {
	NAME string

	Desc string
}

type GuestDiskCreateOptions

type GuestDiskCreateOptions struct {
	SizeMb    int
	UUID      string
	Driver    string
	StorageId string
}

type IBillingResource

type IBillingResource interface {
	GetBillingType() string
	GetExpiredAt() time.Time
	SetAutoRenew(bc billing.SBillingCycle) error
	Renew(bc billing.SBillingCycle) error
	IsAutoRenew() bool
}

type ICloudAccessGroup

type ICloudAccessGroup interface {
	GetGlobalId() string
	GetName() string
	GetDesc() string
	IsDefault() bool
	GetMaxPriority() int
	GetMinPriority() int
	GetSupporedUserAccessTypes() []TUserAccessType
	GetNetworkType() string
	GetFileSystemType() string
	GetMountTargetCount() int

	GetRules() ([]AccessGroupRule, error)
	SyncRules(common, added, removed AccessGroupRuleSet) error

	Delete() error
}

type ICloudApp

type ICloudApp interface {
	IVirtualResource
	GetEnvironments() ([]ICloudAppEnvironment, error)
	GetTechStack() string
	GetType() string
	GetKind() string
	GetOsType() TOsType
}

type ICloudAppEnvironment

type ICloudAppEnvironment interface {
	IVirtualResource
	GetInstanceType() (string, error)
	GetInstanceNumber() (int, error)
}

type ICloudBucket

type ICloudBucket interface {
	IVirtualResource

	MaxPartCount() int
	MaxPartSizeBytes() int64

	//GetGlobalId() string
	//GetName() string
	GetAcl() TBucketACLType
	GetLocation() string
	GetIRegion() ICloudRegion
	GetStorageClass() string
	GetAccessUrls() []SBucketAccessUrl
	GetStats() SBucketStats
	GetLimit() SBucketStats
	SetLimit(limit SBucketStats) error
	LimitSupport() SBucketStats

	SetAcl(acl TBucketACLType) error

	ListObjects(prefix string, marker string, delimiter string, maxCount int) (SListObjectResult, error)

	CopyObject(ctx context.Context, destKey string, srcBucket, srcKey string, cannedAcl TBucketACLType, storageClassStr string, meta http.Header) error
	GetObject(ctx context.Context, key string, rangeOpt *SGetObjectRange) (io.ReadCloser, error)

	DeleteObject(ctx context.Context, keys string) error
	GetTempUrl(method string, key string, expire time.Duration) (string, error)

	PutObject(ctx context.Context, key string, input io.Reader, sizeBytes int64, cannedAcl TBucketACLType, storageClassStr string, meta http.Header) error

	NewMultipartUpload(ctx context.Context, key string, cannedAcl TBucketACLType, storageClassStr string, meta http.Header) (string, error)
	UploadPart(ctx context.Context, key string, uploadId string, partIndex int, input io.Reader, partSize int64, offset, totalSize int64) (string, error)
	CopyPart(ctx context.Context, key string, uploadId string, partIndex int, srcBucketName string, srcKey string, srcOffset int64, srcLength int64) (string, error)
	CompleteMultipartUpload(ctx context.Context, key string, uploadId string, partEtags []string) error
	AbortMultipartUpload(ctx context.Context, key string, uploadId string) error

	SetWebsite(conf SBucketWebsiteConf) error
	GetWebsiteConf() (SBucketWebsiteConf, error)
	DeleteWebSiteConf() error

	SetCORS(rules []SBucketCORSRule) error
	GetCORSRules() ([]SBucketCORSRule, error)
	DeleteCORS() error

	SetReferer(conf SBucketRefererConf) error
	GetReferer() (SBucketRefererConf, error)

	GetCdnDomains() ([]SCdnDomain, error)

	GetPolicy() ([]SBucketPolicyStatement, error)
	SetPolicy(policy SBucketPolicyStatementInput) error
	DeletePolicy(id []string) ([]SBucketPolicyStatement, error)

	ListMultipartUploads() ([]SBucketMultipartUploads, error)
}

func GetIBucketById

func GetIBucketById(region ICloudRegion, name string) (ICloudBucket, error)

func GetIBucketByName

func GetIBucketByName(region ICloudRegion, name string) (ICloudBucket, error)

type ICloudCDNDomain

type ICloudCDNDomain interface {
	ICloudEnabledResource

	GetArea() string
	GetServiceType() string
	GetCname() string
	GetOrigins() *SCdnOrigins

	Delete() error
}

type ICloudDBInstance

type ICloudDBInstance interface {
	IVirtualResource
	IBillingResource

	Reboot() error

	GetMasterInstanceId() string
	GetSecurityGroupIds() ([]string, error)
	SetSecurityGroups(ids []string) error
	GetPort() int
	GetEngine() string
	GetEngineVersion() string
	//实例规格
	GetInstanceType() string

	GetVcpuCount() int
	GetVmemSizeMB() int //MB
	GetDiskSizeGB() int
	GetDiskSizeUsedMB() int
	//基础版、高可用?
	GetCategory() string
	GetStorageType() string

	GetMaintainTime() string

	GetConnectionStr() string
	GetInternalConnectionStr() string
	GetZone1Id() string
	GetZone2Id() string
	GetZone3Id() string
	GetIVpcId() string
	GetIops() int

	GetDBNetworks() ([]SDBInstanceNetwork, error)
	GetIDBInstanceParameters() ([]ICloudDBInstanceParameter, error)
	GetIDBInstanceDatabases() ([]ICloudDBInstanceDatabase, error)
	GetIDBInstanceAccounts() ([]ICloudDBInstanceAccount, error)
	GetIDBInstanceBackups() ([]ICloudDBInstanceBackup, error)

	ChangeConfig(ctx context.Context, config *SManagedDBInstanceChangeConfig) error

	OpenPublicConnection() error
	ClosePublicConnection() error

	CreateDatabase(conf *SDBInstanceDatabaseCreateConfig) error
	CreateAccount(conf *SDBInstanceAccountCreateConfig) error

	CreateIBackup(conf *SDBInstanceBackupCreateConfig) (string, error)

	RecoveryFromBackup(conf *SDBInstanceRecoveryConfig) error

	Delete() error
}

type ICloudDBInstanceAccount

type ICloudDBInstanceAccount interface {
	GetName() string
	GetStatus() string
	GetHost() string

	GetIDBInstanceAccountPrivileges() ([]ICloudDBInstanceAccountPrivilege, error)

	ResetPassword(password string) error
	GrantPrivilege(database, privilege string) error
	RevokePrivilege(database string) error

	Delete() error
}

type ICloudDBInstanceAccountPrivilege

type ICloudDBInstanceAccountPrivilege interface {
	GetGlobalId() string

	GetPrivilege() string
	GetDBName() string
}

type ICloudDBInstanceBackup

type ICloudDBInstanceBackup interface {
	IVirtualResource

	GetEngine() string
	GetEngineVersion() string
	GetDBInstanceId() string
	GetStartTime() time.Time
	GetEndTime() time.Time
	GetBackupSizeMb() int
	GetDBNames() string
	GetBackupMode() string
	GetBackupMethod() TBackupMethod

	CreateICloudDBInstance(opts *SManagedDBInstanceCreateConfig) (ICloudDBInstance, error)

	Delete() error
}

type ICloudDBInstanceDatabase

type ICloudDBInstanceDatabase interface {
	ICloudResource

	GetCharacterSet() string

	Delete() error
}

type ICloudDBInstanceParameter

type ICloudDBInstanceParameter interface {
	GetGlobalId() string
	GetKey() string
	GetValue() string
	GetDescription() string
}

type ICloudDBInstanceSku

type ICloudDBInstanceSku interface {
	GetName() string
	GetGlobalId() string
	GetStatus() string
	GetEngine() string
	GetEngineVersion() string
	GetStorageType() string
	GetDiskSizeStep() int
	GetMaxDiskSizeGb() int
	GetMinDiskSizeGb() int
	GetIOPS() int
	GetTPS() int
	GetQPS() int
	GetMaxConnections() int
	GetVcpuCount() int
	GetVmemSizeMb() int
	GetCategory() string
	GetZone1Id() string
	GetZone2Id() string
	GetZone3Id() string
	GetZoneId() string
}

type ICloudDisk

type ICloudDisk interface {
	IBillingResource
	IVirtualResource

	GetIStorage() (ICloudStorage, error)
	GetIStorageId() string

	// GetStatus() string
	GetDiskFormat() string
	GetDiskSizeMB() int // MB
	GetIsAutoDelete() bool
	GetTemplateId() string
	GetDiskType() string
	GetFsFormat() string
	GetIsNonPersistent() bool
	GetIops() int

	GetDriver() string
	GetCacheMode() string
	GetMountpoint() string

	GetAccessPath() string

	Delete(ctx context.Context) error

	CreateISnapshot(ctx context.Context, name string, desc string) (ICloudSnapshot, error)
	GetISnapshots() ([]ICloudSnapshot, error)

	GetExtSnapshotPolicyIds() ([]string, error)

	Resize(ctx context.Context, newSizeMB int64) error
	Reset(ctx context.Context, snapshotId string) (string, error)

	Rebuild(ctx context.Context) error
}

type ICloudDnsRecordSet

type ICloudDnsRecordSet interface {
	GetGlobalId() string

	GetDnsName() string
	GetStatus() string
	GetEnabled() bool
	GetDnsType() TDnsType
	GetDnsValue() string
	GetTTL() int64
	GetMxPriority() int64

	GetPolicyType() TDnsPolicyType
	GetPolicyValue() TDnsPolicyValue
	GetPolicyOptions() *jsonutils.JSONDict
}

type ICloudDnsZone

type ICloudDnsZone interface {
	ICloudResource

	GetZoneType() TDnsZoneType
	GetOptions() *jsonutils.JSONDict

	GetICloudVpcIds() ([]string, error)
	AddVpc(*SPrivateZoneVpc) error
	RemoveVpc(*SPrivateZoneVpc) error

	GetIDnsRecordSets() ([]ICloudDnsRecordSet, error)
	SyncDnsRecordSets(common, add, del, update []DnsRecordSet) error

	Delete() error

	GetDnsProductType() TDnsProductType
}

type ICloudEIP

type ICloudEIP interface {
	IBillingResource
	IVirtualResource

	GetIpAddr() string
	GetMode() string
	GetINetworkId() string
	GetAssociationType() string
	GetAssociationExternalId() string

	GetBandwidth() int

	GetInternetChargeType() string

	Delete() error

	Associate(conf *AssociateConfig) error
	Dissociate() error

	ChangeBandwidth(bw int) error
}

type ICloudElasticSearch

type ICloudElasticSearch interface {
	IVirtualResource
	IBillingResource

	GetVersion() string
	GetStorageType() string
	GetDiskSizeGb() int
	GetCategory() string

	GetInstanceType() string
	GetVcpuCount() int
	GetVmemSizeGb() int

	GetVpcId() string
	GetNetworkId() string
	GetZoneId() string
	IsMultiAz() bool

	GetAccessInfo() (*ElasticSearchAccessInfo, error)

	Delete() error
}

type ICloudElasticcache

type ICloudElasticcache interface {
	IVirtualResource
	IBillingResource

	GetInstanceType() string
	GetCapacityMB() int
	GetArchType() string
	GetNodeType() string
	GetEngine() string
	GetEngineVersion() string

	GetVpcId() string
	GetZoneId() string
	GetNetworkType() string
	GetNetworkId() string
	GetBandwidth() int
	GetConnections() int

	GetPrivateDNS() string
	GetPrivateIpAddr() string
	GetPrivateConnectPort() int
	GetPublicDNS() string
	GetPublicIpAddr() string
	GetPublicConnectPort() int

	GetMaintainStartTime() string
	GetMaintainEndTime() string

	GetAuthMode() string
	GetSecurityGroupIds() ([]string, error)

	GetICloudElasticcacheAccounts() ([]ICloudElasticcacheAccount, error)
	GetICloudElasticcacheAcls() ([]ICloudElasticcacheAcl, error)
	GetICloudElasticcacheBackups() ([]ICloudElasticcacheBackup, error)
	GetICloudElasticcacheParameters() ([]ICloudElasticcacheParameter, error)

	GetICloudElasticcacheAccount(accountId string) (ICloudElasticcacheAccount, error)
	GetICloudElasticcacheAcl(aclId string) (ICloudElasticcacheAcl, error)
	GetICloudElasticcacheBackup(backupId string) (ICloudElasticcacheBackup, error)

	Restart() error
	Delete() error
	ChangeInstanceSpec(spec string) error
	SetMaintainTime(maintainStartTime, maintainEndTime string) error
	AllocatePublicConnection(port int) (string, error) // return url & error info
	ReleasePublicConnection() error

	CreateAccount(account SCloudElasticCacheAccountInput) (ICloudElasticcacheAccount, error)
	CreateAcl(aclName, securityIps string) (ICloudElasticcacheAcl, error)
	CreateBackup(desc string) (ICloudElasticcacheBackup, error)
	FlushInstance(input SCloudElasticCacheFlushInstanceInput) error
	UpdateAuthMode(noPasswordAccess bool, password string) error
	UpdateInstanceParameters(config jsonutils.JSONObject) error
	UpdateBackupPolicy(config SCloudElasticCacheBackupPolicyUpdateInput) error

	UpdateSecurityGroups(secgroupIds []string) error
}

type ICloudElasticcacheAccount

type ICloudElasticcacheAccount interface {
	ICloudResource

	GetAccountType() string
	GetAccountPrivilege() string

	Delete() error
	ResetPassword(input SCloudElasticCacheAccountResetPasswordInput) error
	UpdateAccount(input SCloudElasticCacheAccountUpdateInput) error
}

type ICloudElasticcacheAcl

type ICloudElasticcacheAcl interface {
	ICloudResource

	GetIpList() string

	Delete() error
	UpdateAcl(securityIps string) error
}

type ICloudElasticcacheBackup

type ICloudElasticcacheBackup interface {
	ICloudResource

	GetBackupSizeMb() int
	GetBackupType() string
	GetBackupMode() string
	GetDownloadURL() string

	GetStartTime() time.Time
	GetEndTime() time.Time

	Delete() error
	RestoreInstance(instanceId string) error
}

type ICloudElasticcacheParameter

type ICloudElasticcacheParameter interface {
	ICloudResource

	GetParameterKey() string
	GetParameterValue() string
	GetParameterValueRange() string
	GetDescription() string
	GetModifiable() bool
	GetForceRestart() bool
}

type ICloudElasticcacheSku

type ICloudElasticcacheSku interface {
	GetName() string
	GetGlobalId() string
	GetZoneId() string
	GetSlaveZoneId() string
	GetEngineArch() string
	GetLocalCategory() string
	GetPrepaidStatus() string
	GetPostpaidStatus() string
	GetEngine() string
	GetEngineVersion() string
	GetCpuArch() string
	GetStorageType() string
	GetMemorySizeMb() int
	GetPerformanceType() string
	GetNodeType() string
	GetDiskSizeGb() int
	GetShardNum() int
	GetMaxShardNum() int
	GetReplicasNum() int
	GetMaxReplicasNum() int
	GetMaxClients() int
	GetMaxConnections() int
	GetMaxInBandwidthMb() int
	GetMaxMemoryMb() int
	GetQps() int
}

type ICloudEnabledResource

type ICloudEnabledResource interface {
	ICloudResource
	GetEnabled() bool
}

type ICloudEvent

type ICloudEvent interface {
	GetName() string
	GetService() string
	GetAction() string
	GetResourceType() string
	GetRequestId() string
	GetRequest() jsonutils.JSONObject
	GetAccount() string
	IsSuccess() bool

	GetCreatedAt() time.Time
}

type ICloudFileSystem

type ICloudFileSystem interface {
	ICloudResource
	IBillingResource

	GetFileSystemType() string
	GetStorageType() string
	GetProtocol() string
	GetCapacityGb() int64
	GetUsedCapacityGb() int64
	GetMountTargetCountLimit() int

	GetZoneId() string

	GetMountTargets() ([]ICloudMountTarget, error)
	CreateMountTarget(opts *SMountTargetCreateOptions) (ICloudMountTarget, error)

	Delete() error
}

type ICloudGlobalVpc

type ICloudGlobalVpc interface {
	ICloudResource

	Delete() error
}

type ICloudHost

type ICloudHost interface {
	ICloudResource

	GetIVMs() ([]ICloudVM, error)
	GetIVMById(id string) (ICloudVM, error)

	GetIWires() ([]ICloudWire, error)
	GetIStorages() ([]ICloudStorage, error)
	GetIStorageById(id string) (ICloudStorage, error)

	// GetStatus() string     // os status
	GetEnabled() bool      // is enabled
	GetHostStatus() string // service status
	GetAccessIp() string   //
	GetAccessMac() string  //
	GetSysInfo() jsonutils.JSONObject
	GetSN() string
	GetCpuCount() int
	GetNodeCount() int8
	GetCpuDesc() string
	GetCpuMhz() int
	GetCpuCmtbound() float32
	GetCpuArchitecture() string

	GetMemSizeMB() int
	GetMemCmtbound() float32
	GetReservedMemoryMb() int
	GetStorageSizeMB() int
	GetStorageType() string
	GetHostType() string

	GetIsMaintenance() bool
	GetVersion() string

	CreateVM(desc *SManagedVMCreateConfig) (ICloudVM, error)
	GetIHostNics() ([]ICloudHostNetInterface, error)

	GetSchedtags() ([]string, error)

	GetOvnVersion() string // just for cloudpods host
}

type ICloudHostNetInterface

type ICloudHostNetInterface interface {
	GetDevice() string
	GetDriver() string
	GetMac() string
	GetIndex() int8
	IsLinkUp() tristate.TriState
	GetIpAddr() string
	GetMtu() int32
	GetNicType() string
	GetBridge() string
}

type ICloudI18nResource

type ICloudI18nResource interface {
	GetI18n() SModelI18nTable
}

type ICloudIPv6Gateway

type ICloudIPv6Gateway interface {
	IVirtualResource

	GetInstanceType() string
}

type ICloudImage

type ICloudImage interface {
	IVirtualResource

	IOSInfo

	Delete(ctx context.Context) error
	GetIStoragecache() ICloudStoragecache

	GetSizeByte() int64
	GetImageType() TImageType
	GetImageStatus() string

	GetMinOsDiskSizeGb() int
	GetMinRamSizeMb() int
	GetImageFormat() string

	GetPublicScope() rbacutils.TRbacScope
	GetSubImages() []SSubImage
}

type ICloudInstanceSnapshot

type ICloudInstanceSnapshot interface {
	IVirtualResource

	GetDescription() string
	Delete() error
}

type ICloudInterVpcNetwork

type ICloudInterVpcNetwork interface {
	ICloudResource
	GetAuthorityOwnerId() string
	GetICloudVpcIds() ([]string, error)
	AttachVpc(opts *SInterVpcNetworkAttachVpcOption) error
	DetachVpc(opts *SInterVpcNetworkDetachVpcOption) error
	Delete() error
	GetIRoutes() ([]ICloudInterVpcNetworkRoute, error)
	EnableRouteEntry(routeId string) error
	DisableRouteEntry(routeId string) error
}

type ICloudInterVpcNetworkRoute

type ICloudInterVpcNetworkRoute interface {
	ICloudResource
	GetInstanceId() string
	GetInstanceType() string
	GetInstanceRegionId() string

	GetEnabled() bool
	GetCidr() string
}

type ICloudInterfaceAddress

type ICloudInterfaceAddress interface {
	GetGlobalId() string //返回IP即可

	GetINetworkId() string
	GetIP() string
	IsPrimary() bool
}

type ICloudInternetGateway

type ICloudInternetGateway interface {
	ICloudResource
}

type ICloudKafka

type ICloudKafka interface {
	IVirtualResource
	IBillingResource

	GetNetworkId() string
	GetVpcId() string
	GetZoneId() string
	GetInstanceType() string

	GetVersion() string
	GetDiskSizeGb() int
	GetStorageType() string
	GetBandwidthMb() int
	GetEndpoint() string
	GetMsgRetentionMinute() int

	IsMultiAz() bool

	GetTopics() ([]SKafkaTopic, error)

	Delete() error
}

type ICloudKubeCluster

type ICloudKubeCluster interface {
	ICloudEnabledResource

	GetKubeConfig(private bool, expireMinutes int) (*SKubeconfig, error)

	GetIKubeNodePools() ([]ICloudKubeNodePool, error)
	GetIKubeNodes() ([]ICloudKubeNode, error)

	Delete(isRetain bool) error
}

type ICloudKubeNode

type ICloudKubeNode interface {
	ICloudResource

	GetINodePoolId() string
}

type ICloudKubeNodePool

type ICloudKubeNodePool interface {
	ICloudResource
}

type ICloudLoadbalancer

type ICloudLoadbalancer interface {
	IVirtualResource

	GetAddress() string
	GetAddressType() string
	GetNetworkType() string
	GetNetworkIds() []string
	GetVpcId() string
	GetZoneId() string
	GetZone1Id() string // first slave zone
	GetLoadbalancerSpec() string
	GetChargeType() string
	GetEgressMbps() int

	GetIEIP() (ICloudEIP, error)

	Delete(ctx context.Context) error

	Start() error
	Stop() error

	GetILoadBalancerListeners() ([]ICloudLoadbalancerListener, error)
	GetILoadBalancerBackendGroups() ([]ICloudLoadbalancerBackendGroup, error)

	CreateILoadBalancerBackendGroup(group *SLoadbalancerBackendGroup) (ICloudLoadbalancerBackendGroup, error)
	GetILoadBalancerBackendGroupById(groupId string) (ICloudLoadbalancerBackendGroup, error)

	CreateILoadBalancerListener(ctx context.Context, listener *SLoadbalancerListener) (ICloudLoadbalancerListener, error)
	GetILoadBalancerListenerById(listenerId string) (ICloudLoadbalancerListener, error)
}

type ICloudLoadbalancerAcl

type ICloudLoadbalancerAcl interface {
	IVirtualResource

	GetAclListenerID() string // huawei only
	GetAclEntries() []SLoadbalancerAccessControlListEntry
	Sync(acl *SLoadbalancerAccessControlList) error
	Delete() error
}

type ICloudLoadbalancerBackend

type ICloudLoadbalancerBackend interface {
	IVirtualResource

	GetWeight() int
	GetPort() int
	GetBackendType() string
	GetBackendRole() string
	GetBackendId() string
	GetIpAddress() string // backend type is ip
	SyncConf(ctx context.Context, port, weight int) error
}

type ICloudLoadbalancerBackendGroup

type ICloudLoadbalancerBackendGroup interface {
	IVirtualResource

	IsDefault() bool
	GetType() string
	GetLoadbalancerId() string
	GetILoadbalancerBackends() ([]ICloudLoadbalancerBackend, error)
	GetILoadbalancerBackendById(backendId string) (ICloudLoadbalancerBackend, error)
	GetProtocolType() string                                // huawei only .后端云服务器组的后端协议。
	GetScheduler() string                                   // huawei only
	GetHealthCheck() (*SLoadbalancerHealthCheck, error)     // huawei only
	GetStickySession() (*SLoadbalancerStickySession, error) // huawei only
	AddBackendServer(serverId string, weight int, port int) (ICloudLoadbalancerBackend, error)
	RemoveBackendServer(serverId string, weight int, port int) error

	Delete(ctx context.Context) error
	Sync(ctx context.Context, group *SLoadbalancerBackendGroup) error
}

type ICloudLoadbalancerCertificate

type ICloudLoadbalancerCertificate interface {
	IVirtualResource

	Sync(name, privateKey, publickKey string) error
	Delete() error

	GetCommonName() string
	GetSubjectAlternativeNames() string
	GetFingerprint() string // return value format: <algo>:<fingerprint>,比如sha1:7454a14fdb8ae1ea8b2f72e458a24a76bd23ec19
	GetExpireTime() time.Time
	GetPublickKey() string
	GetPrivateKey() string
}

type ICloudLoadbalancerListener

type ICloudLoadbalancerListener interface {
	IVirtualResource

	GetListenerType() string
	GetListenerPort() int
	GetScheduler() string
	GetAclStatus() string
	GetAclType() string
	GetAclId() string

	GetEgressMbps() int
	GetBackendGroupId() string
	GetBackendServerPort() int

	GetClientIdleTimeout() int
	GetBackendConnectTimeout() int

	// HTTP && HTTPS
	CreateILoadBalancerListenerRule(rule *SLoadbalancerListenerRule) (ICloudLoadbalancerListenerRule, error)
	GetILoadBalancerListenerRuleById(ruleId string) (ICloudLoadbalancerListenerRule, error)
	GetILoadbalancerListenerRules() ([]ICloudLoadbalancerListenerRule, error)
	GetStickySession() string
	GetStickySessionType() string
	GetStickySessionCookie() string
	GetStickySessionCookieTimeout() int
	XForwardedForEnabled() bool
	GzipEnabled() bool

	// HTTPS
	GetCertificateId() string
	GetTLSCipherPolicy() string
	HTTP2Enabled() bool

	// http redirect
	ICloudLoadbalancerRedirect
	ICloudloadbalancerHealthCheck

	Start() error
	Stop() error
	Sync(ctx context.Context, listener *SLoadbalancerListener) error

	Delete(ctx context.Context) error
}

type ICloudLoadbalancerListenerRule

type ICloudLoadbalancerListenerRule interface {
	IVirtualResource
	// http redirect
	ICloudLoadbalancerRedirect

	IsDefault() bool
	GetDomain() string
	GetPath() string
	GetCondition() string
	GetBackendGroupId() string

	Delete(ctx context.Context) error
}

type ICloudLoadbalancerRedirect

type ICloudLoadbalancerRedirect interface {
	GetRedirect() string
	GetRedirectCode() int64
	GetRedirectScheme() string
	GetRedirectHost() string
	GetRedirectPath() string
}

type ICloudMiscResource

type ICloudMiscResource interface {
	IVirtualResource

	GetResourceType() string

	GetConfig() jsonutils.JSONObject
}

type ICloudModelartsPool

type ICloudModelartsPool interface {
	ICloudResource
	IBillingResource

	Delete() error
	GetProjectId() string
	GetInstanceType() string
	GetWorkType() string
	GetNodeCount() int
	ChangeConfig(opts *ModelartsPoolChangeConfigOptions) error
}

type ICloudModelartsPoolSku

type ICloudModelartsPoolSku interface {
	ICloudResource

	GetCpuCoreCount() int
	GetCpuArch() string
	GetStatus() string
	GetMemorySizeMB() int
	GetPoolType() string
	GetGpuSize() int
	GetGpuType() string
	GetNpuSize() int
	GetNpuType() string
}

type ICloudMongoDB

type ICloudMongoDB interface {
	IVirtualResource
	IBillingResource

	GetVpcId() string
	GetNetworkId() string
	GetIpAddr() string
	GetVcpuCount() int
	GetVmemSizeMb() int
	GetDiskSizeMb() int
	GetZoneId() string
	GetReplicationNum() int
	GetCategory() string
	GetEngine() string
	GetEngineVersion() string
	GetInstanceType() string
	GetMaintainTime() string
	GetPort() int
	GetIops() int

	GetMaxConnections() int

	GetNetworkAddress() string

	GetIBackups() ([]SMongoDBBackup, error)

	Delete() error
}

type ICloudMountTarget

type ICloudMountTarget interface {
	GetGlobalId() string
	GetName() string
	GetAccessGroupId() string
	GetDomainName() string
	GetNetworkType() string
	GetVpcId() string
	GetNetworkId() string
	GetStatus() string

	Delete() error
}

type ICloudNatDEntry

type ICloudNatDEntry interface {
	ICloudResource

	GetIpProtocol() string
	GetExternalIp() string
	GetExternalPort() int

	GetInternalIp() string
	GetInternalPort() int

	Delete() error
}

ICloudNatDEntry describe a DNat rule which transfer externalIp:externalPort to internalIp:internalPort with IpProtocol(tcp/udp)

type ICloudNatGateway

type ICloudNatGateway interface {
	ICloudResource
	IBillingResource

	// 获取 NAT 规格
	GetNatSpec() string
	GetIEips() ([]ICloudEIP, error)
	GetINatDTable() ([]ICloudNatDEntry, error)
	GetINatSTable() ([]ICloudNatSEntry, error)

	// ID is the ID of snat entry/rule or dnat entry/rule.
	GetINatDEntryByID(id string) (ICloudNatDEntry, error)
	GetINatSEntryByID(id string) (ICloudNatSEntry, error)

	// Read the description of these two structures before using.
	CreateINatDEntry(rule SNatDRule) (ICloudNatDEntry, error)
	CreateINatSEntry(rule SNatSRule) (ICloudNatSEntry, error)

	GetINetworkId() string
	GetBandwidthMb() int
	GetIpAddr() string

	Delete() error
}

type ICloudNatSEntry

type ICloudNatSEntry interface {
	ICloudResource

	GetIP() string
	GetSourceCIDR() string
	GetNetworkId() string

	Delete() error
}

ICloudNatSEntry describe a SNat rule which transfer internalIp(GetIP()) to externalIp which from sourceCIDR

type ICloudNatSku

type ICloudNatSku interface {
	GetName() string
	GetDesc() string
	GetGlobalId() string
	GetPrepaidStatus() string
	GetPostpaidStatus() string
}

type ICloudNetwork

type ICloudNetwork interface {
	IVirtualResource

	GetIWire() ICloudWire
	// GetStatus() string
	GetIpStart() string
	GetIpEnd() string
	GetIpMask() int8
	GetGateway() string
	GetServerType() string
	//GetIsPublic() bool
	// 仅私有云有用,公有云无效
	// 1. scope = none 非共享, network仅会属于一个项目,并且私有
	// 2. scope = system 系统共享 云账号共享会跟随云账号共享,云账号非共享,会共享到network所在域
	GetPublicScope() rbacutils.TRbacScope

	Delete() error

	GetAllocTimeoutSeconds() int
}

type ICloudNetworkInterface

type ICloudNetworkInterface interface {
	ICloudResource

	GetMacAddress() string
	GetAssociateType() string
	GetAssociateId() string

	GetICloudInterfaceAddresses() ([]ICloudInterfaceAddress, error)
}

type ICloudNic

type ICloudNic interface {
	GetId() string
	GetIP() string
	GetMAC() string
	InClassicNetwork() bool
	GetDriver() string
	GetINetworkId() string

	// GetSubAddress returns non-primary/secondary/alias ipv4 addresses of
	// the network interface
	//
	// Implement it when any AssignXx ops methods are implemented
	GetSubAddress() ([]string, error)
	AssignNAddress(count int) ([]string, error)
	AssignAddress(ipAddrs []string) error
	// UnassignAddress should not return error if the network interface is
	// now not present, or the addresses is not assigned to the network
	// interface in the first place
	UnassignAddress(ipAddrs []string) error
}

type ICloudObject

type ICloudObject interface {
	GetIBucket() ICloudBucket

	GetKey() string
	GetSizeBytes() int64
	GetLastModified() time.Time
	GetStorageClass() string
	GetETag() string

	GetMeta() http.Header
	SetMeta(ctx context.Context, meta http.Header) error

	GetAcl() TBucketACLType
	SetAcl(acl TBucketACLType) error
}

func GetAllObjects

func GetAllObjects(bucket ICloudBucket, objectPrefix string, isRecursive bool) ([]ICloudObject, error)

func GetIObject

func GetIObject(bucket ICloudBucket, objectPrefix string) (ICloudObject, error)

func GetPagedObjects

func GetPagedObjects(bucket ICloudBucket, objectPrefix string, isRecursive bool, marker string, maxCount int) ([]ICloudObject, string, error)

type ICloudProject

type ICloudProject interface {
	ICloudResource

	GetDomainId() string
	GetDomainName() string

	GetAccountId() string
}

type ICloudProvider

type ICloudProvider interface {
	GetFactory() ICloudProviderFactory

	GetSysInfo() (jsonutils.JSONObject, error)
	GetVersion() string
	GetIamLoginUrl() string

	GetIRegions() []ICloudRegion
	GetIProjects() ([]ICloudProject, error)
	CreateIProject(name string) (ICloudProject, error)
	GetIRegionById(id string) (ICloudRegion, error)

	GetOnPremiseIRegion() (ICloudRegion, error)

	GetBalance() (float64, string, error)

	GetSubAccounts() ([]SSubAccount, error)
	GetAccountId() string

	// region external id 是以provider 做为前缀.因此可以通过该判断条件过滤出同一个provider的regions列表
	// 但是华为云有点特殊一个provider只对应一个region,因此需要进一步指定region名字,才能找到provider对应的region
	GetCloudRegionExternalIdPrefix() string

	GetStorageClasses(regionId string) []string
	GetBucketCannedAcls(regionId string) []string
	GetObjectCannedAcls(regionId string) []string

	GetCapabilities() []string

	IsClouduserSupportPassword() bool
	GetICloudusers() ([]IClouduser, error)
	GetISystemCloudpolicies() ([]ICloudpolicy, error)
	GetICustomCloudpolicies() ([]ICloudpolicy, error)
	GetICloudgroups() ([]ICloudgroup, error)
	GetICloudgroupByName(name string) (ICloudgroup, error)
	CreateICloudgroup(name, desc string) (ICloudgroup, error)
	GetIClouduserByName(name string) (IClouduser, error)
	CreateIClouduser(conf *SClouduserCreateConfig) (IClouduser, error)
	CreateICloudSAMLProvider(opts *SAMLProviderCreateOptions) (ICloudSAMLProvider, error)
	GetICloudSAMLProviders() ([]ICloudSAMLProvider, error)
	GetICloudroles() ([]ICloudrole, error)
	GetICloudroleById(id string) (ICloudrole, error)
	GetICloudroleByName(name string) (ICloudrole, error)
	CreateICloudrole(opts *SRoleCreateOptions) (ICloudrole, error)

	CreateICloudpolicy(opts *SCloudpolicyCreateOptions) (ICloudpolicy, error)

	GetEnrollmentAccounts() ([]SEnrollmentAccount, error)
	CreateSubscription(SubscriptionCreateInput) error

	GetSamlEntityId() string

	GetICloudDnsZones() ([]ICloudDnsZone, error)
	GetICloudDnsZoneById(id string) (ICloudDnsZone, error)
	CreateICloudDnsZone(opts *SDnsZoneCreateOptions) (ICloudDnsZone, error)

	GetICloudGlobalVpcs() ([]ICloudGlobalVpc, error)
	CreateICloudGlobalVpc(opts *GlobalVpcCreateOptions) (ICloudGlobalVpc, error)
	GetICloudGlobalVpcById(id string) (ICloudGlobalVpc, error)

	GetICloudInterVpcNetworks() ([]ICloudInterVpcNetwork, error)
	GetICloudInterVpcNetworkById(id string) (ICloudInterVpcNetwork, error)
	CreateICloudInterVpcNetwork(opts *SInterVpcNetworkCreateOptions) (ICloudInterVpcNetwork, error)

	GetICloudCDNDomains() ([]ICloudCDNDomain, error)
	GetICloudCDNDomainByName(name string) (ICloudCDNDomain, error)
	CreateICloudCDNDomain(opts *CdnCreateOptions) (ICloudCDNDomain, error)

	GetMetrics(opts *MetricListOptions) ([]MetricValues, error)
}

func GetProvider

func GetProvider(cfg ProviderConfig) (ICloudProvider, error)

func IsValidCloudAccount

func IsValidCloudAccount(cfg ProviderConfig) (ICloudProvider, string, error)

type ICloudProviderFactory

type ICloudProviderFactory interface {
	GetProvider(cfg ProviderConfig) (ICloudProvider, error)

	GetClientRC(SProviderInfo) (map[string]string, error)

	GetId() string
	GetName() string

	ValidateChangeBandwidth(instanceId string, bandwidth int64) error
	ValidateCreateCloudaccountData(ctx context.Context, userCred mcclient.TokenCredential, input SCloudaccountCredential) (SCloudaccount, error)
	ValidateUpdateCloudaccountCredential(ctx context.Context, userCred mcclient.TokenCredential, input SCloudaccountCredential, cloudaccount string) (SCloudaccount, error)
	GetSupportedBrands() []string

	IsPublicCloud() bool
	IsOnPremise() bool
	IsMultiTenant() bool
	IsSupportPrepaidResources() bool
	NeedSyncSkuFromCloud() bool

	IsCloudeventRegional() bool
	GetMaxCloudEventSyncDays() int
	GetMaxCloudEventKeepDays() int

	IsNeedForceAutoCreateProject() bool

	IsCloudpolicyWithSubscription() bool     // 自定义权限属于订阅级别资源
	IsClouduserpolicyWithSubscription() bool // 绑定用户权限需要指定订阅

	IsSupportCloudIdService() bool
	IsSupportClouduserPolicy() bool
	IsSupportResetClouduserPassword() bool
	GetClouduserMinPolicyCount() int
	IsClouduserNeedInitPolicy() bool
	IsSupportCreateCloudgroup() bool

	IsSystemCloudpolicyUnified() bool // 国内国外权限是否一致

	IsSupportCrossCloudEnvVpcPeering() bool
	IsSupportCrossRegionVpcPeering() bool
	IsSupportVpcPeeringVpcCidrOverlap() bool
	ValidateCrossRegionVpcPeeringBandWidth(bandwidth int) error

	IsSupportModifyRouteTable() bool

	GetSupportedDnsZoneTypes() []TDnsZoneType
	GetSupportedDnsTypes() map[TDnsZoneType][]TDnsType
	GetSupportedDnsPolicyTypes() map[TDnsZoneType][]TDnsPolicyType
	GetSupportedDnsPolicyValues() map[TDnsPolicyType][]TDnsPolicyValue
	GetTTLRange(zoneType TDnsZoneType, productType TDnsProductType) TTlRange

	IsSupportSAMLAuth() bool

	GetAccountIdEqualizer() func(origin, now string) bool
}

func GetProviderFactory

func GetProviderFactory(provider string) (ICloudProviderFactory, error)

type ICloudQuota

type ICloudQuota interface {
	GetGlobalId() string
	GetDesc() string
	GetQuotaType() string
	GetMaxQuotaCount() int
	GetCurrentQuotaUsedCount() int
}

type ICloudRegion

type ICloudRegion interface {
	ICloudResource
	ICloudI18nResource

	// GetLatitude() float32
	// GetLongitude() float32
	GetGeographicInfo() SGeographicInfo

	GetIZones() ([]ICloudZone, error)
	GetIVpcs() ([]ICloudVpc, error)
	GetIEips() ([]ICloudEIP, error)
	GetIVpcById(id string) (ICloudVpc, error)
	GetIZoneById(id string) (ICloudZone, error)
	GetIEipById(id string) (ICloudEIP, error)
	// Esxi没有zone,需要通过region确认vm是否被删除
	GetIVMById(id string) (ICloudVM, error)
	GetIDiskById(id string) (ICloudDisk, error)

	GetISecurityGroupById(secgroupId string) (ICloudSecurityGroup, error)
	GetISecurityGroupByName(opts *SecurityGroupFilterOptions) (ICloudSecurityGroup, error)
	CreateISecurityGroup(conf *SecurityGroupCreateInput) (ICloudSecurityGroup, error)

	CreateIVpc(opts *VpcCreateOptions) (ICloudVpc, error)
	CreateInternetGateway() (ICloudInternetGateway, error)
	CreateEIP(eip *SEip) (ICloudEIP, error)

	GetISnapshots() ([]ICloudSnapshot, error)
	GetISnapshotById(snapshotId string) (ICloudSnapshot, error)

	CreateSnapshotPolicy(*SnapshotPolicyInput) (string, error)
	UpdateSnapshotPolicy(*SnapshotPolicyInput, string) error
	DeleteSnapshotPolicy(string) error
	ApplySnapshotPolicyToDisks(snapshotPolicyId string, diskId string) error
	CancelSnapshotPolicyToDisks(snapshotPolicyId string, diskId string) error
	GetISnapshotPolicies() ([]ICloudSnapshotPolicy, error)
	GetISnapshotPolicyById(snapshotPolicyId string) (ICloudSnapshotPolicy, error)

	GetIHosts() ([]ICloudHost, error)
	GetIHostById(id string) (ICloudHost, error)

	GetIStorages() ([]ICloudStorage, error)
	GetIStorageById(id string) (ICloudStorage, error)

	GetIStoragecaches() ([]ICloudStoragecache, error)
	GetIStoragecacheById(id string) (ICloudStoragecache, error)

	GetILoadBalancers() ([]ICloudLoadbalancer, error)
	GetILoadBalancerAcls() ([]ICloudLoadbalancerAcl, error)
	GetILoadBalancerCertificates() ([]ICloudLoadbalancerCertificate, error)
	GetILoadBalancerBackendGroups() ([]ICloudLoadbalancerBackendGroup, error) // for aws only

	GetILoadBalancerById(loadbalancerId string) (ICloudLoadbalancer, error)
	GetILoadBalancerAclById(aclId string) (ICloudLoadbalancerAcl, error)
	GetILoadBalancerCertificateById(certId string) (ICloudLoadbalancerCertificate, error)

	CreateILoadBalancer(loadbalancer *SLoadbalancer) (ICloudLoadbalancer, error)
	CreateILoadBalancerAcl(acl *SLoadbalancerAccessControlList) (ICloudLoadbalancerAcl, error)
	CreateILoadBalancerCertificate(cert *SLoadbalancerCertificate) (ICloudLoadbalancerCertificate, error)

	GetISkus() ([]ICloudSku, error)
	CreateISku(opts *SServerSkuCreateOption) (ICloudSku, error)

	GetICloudNatSkus() ([]ICloudNatSku, error)

	GetINetworkInterfaces() ([]ICloudNetworkInterface, error)

	GetIBuckets() ([]ICloudBucket, error)
	CreateIBucket(name string, storageClassStr string, acl string) error
	DeleteIBucket(name string) error
	IBucketExist(name string) (bool, error)
	GetIBucketById(name string) (ICloudBucket, error)
	GetIBucketByName(name string) (ICloudBucket, error)

	GetIDBInstances() ([]ICloudDBInstance, error)
	GetIDBInstanceById(instanceId string) (ICloudDBInstance, error)
	GetIDBInstanceBackups() ([]ICloudDBInstanceBackup, error)
	GetIDBInstanceBackupById(backupId string) (ICloudDBInstanceBackup, error)
	GetIDBInstanceSkus() ([]ICloudDBInstanceSku, error)

	CreateIDBInstance(desc *SManagedDBInstanceCreateConfig) (ICloudDBInstance, error)

	GetIElasticcaches() ([]ICloudElasticcache, error)
	GetIElasticcacheSkus() ([]ICloudElasticcacheSku, error)
	GetIElasticcacheById(id string) (ICloudElasticcache, error)
	CreateIElasticcaches(ec *SCloudElasticCacheInput) (ICloudElasticcache, error)

	GetCloudEnv() string
	GetProvider() string

	GetICloudEvents(start time.Time, end time.Time, withReadEvent bool) ([]ICloudEvent, error) //获取公有云操作日志接口

	GetCapabilities() []string

	GetICloudQuotas() ([]ICloudQuota, error)

	GetICloudFileSystems() ([]ICloudFileSystem, error)
	GetICloudFileSystemById(id string) (ICloudFileSystem, error)

	CreateICloudFileSystem(opts *FileSystemCraeteOptions) (ICloudFileSystem, error)

	GetICloudAccessGroups() ([]ICloudAccessGroup, error)
	CreateICloudAccessGroup(opts *SAccessGroup) (ICloudAccessGroup, error)
	GetICloudAccessGroupById(id string) (ICloudAccessGroup, error)

	GetICloudWafIPSets() ([]ICloudWafIPSet, error)
	GetICloudWafRegexSets() ([]ICloudWafRegexSet, error)
	GetICloudWafInstances() ([]ICloudWafInstance, error)
	GetICloudWafInstanceById(id string) (ICloudWafInstance, error)
	CreateICloudWafInstance(opts *WafCreateOptions) (ICloudWafInstance, error)
	GetICloudWafRuleGroups() ([]ICloudWafRuleGroup, error)

	GetICloudMongoDBs() ([]ICloudMongoDB, error)
	GetICloudMongoDBById(id string) (ICloudMongoDB, error)

	GetIElasticSearchs() ([]ICloudElasticSearch, error)
	GetIElasticSearchById(id string) (ICloudElasticSearch, error)

	GetICloudKafkas() ([]ICloudKafka, error)
	GetICloudKafkaById(id string) (ICloudKafka, error)

	GetICloudApps() ([]ICloudApp, error)
	GetICloudAppById(id string) (ICloudApp, error)

	GetICloudKubeClusters() ([]ICloudKubeCluster, error)
	GetICloudKubeClusterById(id string) (ICloudKubeCluster, error)

	GetICloudTablestores() ([]ICloudTablestore, error)

	GetIModelartsPools() ([]ICloudModelartsPool, error)
	GetIModelartsPoolById(id string) (ICloudModelartsPool, error)
	CreateIModelartsPool(pool *ModelartsPoolCreateOption) (ICloudModelartsPool, error)
	GetIModelartsPoolSku() ([]ICloudModelartsPoolSku, error)

	GetIMiscResources() ([]ICloudMiscResource, error)
}

type ICloudResource

type ICloudResource interface {
	GetId() string
	GetName() string
	GetGlobalId() string
	GetCreatedAt() time.Time

	GetStatus() string

	Refresh() error

	IsEmulated() bool

	GetSysTags() map[string]string
	GetTags() (map[string]string, error)
	SetTags(tags map[string]string, replace bool) error
}

type ICloudRoute

type ICloudRoute interface {
	ICloudResource
	GetType() string
	GetCidr() string
	GetNextHopType() string
	GetNextHop() string
}

type ICloudRouteTable

type ICloudRouteTable interface {
	ICloudResource

	GetAssociations() []RouteTableAssociation
	GetDescription() string
	GetRegionId() string
	GetVpcId() string
	GetType() RouteTableType
	GetIRoutes() ([]ICloudRoute, error)

	CreateRoute(route RouteSet) error
	UpdateRoute(route RouteSet) error
	RemoveRoute(route RouteSet) error
}

type ICloudSAMLProvider

type ICloudSAMLProvider interface {
	ICloudResource

	GetMetadataDocument() (*samlutils.EntityDescriptor, error)
	UpdateMetadata(samlutils.EntityDescriptor) error

	GetAuthUrl() string
	Delete() error
}

type ICloudSecurityGroup

type ICloudSecurityGroup interface {
	IVirtualResource

	GetDescription() string
	GetRules() ([]SecurityRule, error)
	GetVpcId() string

	SyncRules(common, inAdds, outAdds, inDels, outDels []SecurityRule) error
	GetReferences() ([]SecurityGroupReference, error)
	Delete() error
}

type ICloudSku

type ICloudSku interface {
	ICloudResource

	GetInstanceTypeFamily() string
	GetInstanceTypeCategory() string

	GetPrepaidStatus() string
	GetPostpaidStatus() string

	GetCpuArch() string
	GetCpuCoreCount() int
	GetMemorySizeMB() int

	GetOsName() string

	GetSysDiskResizable() bool
	GetSysDiskType() string
	GetSysDiskMinSizeGB() int
	GetSysDiskMaxSizeGB() int

	GetAttachedDiskType() string
	GetAttachedDiskSizeGB() int
	GetAttachedDiskCount() int

	GetDataDiskTypes() string
	GetDataDiskMaxCount() int

	GetNicType() string
	GetNicMaxCount() int

	GetGpuAttachable() bool
	GetGpuSpec() string
	GetGpuCount() int
	GetGpuMaxCount() int

	Delete() error
}

type ICloudSnapshot

type ICloudSnapshot interface {
	IVirtualResource

	GetSizeMb() int32
	GetDiskId() string
	GetDiskType() string
	Delete() error
}

type ICloudSnapshotPolicy

type ICloudSnapshotPolicy interface {
	IVirtualResource

	IsActivated() bool
	GetRetentionDays() int
	GetRepeatWeekdays() ([]int, error)
	GetTimePoints() ([]int, error)
}

type ICloudStorage

type ICloudStorage interface {
	ICloudResource

	GetIStoragecache() ICloudStoragecache

	GetIZone() ICloudZone
	GetIDisks() ([]ICloudDisk, error)

	GetStorageType() string
	GetMediumType() string
	GetCapacityMB() int64 // MB
	GetCapacityUsedMB() int64
	GetStorageConf() jsonutils.JSONObject
	GetEnabled() bool

	CreateIDisk(conf *DiskCreateConfig) (ICloudDisk, error)

	GetIDiskById(idStr string) (ICloudDisk, error)

	GetMountPoint() string

	IsSysDiskStore() bool

	DisableSync() bool
}

type ICloudStoragecache

type ICloudStoragecache interface {
	ICloudResource

	// 私有云需要实现
	GetICloudImages() ([]ICloudImage, error)
	// 公有云需要实现
	GetICustomizedCloudImages() ([]ICloudImage, error)
	GetIImageById(extId string) (ICloudImage, error)

	GetPath() string

	CreateIImage(snapshotId, imageName, osType, imageDesc string) (ICloudImage, error)

	DownloadImage(userCred mcclient.TokenCredential, imageId string, extId string, path string) (jsonutils.JSONObject, error)

	UploadImage(ctx context.Context, userCred mcclient.TokenCredential, image *SImageCreateOption, callback func(float32)) (string, error)
}

type ICloudTablestore

type ICloudTablestore interface {
	IVirtualResource
}

type ICloudVM

type ICloudVM interface {
	IBillingResource
	IVirtualResource

	IOSInfo

	ConvertPublicIpToEip() error

	GetHostname() string
	GetIHost() ICloudHost
	GetIHostId() string

	GetIDisks() ([]ICloudDisk, error)
	GetINics() ([]ICloudNic, error)

	GetIEIP() (ICloudEIP, error)

	GetInternetMaxBandwidthOut() int
	GetThroughput() int

	GetSerialOutput(port int) (string, error) // 目前仅谷歌云windows机器会使用到此接口

	GetVcpuCount() int
	GetVmemSizeMB() int //MB
	GetBootOrder() string
	GetVga() string
	GetVdi() string

	GetMachine() string
	GetInstanceType() string

	GetSecurityGroupIds() ([]string, error)
	AssignSecurityGroup(secgroupId string) error
	SetSecurityGroups(secgroupIds []string) error

	GetHypervisor() string

	StartVM(ctx context.Context) error
	StopVM(ctx context.Context, opts *ServerStopOptions) error
	DeleteVM(ctx context.Context) error

	UpdateVM(ctx context.Context, name string) error

	UpdateUserData(userData string) error

	RebuildRoot(ctx context.Context, config *SManagedVMRebuildRootConfig) (string, error)

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

	ChangeConfig(ctx context.Context, config *SManagedVMChangeConfig) error

	GetVNCInfo(input *ServerVncInput) (*ServerVncOutput, error)
	AttachDisk(ctx context.Context, diskId string) error
	DetachDisk(ctx context.Context, diskId string) error

	CreateDisk(ctx context.Context, opts *GuestDiskCreateOptions) (string, error)

	MigrateVM(hostid string) error
	LiveMigrateVM(hostid string) error

	GetError() error

	CreateInstanceSnapshot(ctx context.Context, name string, desc string) (ICloudInstanceSnapshot, error)
	GetInstanceSnapshot(idStr string) (ICloudInstanceSnapshot, error)
	GetInstanceSnapshots() ([]ICloudInstanceSnapshot, error)
	ResetToInstanceSnapshot(ctx context.Context, idStr string) error

	SaveImage(opts *SaveImageOptions) (ICloudImage, error)

	AllocatePublicIpAddress() (string, error)
}

type ICloudVpc

type ICloudVpc interface {
	ICloudResource

	GetGlobalVpcId() string
	IsSupportSetExternalAccess() bool // 是否支持Attach互联网网关.
	GetExternalAccessMode() string
	AttachInternetGateway(igwId string) error

	GetRegion() ICloudRegion
	GetIsDefault() bool
	GetCidrBlock() string
	GetIWires() ([]ICloudWire, error)
	CreateIWire(opts *SWireCreateOptions) (ICloudWire, error)
	GetISecurityGroups() ([]ICloudSecurityGroup, error)
	GetIRouteTables() ([]ICloudRouteTable, error)
	GetIRouteTableById(routeTableId string) (ICloudRouteTable, error)

	Delete() error

	GetIWireById(wireId string) (ICloudWire, error)
	GetINatGateways() ([]ICloudNatGateway, error)
	CreateINatGateway(opts *NatGatewayCreateOptions) (ICloudNatGateway, error)

	GetICloudVpcPeeringConnections() ([]ICloudVpcPeeringConnection, error)
	GetICloudAccepterVpcPeeringConnections() ([]ICloudVpcPeeringConnection, error)
	GetICloudVpcPeeringConnectionById(id string) (ICloudVpcPeeringConnection, error)
	CreateICloudVpcPeeringConnection(opts *VpcPeeringConnectionCreateOptions) (ICloudVpcPeeringConnection, error)
	AcceptICloudVpcPeeringConnection(id string) error

	GetAuthorityOwnerId() string

	ProposeJoinICloudInterVpcNetwork(opts *SVpcJointInterVpcNetworkOption) error

	GetICloudIPv6Gateways() ([]ICloudIPv6Gateway, error)
}

type ICloudVpcPeeringConnection

type ICloudVpcPeeringConnection interface {
	ICloudResource

	GetPeerVpcId() string
	GetPeerAccountId() string
	GetEnabled() bool
	Delete() error
}

type ICloudWafIPSet

type ICloudWafIPSet interface {
	GetName() string
	GetDesc() string
	GetType() TWafType
	GetGlobalId() string
	GetAddresses() WafAddresses

	Delete() error
}

type ICloudWafInstance

type ICloudWafInstance interface {
	ICloudEnabledResource

	GetWafType() TWafType
	GetDefaultAction() *DefaultAction
	GetRules() ([]ICloudWafRule, error)
	AddRule(opts *SWafRule) (ICloudWafRule, error)

	// 绑定的资源列表
	GetCloudResources() ([]SCloudResource, error)

	Delete() error
}

type ICloudWafRegexSet

type ICloudWafRegexSet interface {
	GetName() string
	GetDesc() string
	GetType() TWafType
	GetGlobalId() string
	GetRegexPatterns() WafRegexPatterns

	Delete() error
}

type ICloudWafRule

type ICloudWafRule interface {
	GetName() string
	GetDesc() string
	GetGlobalId() string
	GetPriority() int
	GetAction() *DefaultAction
	GetStatementCondition() TWafStatementCondition
	GetStatements() ([]SWafStatement, error)

	Update(opts *SWafRule) error
	Delete() error
}

type ICloudWafRuleGroup

type ICloudWafRuleGroup interface {
	GetName() string
	GetDesc() string
	GetGlobalId() string
	GetWafType() TWafType
	GetRules() ([]ICloudWafRule, error)
}

type ICloudWire

type ICloudWire interface {
	ICloudResource
	GetIVpc() ICloudVpc
	GetIZone() ICloudZone
	GetINetworks() ([]ICloudNetwork, error)
	GetBandwidth() int

	GetINetworkById(netid string) (ICloudNetwork, error)

	CreateINetwork(opts *SNetworkCreateOptions) (ICloudNetwork, error)
}

type ICloudZone

type ICloudZone interface {
	ICloudResource
	ICloudI18nResource

	GetIRegion() ICloudRegion

	GetIHosts() ([]ICloudHost, error)
	GetIHostById(id string) (ICloudHost, error)

	GetIStorages() ([]ICloudStorage, error)
	GetIStorageById(id string) (ICloudStorage, error)
}

type ICloudgroup

type ICloudgroup interface {
	GetGlobalId() string
	GetName() string
	GetDescription() string
	GetISystemCloudpolicies() ([]ICloudpolicy, error)
	GetICustomCloudpolicies() ([]ICloudpolicy, error)
	GetICloudusers() ([]IClouduser, error)

	AddUser(name string) error
	RemoveUser(name string) error

	AttachSystemPolicy(policyName string) error
	DetachSystemPolicy(policyName string) error

	AttachCustomPolicy(policyName string) error
	DetachCustomPolicy(policyName string) error

	Delete() error
}

公有云用户组

type ICloudloadbalancerHealthCheck

type ICloudloadbalancerHealthCheck interface {
	GetHealthCheck() string
	GetHealthCheckType() string
	GetHealthCheckTimeout() int
	GetHealthCheckInterval() int
	GetHealthCheckRise() int
	GetHealthCheckFail() int

	GetHealthCheckReq() string
	GetHealthCheckExp() string

	// HTTP && HTTPS
	GetHealthCheckDomain() string
	GetHealthCheckURI() string
	GetHealthCheckCode() string
}

type ICloudpolicy

type ICloudpolicy interface {
	GetGlobalId() string
	GetName() string
	GetDescription() string

	GetDocument() (*jsonutils.JSONDict, error)
	UpdateDocument(*jsonutils.JSONDict) error

	Delete() error
}

公有云子账号权限

type ICloudrole

type ICloudrole interface {
	GetGlobalId() string
	GetName() string

	GetDocument() *jsonutils.JSONDict
	GetSAMLProvider() string

	GetICloudpolicies() ([]ICloudpolicy, error)
	AttachPolicy(id string) error
	DetachPolicy(id string) error

	Delete() error
}

type IClouduser

type IClouduser interface {
	GetGlobalId() string
	GetName() string

	GetEmailAddr() string
	GetInviteUrl() string

	GetICloudgroups() ([]ICloudgroup, error)

	GetISystemCloudpolicies() ([]ICloudpolicy, error)
	GetICustomCloudpolicies() ([]ICloudpolicy, error)

	AttachSystemPolicy(policyName string) error
	DetachSystemPolicy(policyName string) error

	AttachCustomPolicy(policyName string) error
	DetachCustomPolicy(policyName string) error

	Delete() error

	ResetPassword(password string) error
	IsConsoleLogin() bool

	CreateAccessKey(name string) (*SAccessKey, error)
	DeleteAccessKey(accessKey string) error
	GetAccessKeys() ([]SAccessKey, error)
}

公有云子账号

type IOSInfo

type IOSInfo interface {
	GetFullOsName() string
	GetOsType() TOsType
	GetOsDist() string
	GetOsVersion() string
	GetOsArch() string
	GetOsLang() string
	GetBios() TBiosType
}

type IVirtualResource

type IVirtualResource interface {
	ICloudResource

	GetProjectId() string
}

type MetricListOptions

type MetricListOptions struct {
	ResourceType TResourceType
	MetricType   TMetricType

	ResourceId string
	// batch metric pull for tencentcloud
	ResourceIds []string
	RegionExtId string
	StartTime   time.Time
	EndTime     time.Time

	OsType   string
	Interval int
	// rds
	Engine string
}

type MetricValue

type MetricValue struct {
	Timestamp time.Time
	Value     float64
	Tags      map[string]string
}

type MetricValues

type MetricValues struct {
	Id         string
	Unit       string
	MetricType TMetricType
	Values     []MetricValue
}

type ModelartsPoolChangeConfigOptions

type ModelartsPoolChangeConfigOptions struct {
	NodeCount int
}

type ModelartsPoolCreateOption

type ModelartsPoolCreateOption struct {
	Name         string
	PoolDesc     string
	BillingMode  uint
	PeriodType   uint
	PeriodNum    uint
	AutoRenew    uint
	InstanceType string
	NodeCount    int
	NetworkId    string

	WorkType string
}

type NatGatewayCreateOptions

type NatGatewayCreateOptions struct {
	Name      string
	VpcId     string
	NetworkId string
	Desc      string
	NatSpec   string

	BillingCycle *billing.SBillingCycle
}

type ProviderConfig

type ProviderConfig struct {
	// Id, Name are properties of Cloudprovider object
	Id   string
	Name string

	// Vendor are names like Aliyun, OpenStack, etc.
	Vendor  string
	URL     string
	Account string
	Secret  string

	ReadOnly bool

	AccountId string

	Options *jsonutils.JSONDict

	DefaultRegion string
	ProxyFunc     httputils.TransportProxyFunc
	Debug         bool

	UpdatePermission func(service, permission string)
}

func (*ProviderConfig) AdaptiveTimeoutHttpClient

func (cp *ProviderConfig) AdaptiveTimeoutHttpClient() *http.Client

type RouteSet

type RouteSet struct {
	RouteId     string
	Destination string // route destination
	NextHopType string // route next hop type
	NextHop     string // route next hop (ip or id)
}

type RouteTableAssociation

type RouteTableAssociation struct {
	AssociationId        string
	AssociationType      RouteTableAssociationType
	AssociatedResourceId string
}

func (RouteTableAssociation) GetGlobalId

func (self RouteTableAssociation) GetGlobalId() string

type RouteTableAssociationType

type RouteTableAssociationType string

type RouteTableType

type RouteTableType string

type SAMLProviderCreateOptions

type SAMLProviderCreateOptions struct {
	Name     string
	Metadata samlutils.EntityDescriptor
}

type SAWSExtraOptions

type SAWSExtraOptions struct {
	AWSAssumeRoleName string `json:"aws_assume_role_name"`
}

type SAccessGroup

type SAccessGroup struct {
	Name           string
	NetworkType    string
	FileSystemType string
	Desc           string
}

type SAccessKey

type SAccessKey struct {
	Name      string
	AccessKey string
	Secret    string
	Status    string
	CreatedAt time.Time
}

type SBaseCloudObject

type SBaseCloudObject struct {
	Key          string
	SizeBytes    int64
	StorageClass string
	ETag         string
	LastModified time.Time
	Meta         http.Header
}

func (*SBaseCloudObject) GetETag

func (o *SBaseCloudObject) GetETag() string

func (*SBaseCloudObject) GetKey

func (o *SBaseCloudObject) GetKey() string

func (*SBaseCloudObject) GetLastModified

func (o *SBaseCloudObject) GetLastModified() time.Time

func (*SBaseCloudObject) GetMeta

func (o *SBaseCloudObject) GetMeta() http.Header

func (*SBaseCloudObject) GetSizeBytes

func (o *SBaseCloudObject) GetSizeBytes() int64

func (*SBaseCloudObject) GetStorageClass

func (o *SBaseCloudObject) GetStorageClass() string

type SBaseProvider

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

func NewBaseProvider

func NewBaseProvider(factory ICloudProviderFactory) SBaseProvider

func (*SBaseProvider) CreateICloudCDNDomain

func (self *SBaseProvider) CreateICloudCDNDomain(opts *CdnCreateOptions) (ICloudCDNDomain, error)

func (*SBaseProvider) CreateICloudDnsZone

func (self *SBaseProvider) CreateICloudDnsZone(opts *SDnsZoneCreateOptions) (ICloudDnsZone, error)

func (*SBaseProvider) CreateICloudGlobalVpc

func (self *SBaseProvider) CreateICloudGlobalVpc(opts *GlobalVpcCreateOptions) (ICloudGlobalVpc, error)

func (*SBaseProvider) CreateICloudInterVpcNetwork

func (self *SBaseProvider) CreateICloudInterVpcNetwork(opts *SInterVpcNetworkCreateOptions) (ICloudInterVpcNetwork, error)

func (*SBaseProvider) CreateICloudSAMLProvider

func (self *SBaseProvider) CreateICloudSAMLProvider(opts *SAMLProviderCreateOptions) (ICloudSAMLProvider, error)

func (*SBaseProvider) CreateICloudgroup

func (self *SBaseProvider) CreateICloudgroup(name, desc string) (ICloudgroup, error)

func (*SBaseProvider) CreateICloudpolicy

func (self *SBaseProvider) CreateICloudpolicy(opts *SCloudpolicyCreateOptions) (ICloudpolicy, error)

func (*SBaseProvider) CreateICloudrole

func (self *SBaseProvider) CreateICloudrole(opts *SRoleCreateOptions) (ICloudrole, error)

func (*SBaseProvider) CreateIClouduser

func (self *SBaseProvider) CreateIClouduser(conf *SClouduserCreateConfig) (IClouduser, error)

func (*SBaseProvider) CreateIModelartsPool

func (self *SBaseProvider) CreateIModelartsPool(pool *ModelartsPoolCreateOption) (ICloudModelartsPool, error)

func (*SBaseProvider) CreateIProject

func (self *SBaseProvider) CreateIProject(name string) (ICloudProject, error)

func (*SBaseProvider) CreateSubscription

func (self *SBaseProvider) CreateSubscription(SubscriptionCreateInput) error

func (*SBaseProvider) GetCloudRegionExternalIdPrefix

func (self *SBaseProvider) GetCloudRegionExternalIdPrefix() string

func (*SBaseProvider) GetEnrollmentAccounts

func (self *SBaseProvider) GetEnrollmentAccounts() ([]SEnrollmentAccount, error)

func (*SBaseProvider) GetFactory

func (provider *SBaseProvider) GetFactory() ICloudProviderFactory

func (*SBaseProvider) GetICloudCDNDomainByName

func (self *SBaseProvider) GetICloudCDNDomainByName(name string) (ICloudCDNDomain, error)

func (*SBaseProvider) GetICloudCDNDomains

func (self *SBaseProvider) GetICloudCDNDomains() ([]ICloudCDNDomain, error)

func (*SBaseProvider) GetICloudDnsZoneById

func (self *SBaseProvider) GetICloudDnsZoneById(id string) (ICloudDnsZone, error)

func (*SBaseProvider) GetICloudDnsZones

func (self *SBaseProvider) GetICloudDnsZones() ([]ICloudDnsZone, error)

func (*SBaseProvider) GetICloudGlobalVpcById

func (self *SBaseProvider) GetICloudGlobalVpcById(id string) (ICloudGlobalVpc, error)

func (*SBaseProvider) GetICloudGlobalVpcs

func (self *SBaseProvider) GetICloudGlobalVpcs() ([]ICloudGlobalVpc, error)

func (*SBaseProvider) GetICloudInterVpcNetworkById

func (self *SBaseProvider) GetICloudInterVpcNetworkById(id string) (ICloudInterVpcNetwork, error)

func (*SBaseProvider) GetICloudInterVpcNetworks

func (self *SBaseProvider) GetICloudInterVpcNetworks() ([]ICloudInterVpcNetwork, error)

func (*SBaseProvider) GetICloudSAMLProviders

func (self *SBaseProvider) GetICloudSAMLProviders() ([]ICloudSAMLProvider, error)

func (*SBaseProvider) GetICloudgroupByName

func (self *SBaseProvider) GetICloudgroupByName(name string) (ICloudgroup, error)

func (*SBaseProvider) GetICloudgroups

func (self *SBaseProvider) GetICloudgroups() ([]ICloudgroup, error)

func (*SBaseProvider) GetICloudroleById

func (self *SBaseProvider) GetICloudroleById(id string) (ICloudrole, error)

func (*SBaseProvider) GetICloudroleByName

func (self *SBaseProvider) GetICloudroleByName(name string) (ICloudrole, error)

func (*SBaseProvider) GetICloudroles

func (self *SBaseProvider) GetICloudroles() ([]ICloudrole, error)

func (*SBaseProvider) GetIClouduserByName

func (self *SBaseProvider) GetIClouduserByName(name string) (IClouduser, error)

func (*SBaseProvider) GetICloudusers

func (self *SBaseProvider) GetICloudusers() ([]IClouduser, error)

func (*SBaseProvider) GetICustomCloudpolicies

func (self *SBaseProvider) GetICustomCloudpolicies() ([]ICloudpolicy, error)

func (*SBaseProvider) GetIModelartsPoolById

func (self *SBaseProvider) GetIModelartsPoolById(id string) (ICloudModelartsPool, error)

func (*SBaseProvider) GetIModelartsPoolSku

func (self *SBaseProvider) GetIModelartsPoolSku() ([]ICloudModelartsPoolSku, error)

func (*SBaseProvider) GetIModelartsPools

func (self *SBaseProvider) GetIModelartsPools() ([]ICloudModelartsPool, error)

func (*SBaseProvider) GetISystemCloudpolicies

func (self *SBaseProvider) GetISystemCloudpolicies() ([]ICloudpolicy, error)

func (*SBaseProvider) GetIamLoginUrl

func (self *SBaseProvider) GetIamLoginUrl() string

func (*SBaseProvider) GetMetrics

func (self *SBaseProvider) GetMetrics(opts *MetricListOptions) ([]MetricValues, error)

func (*SBaseProvider) GetOnPremiseIRegion

func (self *SBaseProvider) GetOnPremiseIRegion() (ICloudRegion, error)

func (*SBaseProvider) GetSamlEntityId

func (self *SBaseProvider) GetSamlEntityId() string

func (*SBaseProvider) GetSamlSpInitiatedLoginUrl

func (self *SBaseProvider) GetSamlSpInitiatedLoginUrl(idpName string) string

func (*SBaseProvider) IsClouduserSupportPassword

func (self *SBaseProvider) IsClouduserSupportPassword() bool

type SBucketAccessUrl

type SBucketAccessUrl struct {
	Url         string
	Description string
	Primary     bool
}

type SBucketCORSRule

type SBucketCORSRule struct {
	AllowedMethods []string
	// 允许的源站,可以设为*
	AllowedOrigins []string
	AllowedHeaders []string
	MaxAgeSeconds  int
	ExposeHeaders  []string
	// 规则区别标识
	Id string
}

func DeleteBucketCORS

func DeleteBucketCORS(ibucket ICloudBucket, id []string) ([]SBucketCORSRule, error)

type SBucketMultipartUploads

type SBucketMultipartUploads struct {
	// object name
	ObjectName string
	UploadID   string
	// 发起人
	Initiator string
	// 发起时间
	Initiated time.Time
}

type SBucketPolicyStatement

type SBucketPolicyStatement struct {
	// 授权的目标主体
	Principal map[string][]string `json:"Principal,omitempty"`
	// 授权的行为
	Action []string `json:"Action,omitempty"`
	// Allow|Deny
	Effect string `json:"Effect,omitempty"`
	// 被授权的资源
	Resource []string `json:"Resource,omitempty"`
	// 触发授权的条件
	Condition map[string]map[string]interface{} `json:"Condition,omitempty"`

	// 解析字段,主账号id:子账号id
	PrincipalId []string
	// map[主账号id:子账号id]子账号名称
	PrincipalNames map[string]string
	// Read|ReadWrite|FullControl
	CannedAction string
	// 资源路径
	ResourcePath []string
	// 根据index 生成
	Id string
}

type SBucketPolicyStatementInput

type SBucketPolicyStatementInput struct {
	// 主账号id:子账号id
	PrincipalId []string
	// Read|ReadWrite|FullControl
	CannedAction string
	// Allow|Deny
	Effect string
	// 被授权的资源地址,/*
	ResourcePath []string
	// ip 条件
	IpEquals    []string
	IpNotEquals []string
}

type SBucketRefererConf

type SBucketRefererConf struct {
	// 域名列表
	DomainList []string
	// 域名列表
	// enmu: Black-List, White-List
	RefererType string
	// 是否允许空referer 访问
	AllowEmptyRefer bool

	Enabled bool
}

type SBucketStats

type SBucketStats struct {
	SizeBytes   int64
	ObjectCount int
}

func GetIBucketStats

func GetIBucketStats(bucket ICloudBucket) (SBucketStats, error)

func (SBucketStats) Equals

func (s SBucketStats) Equals(s2 SBucketStats) bool

type SBucketWebsiteConf

type SBucketWebsiteConf struct {
	// 主页
	Index string
	// 错误时返回的文档
	ErrorDocument string
	// http或https
	Protocol string

	Rules []SBucketWebsiteRoutingRule
	// 网站访问url,一般由bucketid,region等组成
	Url string
}

type SBucketWebsiteRoutingRule

type SBucketWebsiteRoutingRule struct {
	ConditionErrorCode string
	ConditionPrefix    string

	RedirectProtocol         string
	RedirectReplaceKey       string
	RedirectReplaceKeyPrefix string
}

type SCdnDomain

type SCdnDomain struct {
	// cdn加速域名
	Domain string
	// 状态 rejected(域名未审核)|processing(部署中)|online|offline
	Status string
	// 区域 mainland|overseas|global
	Area string
	// cdn Cname
	Cname string
	// 源站
	Origin string
	// 源站类型 domain|ip|bucket
	OriginType string
}

+onecloud:model-api-gen

type SCdnOrigin

type SCdnOrigin struct {
	// 源站类型
	// domain: 域名类型, cos:对象存储源站, ip:IP 列表作为源站
	// enmu: domain, cos, ip
	// required: true
	Type string
	// 源站地址
	Origin string
	// 回主源站时 Host 头部
	ServerName string
	// 回源协议
	// enmu: http, follow, https
	Protocol string
	Path     string
	Port     int
	Enabled  string
	Priority int
}

+onecloud:model-api-gen

type SCdnOrigins

type SCdnOrigins []SCdnOrigin

+onecloud:model-api-gen

func (SCdnOrigins) IsZero

func (self SCdnOrigins) IsZero() bool

func (SCdnOrigins) String

func (self SCdnOrigins) String() string

type SCloudElasticCacheAccountInput

type SCloudElasticCacheAccountInput struct {
	AccountName      string // 账号名称
	AccountPassword  string // 账号密码
	AccountPrivilege string // 账号权限
	Description      string // 账号描述
}

type SCloudElasticCacheAccountResetPasswordInput

type SCloudElasticCacheAccountResetPasswordInput struct {
	NoPasswordAccess *bool   // 免密码访问
	NewPassword      string  // 新密码
	OldPassword      *string // 旧密码。required by huawei
}

type SCloudElasticCacheAccountUpdateInput

type SCloudElasticCacheAccountUpdateInput struct {
	NoPasswordAccess *bool   // 免密码访问
	Password         *string // 新密码
	OldPassword      *string // 旧密码。required by huawei
	AccountPrivilege *string
	Description      *string
}

type SCloudElasticCacheBackupPolicyUpdateInput

type SCloudElasticCacheBackupPolicyUpdateInput struct {
	BackupType            string // auto:自动备份 / manual:手动备份
	BackupReservedDays    int    // 1-7
	PreferredBackupPeriod string // Monday(周一) / Tuesday(周二) / Wednesday(周三) / Thursday(周四) / Friday(周五) / Saturday(周六) / Sunday(周日)
	PreferredBackupTime   string // 备份时间,格式:HH:mmZ-HH:mmZ
}

type SCloudElasticCacheFlushInstanceInput

type SCloudElasticCacheFlushInstanceInput struct {
	Password string // root账号密码. requied by qcloud
}

type SCloudElasticCacheInput

type SCloudElasticCacheInput struct {
	InstanceType     string                 // 实例规格 redis.master.small.default
	CapacityGB       int64                  // 缓存容量 华为云此项参数必选
	InstanceName     string                 // 实例名称
	UserName         string                 // redis 用户名,可选
	Password         string                 // redis 用户密码,可选
	ZoneIds          []string               // 可用区, 可选
	ChargeType       string                 // 计费类型,可选
	NodeType         string                 // 节点类型,可选
	NetworkType      string                 // 网络类型 VPC|CLASSIC,可选
	VpcId            string                 // VPC ,可选
	NetworkId        string                 // 子网ID,可选
	Engine           string                 // Redis|Memcache
	EngineVersion    string                 // 版本类型
	PrivateIpAddress string                 // 指定新实例的内网IP地址。
	SecurityGroupIds []string               // 安全组ID
	EipId            string                 // 绑定弹性IP
	MaintainBegin    string                 // 维护时间窗开始时间,格式为HH:mm:ss
	MaintainEnd      string                 // 维护时间窗结束时间,格式为HH:mm:ss
	BillingCycle     *billing.SBillingCycle // 包年包月
	ProjectId        string
	Tags             map[string]string
}

https://support.huaweicloud.com/api-dcs/dcs-zh-api-180423019.html https://help.aliyun.com/document_detail/60873.html?spm=a2c4g.11174283.6.715.7412dce0qSYemb

type SCloudObject

type SCloudObject struct {
	Key          string
	SizeBytes    int64
	StorageClass string
	ETag         string
	LastModified time.Time
	Meta         http.Header
	Acl          string
}

func ICloudObject2Struct

func ICloudObject2Struct(obj ICloudObject) SCloudObject

type SCloudResource

type SCloudResource struct {
	// 资源Id
	Id string
	// 资源名称
	Name string
	// 资源类型
	Type string
	// 资源映射端口
	Port int
	// 是否可以解除关联
	CanDissociate bool
}

type SCloudResources

type SCloudResources struct {
	Data  []SCloudResource `json:",allowempty"`
	Total int
}

type SCloudaccount

type SCloudaccount struct {
	// 账号信息,各个平台字段不尽相同,以下是各个平台账号创建所需要的字段
	//
	//
	//
	// | 云平台     |字段                | 翻译              | 是否必传  | 默认值    | 可否更新      | 获取方式   |
	// | ------     |------              | ------            | --------- | --------  |--------       |--------    |
	// |Aliyun      |access_key_id       |秘钥ID             | 是        |            |    是        |            |
	// |Aliyun      |access_key_secret   |秘钥Key            | 是        |            |    是        |            |
	// |Qcloud      |app_id              |APP ID             | 是        |            |    否        |            |
	// |Qcloud      |secret_id           |秘钥ID             | 是        |            |    是        |            |
	// |Qcloud      |secret_key          |秘钥Key            | 是        |            |    是        |            |
	// |OpenStack   |project_name        |用户所在项目       | 是        |            |    是        |            |
	// |OpenStack   |username            |用户名             | 是        |            |    是        |            |
	// |OpenStack   |password            |用户密码           | 是        |            |    是        |            |
	// |OpenStack   |auth_url            |认证地址           | 是        |            |    否        |            |
	// |OpenStack   |domain_name         |用户所在的域       | 否        |Default     |    是        |            |
	// |VMware      |username            |用户名             | 是        |            |    是        |            |
	// |VMware      |password            |密码               | 是        |            |    是        |            |
	// |VMware      |host                |主机IP或域名       | 是        |            |    否        |            |
	// |VMware      |port                |主机端口           | 否        |443         |    否        |            |
	// |Azure       |directory_id        |目录ID             | 是        |            |    否        |            |
	// |Azure       |environment         |区域               | 是        |            |    否        |            |
	// |Azure       |client_id           |客户端ID           | 是        |            |    是        |            |
	// |Azure       |client_secret       |客户端密码         | 是        |            |    是        |            |
	// |Huawei      |access_key_id       |秘钥ID             | 是        |            |    是        |            |
	// |Huawei      |access_key_secret   |秘钥               | 是        |            |    是        |            |
	// |Huawei      |environment         |区域               | 是        |            |    否        |            |
	// |Aws         |access_key_id       |秘钥ID             | 是        |            |    是        |            |
	// |Aws         |access_key_secret   |秘钥               | 是        |            |    是        |            |
	// |Aws         |environment         |区域               | 是        |            |    否        |            |
	// |Ucloud      |access_key_id       |秘钥ID             | 是        |            |    是        |            |
	// |Ucloud      |access_key_secret   |秘钥               | 是        |            |    是        |            |
	// |Google      |project_id          |项目ID             | 是        |            |    否        |            |
	// |Google      |client_email        |客户端email        | 是        |            |    否        |            |
	// |Google      |private_key_id      |秘钥ID             | 是        |            |    是        |            |
	// |Google      |private_key         |秘钥Key            | 是        |            |    是        |            |
	Account string `json:"account"`

	// swagger:ignore
	Secret string

	// 认证地址
	AccessUrl string `json:"access_url"`
}

type SCloudaccountCredential

type SCloudaccountCredential struct {
	// 账号所在的项目 (openstack)
	ProjectName string `json:"project_name"`

	// 账号所在的域 (openstack)
	// default: Default
	DomainName string `json:"domain_name"`

	// 用户名 (openstack, zstack, esxi)
	Username string `json:"username"`

	// 密码 (openstack, zstack, esxi)
	Password string `json:"password"`

	// 认证地址 (openstack,zstack)
	AuthUrl string `json:"auto_url"`

	// 秘钥id (Aliyun, Aws, huawei, ucloud, ctyun, zstack, s3)
	AccessKeyId string `json:"access_key_id"`

	// 秘钥key (Aliyun, Aws, huawei, ucloud, ctyun, zstack, s3)
	AccessKeySecret string `json:"access_key_secret"`

	// 环境 (Azure, Aws, huawei, ctyun, aliyun)
	Environment string `json:"environment"`

	// 目录ID (Azure)
	DirectoryId string `json:"directory_id"`

	// 客户端ID (Azure)
	ClientId string `json:"client_id"`

	// 客户端秘钥 (Azure)
	ClientSecret string `json:"client_secret"`

	// 主机IP (esxi)
	Host string `json:"host"`

	// 主机端口 (esxi)
	Port int `json:"port"`

	// 端点 (s3) 或 Apsara(飞天)
	Endpoint string `json:"endpoint"`

	// app id (Qcloud)
	AppId string `json:"app_id"`

	//秘钥ID (Qcloud)
	SecretId string `json:"secret_id"`

	//秘钥key (Qcloud)
	SecretKey string `json:"secret_key"`

	// 飞天允许的最高组织id, 默认为1
	OrganizationId int `json:"organization_id"`

	// Google服务账号email (gcp)
	GCPClientEmail string `json:"gcp_client_email"`
	// Google服务账号project id (gcp)
	GCPProjectId string `json:"gcp_project_id"`
	// Google服务账号秘钥id (gcp)
	GCPPrivateKeyId string `json:"gcp_private_key_id"`
	// Google服务账号秘钥 (gcp)
	GCPPrivateKey string `json:"gcp_private_key"`

	// 默认区域Id, Apara及HCSO需要此参数
	// example: cn-north-2
	// required: true
	DefaultRegion string `default:"$DEFAULT_REGION" metavar:"$DEFAULT_REGION"`

	// Huawei Cloud Stack Online
	*SHCSOEndpoints

	// ctyun crm account extra info
	*SCtyunExtraOptions
}

type SCloudpolicyCreateOptions

type SCloudpolicyCreateOptions struct {
	Name     string
	Desc     string
	Document *jsonutils.JSONDict
}

type SCloudpolicyPermission

type SCloudpolicyPermission struct {
	Name     string
	Action   string
	Category string
}

type SClouduserCreateConfig

type SClouduserCreateConfig struct {
	Name              string
	Desc              string
	Password          string
	IsConsoleLogin    bool
	Email             string
	MobilePhone       string
	ExternalPolicyIds []string
	UserType          string
}

type SCtyunExtraOptions

type SCtyunExtraOptions struct {
	// customInfo type=1
	CrmBizId string `help:"ctyun crm user biz id. eg. ACMB1000000000123456 " json:"crm_biz_id" default:"$CTYUN_CRM_BIZ_ID"`
}

type SDBInstanceAccountCreateConfig

type SDBInstanceAccountCreateConfig struct {
	Name        string
	Host        string
	Description string
	Password    string
}

type SDBInstanceBackupCreateConfig

type SDBInstanceBackupCreateConfig struct {
	Name        string
	Description string
	Databases   []string
}

type SDBInstanceDatabaseCreateConfig

type SDBInstanceDatabaseCreateConfig struct {
	Name         string
	CharacterSet string
	Description  string
}

type SDBInstanceNetwork

type SDBInstanceNetwork struct {
	IP        string
	NetworkId string
}

type SDBInstancePrivilege

type SDBInstancePrivilege struct {
	Account   string
	Database  string
	Privilege string
}

type SDBInstanceRecoveryConfig

type SDBInstanceRecoveryConfig struct {
	BackupId                   string
	Databases                  map[string]string
	OriginDBInstanceExternalId string
}

type SDefaultAccount

type SDefaultAccount struct {
	Linux   SOsDefaultAccount
	Windows SOsDefaultAccount
}

type SDiskInfo

type SDiskInfo struct {
	StorageExternalId string
	StorageType       string
	SizeGB            int
	Name              string
}

type SDistDefaultAccount

type SDistDefaultAccount struct {
	// 操作系统发行版
	OsDistribution string
	// 默认用户名
	DefaultAccount string
	// 是否可更改
	Changeable bool
}

type SDnsCapability

type SDnsCapability struct {
	ZoneTypes    []TDnsZoneType
	DnsTypes     map[TDnsZoneType][]TDnsType
	PolicyTypes  map[TDnsZoneType][]TDnsPolicyType
	PolicyValues map[TDnsPolicyType][]TDnsPolicyValue
}

type SDnsZoneCreateOptions

type SDnsZoneCreateOptions struct {
	Name     string
	Desc     string
	ZoneType TDnsZoneType
	Vpcs     []SPrivateZoneVpc
	Options  *jsonutils.JSONDict
}

type SEip

type SEip struct {
	Name              string
	BandwidthMbps     int
	ChargeType        string
	BGPType           string
	NetworkExternalId string
	IP                string
	ProjectId         string
}

type SEnrollmentAccount

type SEnrollmentAccount struct {
	// Enrollment Account Id
	Id string `json:"id"`

	// Enrollment Account name
	Name string `json:"name"`

	// Enrollment Account 类型
	Type string `json:"type"`
}

type SExcludeRule

type SExcludeRule struct {
	Name string
}

type SExcludeRules

type SExcludeRules []SExcludeRule

func (SExcludeRules) IsZero

func (self SExcludeRules) IsZero() bool

func (SExcludeRules) String

func (self SExcludeRules) String() string

type SExtraIp

type SExtraIp struct {
	IP  string
	URL string
}

type SFakeOnPremiseRegion

type SFakeOnPremiseRegion struct {
}

func (*SFakeOnPremiseRegion) CreateEIP

func (region *SFakeOnPremiseRegion) CreateEIP(eip *SEip) (ICloudEIP, error)

func (*SFakeOnPremiseRegion) CreateILoadBalancer

func (region *SFakeOnPremiseRegion) CreateILoadBalancer(loadbalancer *SLoadbalancer) (ICloudLoadbalancer, error)

func (*SFakeOnPremiseRegion) CreateILoadBalancerAcl

func (region *SFakeOnPremiseRegion) CreateILoadBalancerAcl(acl *SLoadbalancerAccessControlList) (ICloudLoadbalancerAcl, error)

func (*SFakeOnPremiseRegion) CreateILoadBalancerCertificate

func (region *SFakeOnPremiseRegion) CreateILoadBalancerCertificate(cert *SLoadbalancerCertificate) (ICloudLoadbalancerCertificate, error)

func (*SFakeOnPremiseRegion) CreateISecurityGroup

func (region *SFakeOnPremiseRegion) CreateISecurityGroup(conf *SecurityGroupCreateInput) (ICloudSecurityGroup, error)

func (*SFakeOnPremiseRegion) CreateIVpc

func (region *SFakeOnPremiseRegion) CreateIVpc(opts *VpcCreateOptions) (ICloudVpc, error)

func (*SFakeOnPremiseRegion) GetCloudEnv

func (region *SFakeOnPremiseRegion) GetCloudEnv() string

func (*SFakeOnPremiseRegion) GetGeographicInfo

func (region *SFakeOnPremiseRegion) GetGeographicInfo() SGeographicInfo

func (*SFakeOnPremiseRegion) GetGlobalId

func (region *SFakeOnPremiseRegion) GetGlobalId() string

func (*SFakeOnPremiseRegion) GetIEipById

func (region *SFakeOnPremiseRegion) GetIEipById(id string) (ICloudEIP, error)

func (*SFakeOnPremiseRegion) GetIEips

func (region *SFakeOnPremiseRegion) GetIEips() ([]ICloudEIP, error)

func (*SFakeOnPremiseRegion) GetILoadBalancerAclById

func (region *SFakeOnPremiseRegion) GetILoadBalancerAclById(aclId string) (ICloudLoadbalancerAcl, error)

func (*SFakeOnPremiseRegion) GetILoadBalancerAcls

func (region *SFakeOnPremiseRegion) GetILoadBalancerAcls() ([]ICloudLoadbalancerAcl, error)

func (*SFakeOnPremiseRegion) GetILoadBalancerBackendGroups

func (region *SFakeOnPremiseRegion) GetILoadBalancerBackendGroups() ([]ICloudLoadbalancerBackendGroup, error)

func (*SFakeOnPremiseRegion) GetILoadBalancerById

func (region *SFakeOnPremiseRegion) GetILoadBalancerById(loadbalancerId string) (ICloudLoadbalancer, error)

func (*SFakeOnPremiseRegion) GetILoadBalancerCertificateById

func (region *SFakeOnPremiseRegion) GetILoadBalancerCertificateById(certId string) (ICloudLoadbalancerCertificate, error)

func (*SFakeOnPremiseRegion) GetILoadBalancerCertificates

func (region *SFakeOnPremiseRegion) GetILoadBalancerCertificates() ([]ICloudLoadbalancerCertificate, error)

func (*SFakeOnPremiseRegion) GetILoadBalancers

func (region *SFakeOnPremiseRegion) GetILoadBalancers() ([]ICloudLoadbalancer, error)

func (*SFakeOnPremiseRegion) GetISecurityGroupById

func (region *SFakeOnPremiseRegion) GetISecurityGroupById(id string) (ICloudSecurityGroup, error)

func (*SFakeOnPremiseRegion) GetISecurityGroupByName

func (region *SFakeOnPremiseRegion) GetISecurityGroupByName(opts *SecurityGroupFilterOptions) (ICloudSecurityGroup, error)

func (*SFakeOnPremiseRegion) GetIVpcById

func (region *SFakeOnPremiseRegion) GetIVpcById(id string) (ICloudVpc, error)

func (*SFakeOnPremiseRegion) GetIVpcs

func (region *SFakeOnPremiseRegion) GetIVpcs() ([]ICloudVpc, error)

func (*SFakeOnPremiseRegion) GetIZoneById

func (region *SFakeOnPremiseRegion) GetIZoneById(id string) (ICloudZone, error)

func (*SFakeOnPremiseRegion) GetIZones

func (region *SFakeOnPremiseRegion) GetIZones() ([]ICloudZone, error)

func (*SFakeOnPremiseRegion) GetId

func (region *SFakeOnPremiseRegion) GetId() string

func (*SFakeOnPremiseRegion) GetName

func (region *SFakeOnPremiseRegion) GetName() string

func (*SFakeOnPremiseRegion) GetStatus

func (region *SFakeOnPremiseRegion) GetStatus() string

func (*SFakeOnPremiseRegion) GetSysTags

func (region *SFakeOnPremiseRegion) GetSysTags() map[string]string

func (*SFakeOnPremiseRegion) GetTags

func (region *SFakeOnPremiseRegion) GetTags() (map[string]string, error)

func (*SFakeOnPremiseRegion) IsEmulated

func (region *SFakeOnPremiseRegion) IsEmulated() bool

func (*SFakeOnPremiseRegion) Refresh

func (region *SFakeOnPremiseRegion) Refresh() error

func (*SFakeOnPremiseRegion) SetTags

func (region *SFakeOnPremiseRegion) SetTags(tags map[string]string, replace bool) error

type SGeographicInfo

type SGeographicInfo struct {
	// 纬度
	// example: 26.647003
	Latitude float32 `list:"user" update:"admin" create:"admin_optional"`
	// 经度
	// example: 106.630211
	Longitude float32 `list:"user" update:"admin" create:"admin_optional"`

	// 城市
	// example: Guiyang
	City string `list:"user" width:"32" update:"admin" create:"admin_optional"`
	// 国家代码
	// example: CN
	CountryCode string `list:"user" width:"4" update:"admin" create:"admin_optional"`
}

+onecloud:model-api-gen

type SGetObjectRange

type SGetObjectRange struct {
	Start int64
	End   int64
}

func ParseRange

func ParseRange(rangeStr string) SGetObjectRange

func (SGetObjectRange) SizeBytes

func (r SGetObjectRange) SizeBytes() int64

func (SGetObjectRange) String

func (r SGetObjectRange) String() string

type SHCSOEndpoints

type SHCSOEndpoints struct {

	// 华为私有云Endpoint域名
	// example: hcso.com.cn
	// required:true
	EndpointDomain string `default:"$HUAWEI_ENDPOINT_DOMAIN" metavar:"$HUAWEI_ENDPOINT_DOMAIN"`

	// 默认DNS
	// example: 10.125.0.26,10.125.0.27
	// required: false
	DefaultSubnetDns string `default:"$HUAWEI_DEFAULT_SUBNET_DNS" metavar:"$HUAWEI_DEFAULT_SUBNET_DNS"`

	// 弹性云服务
	Ecs string `default:"$HUAWEI_ECS_ENDPOINT"`
	// 云容器服务
	Cce string `default:"$HUAWEI_CCE_ENDPOINT"`
	// 弹性伸缩服务
	As string `default:"$HUAWEI_AS_ENDPOINT"`
	// 统一身份认证服务
	Iam string `default:"$HUAWEI_IAM_ENDPOINT"`
	// 镜像服务
	Ims string `default:"$HUAWEI_IMS_ENDPOINT"`
	// 云服务器备份服务
	Csbs string `default:"$HUAWEI_CSBS_ENDPOINT"`
	// 云容器实例 CCI
	Cci string `default:"$HUAWEI_CCI_ENDPOINT"`
	// 裸金属服务器
	Bms string `default:"$HUAWEI_BMS_ENDPOINT"`
	// 云硬盘 EVS
	Evs string `default:"$HUAWEI_EVS_ENDPOINT"`
	// 云硬盘备份 VBS
	Vbs string `default:"$HUAWEI_VBS_ENDPOINT"`
	// 对象存储服务 OBS
	Obs string `default:"$HUAWEI_OBS_ENDPOINT"`
	// 虚拟私有云 VPC
	Vpc string `default:"$HUAWEI_VPC_ENDPOINT"`
	// 弹性负载均衡 ELB
	Elb string `default:"$HUAWEI_ELB_ENDPOINT"`
	// 合作伙伴运营能力
	Bss string `default:"$HUAWEI_BSS_ENDPOINT"`
	// Nat网关 NAT
	Nat string `default:"$HUAWEI_NAT_ENDPOINT"`
	// 分布式缓存服务
	Dcs string `default:"$HUAWEI_DCS_ENDPOINT"`
	// 关系型数据库 RDS
	Rds string `default:"$HUAWEI_RDS_ENDPOINT"`
	// 云审计服务
	Cts string `default:"$HUAWEI_CTS_ENDPOINT"`
	// 监控服务 CloudEye
	Ces string `default:"$HUAWEI_CES_ENDPOINT"`
	// 企业项目
	Eps string `default:"$HUAWEI_EPS_ENDPOINT"`
	// 文件系统
	SfsTurbo string `default:"$HUAWEI_SFS_TURBO_ENDPOINT"`
	// Modelarts
	Modelarts string `default:"$HUAWEI_MODELARTS_ENDPOINT"`
	// contains filtered or unexported fields
}

SHCSOEndpoints 华为私有云endpoints配置

endpoint获取方式优先级: 通过参数明确指定使用指定endpoint。否则,程序根据华为云endpoint命名规则自动拼接endpoint

func (*SHCSOEndpoints) GetEndpoint

func (self *SHCSOEndpoints) GetEndpoint(defaultRegion, serviceName string, region string) string

type SImage

type SImage struct {
	Checksum string
	// ContainerFormat string
	CreatedAt  time.Time
	Deleted    bool
	DiskFormat string
	Id         string
	IsPublic   bool
	MinDiskMB  int `json:"min_disk"`
	MinRamMB   int `json:"min_ram"`
	Name       string
	Owner      string
	Properties map[string]string
	Protected  bool
	SizeBytes  int64 `json:"size"`
	Status     string
	// UpdatedAt       time.Time
	PublicScope string
	ExternalId  string

	// SubImages record the subImages of the guest image.
	// For normal image, it's nil.
	SubImages []SSubImage

	// EncryptKeyId
	EncryptKeyId string
}

func CloudImage2Image

func CloudImage2Image(image ICloudImage) SImage

type SImageCreateOption

type SImageCreateOption struct {
	ImageId        string
	ExternalId     string
	ImageName      string
	OsType         string
	OsArch         string
	OsDistribution string
	OsVersion      string
	OsFullVersion  string
}

type SInstanceCapability

type SInstanceCapability struct {
	Provider   string
	Hypervisor string
	Storages   Storage

	DefaultAccount SDefaultAccount
}

type SInstanceType

type SInstanceType struct {
	InstanceType string
	SZoneInfo
}

type SInterVpcNetworkAttachVpcOption

type SInterVpcNetworkAttachVpcOption struct {
	VpcId               string
	VpcRegionId         string
	VpcAuthorityOwnerId string
}

type SInterVpcNetworkCreateOptions

type SInterVpcNetworkCreateOptions struct {
	Name string
	Desc string
}

type SInterVpcNetworkDetachVpcOption

type SInterVpcNetworkDetachVpcOption struct {
	VpcId               string
	VpcRegionId         string
	VpcAuthorityOwnerId string
}

type SKafkaTopic

type SKafkaTopic struct {
	Id          string
	Name        string
	Description string
}

type SKubeconfig

type SKubeconfig struct {
	Config     string    `json:"config"`
	Expiration time.Time `json:"expiration"`
}

type SListObjectResult

type SListObjectResult struct {
	Objects        []ICloudObject
	NextMarker     string
	CommonPrefixes []ICloudObject
	IsTruncated    bool
}

type SLoadbalancer

type SLoadbalancer struct {
	Name             string
	ZoneID           string
	SlaveZoneID      string
	VpcID            string
	NetworkIDs       []string
	EipID            string // eip id
	Address          string
	AddressType      string
	LoadbalancerSpec string
	ChargeType       string
	EgressMbps       int

	ProjectId string
	Tags      map[string]string
	// contains filtered or unexported fields
}

type SLoadbalancerAccessControlList

type SLoadbalancerAccessControlList struct {
	Name   string
	Entrys []SLoadbalancerAccessControlListEntry

	// used by huawei
	ListenerId          string
	AccessControlEnable bool
}

type SLoadbalancerAccessControlListEntry

type SLoadbalancerAccessControlListEntry struct {
	CIDR    string
	Comment string
}

type SLoadbalancerBackend

type SLoadbalancerBackend struct {
	Index       int
	Weight      int
	Port        int
	ID          string
	Name        string
	ExternalID  string
	BackendType string
	BackendRole string
	Address     string
	ZoneId      string
	HostName    string
}

type SLoadbalancerBackendGroup

type SLoadbalancerBackendGroup struct {
	Name      string
	GroupType string
	Backends  []SLoadbalancerBackend

	// huawei only
	LoadbalancerID string // 负载均衡ID
	ListenerID     string // 监听器ID
	ListenType     string // 后端服务器组监听类型
	Scheduler      string
	StickySession  *SLoadbalancerStickySession
	HealthCheck    *SLoadbalancerHealthCheck
	// aws
	ListenPort int    // 后端端口
	VpcId      string // vpc id
}

type SLoadbalancerCertificate

type SLoadbalancerCertificate struct {
	Name        string
	PrivateKey  string
	Certificate string
}

type SLoadbalancerHealthCheck

type SLoadbalancerHealthCheck struct {
	HealthCheckType string
	HealthCheckReq  string
	HealthCheckExp  string

	HealthCheck         string
	HealthCheckTimeout  int
	HealthCheckDomain   string
	HealthCheckHttpCode string
	HealthCheckURI      string
	HealthCheckInterval int

	HealthCheckRise int
	HealthCheckFail int
}

type SLoadbalancerListener

type SLoadbalancerListener struct {
	Name                    string
	LoadbalancerID          string
	ListenerType            string
	ListenerPort            int
	BackendGroupType        string
	BackendGroupID          string
	Scheduler               string
	AccessControlListStatus string
	AccessControlListType   string
	AccessControlListID     string
	EnableHTTP2             bool
	CertificateID           string
	EgressMbps              int
	Description             string
	EstablishedTimeout      int

	ClientRequestTimeout  int
	ClientIdleTimeout     int
	BackendConnectTimeout int
	BackendIdleTimeout    int

	HealthCheckReq string
	HealthCheckExp string

	HealthCheck         string
	HealthCheckType     string
	HealthCheckTimeout  int
	HealthCheckDomain   string
	HealthCheckHttpCode string
	HealthCheckURI      string
	HealthCheckInterval int

	HealthCheckRise int
	HealthCheckFail int

	StickySession              string
	StickySessionCookie        string
	StickySessionType          string
	StickySessionCookieTimeout int

	BackendServerPort int
	XForwardedFor     bool
	Gzip              bool

	TLSCipherPolicy string
}

type SLoadbalancerListenerRule

type SLoadbalancerListenerRule struct {
	Name             string
	Domain           string
	Path             string
	BackendGroupID   string
	BackendGroupType string

	Condition string // for aws only

	Scheduler           string // for qcloud only
	HealthCheck         string // for qcloud only
	HealthCheckType     string // for qcloud only
	HealthCheckTimeout  int    // for qcloud only
	HealthCheckDomain   string // for qcloud only
	HealthCheckHttpCode string // for qcloud only
	HealthCheckURI      string // for qcloud only
	HealthCheckInterval int    // for qcloud only

	HealthCheckRise int // for qcloud only
	HealthCheckFail int // for qcloud only

	StickySessionCookieTimeout int // for qcloud only

	// openstack redirect
	Redirect       string `width:"16" nullable:"true" list:"user" create:"optional" update:"user" default:"off"` // 跳转类型
	RedirectCode   int    `nullable:"true" list:"user" create:"optional" update:"user"`                          // 跳转HTTP code
	RedirectScheme string `width:"16" nullable:"true" list:"user" create:"optional" update:"user"`               // 跳转uri scheme
	RedirectHost   string `nullable:"true" list:"user" create:"optional" update:"user"`                          // 跳转时变更Host
	RedirectPath   string `nullable:"true" list:"user" create:"optional" update:"user"`                          // 跳转时变更Path
}

type SLoadbalancerStickySession

type SLoadbalancerStickySession struct {
	StickySession              string
	StickySessionCookie        string
	StickySessionType          string
	StickySessionCookieTimeout int
}

type SManagedDBInstanceChangeConfig

type SManagedDBInstanceChangeConfig struct {
	DiskSizeGB   int
	InstanceType string
}

type SManagedDBInstanceCreateConfig

type SManagedDBInstanceCreateConfig struct {
	Name        string
	Description string
	StorageType string
	DiskSizeGB  int
	SInstanceType
	VcpuCount        int
	VmemSizeMb       int
	VpcId            string
	SecgroupIds      []string
	NetworkId        string
	Address          string
	Engine           string
	EngineVersion    string
	Category         string
	Port             int
	MasterInstanceId string
	Password         string
	Username         string
	ProjectId        string

	MultiAz bool

	BillingCycle *billing.SBillingCycle
	Tags         map[string]string

	// 仅从备份恢复到新实例用到
	RdsId    string
	BackupId string
}

type SManagedVMChangeConfig

type SManagedVMChangeConfig struct {
	Cpu          int
	MemoryMB     int
	InstanceType string
}

type SManagedVMCreateConfig

type SManagedVMCreateConfig struct {
	Name                string
	NameEn              string
	Hostname            string
	ExternalImageId     string
	ImageType           string
	OsType              string
	OsDistribution      string
	OsVersion           string
	InstanceType        string // InstanceType 不为空时,直接采用InstanceType创建机器。
	Cpu                 int
	MemoryMB            int
	ExternalNetworkId   string
	ExternalVpcId       string
	IpAddr              string
	Description         string
	SysDisk             SDiskInfo
	DataDisks           []SDiskInfo
	PublicKey           string
	ExternalSecgroupId  string
	ExternalSecgroupIds []string
	Account             string
	Password            string
	UserData            string
	ProjectId           string

	SPublicIpInfo

	Tags map[string]string

	BillingCycle *billing.SBillingCycle

	IsNeedInjectPasswordByCloudInit bool
	UserDataType                    string
	WindowsUserDataType             string
	IsWindowsUserDataTypeNeedEncode bool
}

func (*SManagedVMCreateConfig) GetConfig

func (vmConfig *SManagedVMCreateConfig) GetConfig(config *jsonutils.JSONDict) error

func (*SManagedVMCreateConfig) GetUserData

func (vmConfig *SManagedVMCreateConfig) GetUserData() (string, error)

func (*SManagedVMCreateConfig) InjectPasswordByCloudInit

func (vmConfig *SManagedVMCreateConfig) InjectPasswordByCloudInit() error

type SManagedVMRebuildRootConfig

type SManagedVMRebuildRootConfig struct {
	Account   string
	Password  string
	ImageId   string
	PublicKey string
	SysSizeGB int
	OsType    string
}

type SModelI18nEntry

type SModelI18nEntry struct {
	Value string
	// contains filtered or unexported fields
}

func NewSModelI18nEntry

func NewSModelI18nEntry(value string) *SModelI18nEntry

func (*SModelI18nEntry) CN

func (self *SModelI18nEntry) CN(v string) *SModelI18nEntry

func (*SModelI18nEntry) EN

func (self *SModelI18nEntry) EN(v string) *SModelI18nEntry

func (*SModelI18nEntry) GetKeyValue

func (self *SModelI18nEntry) GetKeyValue() string

func (*SModelI18nEntry) Lookup

func (self *SModelI18nEntry) Lookup(tag i18n.Tag) string

type SModelI18nTable

type SModelI18nTable map[string]*SModelI18nEntry

type SMongoDBBackup

type SMongoDBBackup struct {
	Name         string
	Description  string
	StartTime    time.Time
	EndTime      time.Time
	Status       TMongoDBBackupStatus
	BackupMethod TMongoDBBackupMethod
	BackupType   TMongoDBBackupType
	BackupSizeKb int
}

type SMongoDBBackups

type SMongoDBBackups struct {
	Data  []SMongoDBBackup
	Total int
}

type SMountTargetCreateOptions

type SMountTargetCreateOptions struct {
	AccessGroupId string
	NetworkType   string
	VpcId         string
	NetworkId     string
	FileSystemId  string
}

type SNatDRule

type SNatDRule struct {
	Protocol string

	InternalIP   string
	InternalPort int

	ExternalIP   string
	ExternalIPID string
	ExternalPort int
}

type SNatSRule

type SNatSRule struct {
	SourceCIDR string
	NetworkID  string

	ExternalIP   string
	ExternalIPID string
}

type SNetworkCreateOptions

type SNetworkCreateOptions struct {
	Name      string
	Desc      string
	ProjectId string
	Cidr      string
}

type SOsDefaultAccount

type SOsDefaultAccount struct {
	// 默认用户名
	DefaultAccount string
	// 是否可更改用户名
	Changeable bool
	// 禁止使用的账号
	DisabledAccounts []string
	// 各操作系统发行版的默认用户名信息
	DistAccounts []SDistDefaultAccount
}

type SPremiseBaseProviderFactory

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

func (*SPremiseBaseProviderFactory) GetAccountIdEqualizer

func (factory *SPremiseBaseProviderFactory) GetAccountIdEqualizer() func(origin, now string) bool

func (*SPremiseBaseProviderFactory) GetClouduserMinPolicyCount

func (factory *SPremiseBaseProviderFactory) GetClouduserMinPolicyCount() int

func (*SPremiseBaseProviderFactory) GetMaxCloudEventKeepDays

func (factory *SPremiseBaseProviderFactory) GetMaxCloudEventKeepDays() int

func (*SPremiseBaseProviderFactory) GetMaxCloudEventSyncDays

func (factory *SPremiseBaseProviderFactory) GetMaxCloudEventSyncDays() int

func (*SPremiseBaseProviderFactory) GetProvider

func (factory *SPremiseBaseProviderFactory) GetProvider(providerId, providerName, url, username, password string) (ICloudProvider, error)

func (*SPremiseBaseProviderFactory) GetSupportedBrands

func (factory *SPremiseBaseProviderFactory) GetSupportedBrands() []string

func (*SPremiseBaseProviderFactory) GetSupportedDnsPolicyTypes

func (factory *SPremiseBaseProviderFactory) GetSupportedDnsPolicyTypes() map[TDnsZoneType][]TDnsPolicyType

func (*SPremiseBaseProviderFactory) GetSupportedDnsPolicyValues

func (factory *SPremiseBaseProviderFactory) GetSupportedDnsPolicyValues() map[TDnsPolicyType][]TDnsPolicyValue

func (*SPremiseBaseProviderFactory) GetSupportedDnsTypes

func (factory *SPremiseBaseProviderFactory) GetSupportedDnsTypes() map[TDnsZoneType][]TDnsType

func (*SPremiseBaseProviderFactory) GetSupportedDnsZoneTypes

func (factory *SPremiseBaseProviderFactory) GetSupportedDnsZoneTypes() []TDnsZoneType

func (*SPremiseBaseProviderFactory) GetTTLRange

func (factory *SPremiseBaseProviderFactory) GetTTLRange(zoneType TDnsZoneType, productType TDnsProductType) TTlRange

func (*SPremiseBaseProviderFactory) IsCloudeventRegional

func (factory *SPremiseBaseProviderFactory) IsCloudeventRegional() bool

func (*SPremiseBaseProviderFactory) IsCloudpolicyWithSubscription

func (factory *SPremiseBaseProviderFactory) IsCloudpolicyWithSubscription() bool

func (*SPremiseBaseProviderFactory) IsClouduserNeedInitPolicy

func (factory *SPremiseBaseProviderFactory) IsClouduserNeedInitPolicy() bool

func (*SPremiseBaseProviderFactory) IsClouduserpolicyWithSubscription

func (factory *SPremiseBaseProviderFactory) IsClouduserpolicyWithSubscription() bool

func (*SPremiseBaseProviderFactory) IsMultiTenant

func (factory *SPremiseBaseProviderFactory) IsMultiTenant() bool

func (*SPremiseBaseProviderFactory) IsNeedForceAutoCreateProject

func (factory *SPremiseBaseProviderFactory) IsNeedForceAutoCreateProject() bool

func (*SPremiseBaseProviderFactory) IsOnPremise

func (factory *SPremiseBaseProviderFactory) IsOnPremise() bool

func (*SPremiseBaseProviderFactory) IsPublicCloud

func (factory *SPremiseBaseProviderFactory) IsPublicCloud() bool

func (*SPremiseBaseProviderFactory) IsSupportCloudIdService

func (factory *SPremiseBaseProviderFactory) IsSupportCloudIdService() bool

func (*SPremiseBaseProviderFactory) IsSupportClouduserPolicy

func (factory *SPremiseBaseProviderFactory) IsSupportClouduserPolicy() bool

func (*SPremiseBaseProviderFactory) IsSupportCreateCloudgroup

func (factory *SPremiseBaseProviderFactory) IsSupportCreateCloudgroup() bool

func (*SPremiseBaseProviderFactory) IsSupportCrossCloudEnvVpcPeering

func (factory *SPremiseBaseProviderFactory) IsSupportCrossCloudEnvVpcPeering() bool

func (*SPremiseBaseProviderFactory) IsSupportCrossRegionVpcPeering

func (factory *SPremiseBaseProviderFactory) IsSupportCrossRegionVpcPeering() bool

func (*SPremiseBaseProviderFactory) IsSupportModifyRouteTable

func (factory *SPremiseBaseProviderFactory) IsSupportModifyRouteTable() bool

func (*SPremiseBaseProviderFactory) IsSupportPrepaidResources

func (factory *SPremiseBaseProviderFactory) IsSupportPrepaidResources() bool

func (*SPremiseBaseProviderFactory) IsSupportResetClouduserPassword

func (factory *SPremiseBaseProviderFactory) IsSupportResetClouduserPassword() bool

func (*SPremiseBaseProviderFactory) IsSupportSAMLAuth

func (factory *SPremiseBaseProviderFactory) IsSupportSAMLAuth() bool

func (*SPremiseBaseProviderFactory) IsSupportVpcPeeringVpcCidrOverlap

func (factory *SPremiseBaseProviderFactory) IsSupportVpcPeeringVpcCidrOverlap() bool

func (*SPremiseBaseProviderFactory) IsSystemCloudpolicyUnified

func (factory *SPremiseBaseProviderFactory) IsSystemCloudpolicyUnified() bool

func (*SPremiseBaseProviderFactory) NeedSyncSkuFromCloud

func (factory *SPremiseBaseProviderFactory) NeedSyncSkuFromCloud() bool

func (*SPremiseBaseProviderFactory) ValidateChangeBandwidth

func (factory *SPremiseBaseProviderFactory) ValidateChangeBandwidth(instanceId string, bandwidth int64) error

func (*SPremiseBaseProviderFactory) ValidateCrossRegionVpcPeeringBandWidth

func (factory *SPremiseBaseProviderFactory) ValidateCrossRegionVpcPeeringBandWidth(bandwidth int) error

type SPrivateCloudBaseProviderFactory

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

func (*SPrivateCloudBaseProviderFactory) GetAccountIdEqualizer

func (factory *SPrivateCloudBaseProviderFactory) GetAccountIdEqualizer() func(origin, now string) bool

func (*SPrivateCloudBaseProviderFactory) GetClouduserMinPolicyCount

func (factory *SPrivateCloudBaseProviderFactory) GetClouduserMinPolicyCount() int

func (*SPrivateCloudBaseProviderFactory) GetMaxCloudEventKeepDays

func (factory *SPrivateCloudBaseProviderFactory) GetMaxCloudEventKeepDays() int

func (*SPrivateCloudBaseProviderFactory) GetMaxCloudEventSyncDays

func (factory *SPrivateCloudBaseProviderFactory) GetMaxCloudEventSyncDays() int

func (*SPrivateCloudBaseProviderFactory) GetProvider

func (factory *SPrivateCloudBaseProviderFactory) GetProvider(providerId, providerName, url, username, password string) (ICloudProvider, error)

func (*SPrivateCloudBaseProviderFactory) GetSupportedBrands

func (factory *SPrivateCloudBaseProviderFactory) GetSupportedBrands() []string

func (*SPrivateCloudBaseProviderFactory) GetSupportedDnsPolicyTypes

func (factory *SPrivateCloudBaseProviderFactory) GetSupportedDnsPolicyTypes() map[TDnsZoneType][]TDnsPolicyType

func (*SPrivateCloudBaseProviderFactory) GetSupportedDnsPolicyValues

func (factory *SPrivateCloudBaseProviderFactory) GetSupportedDnsPolicyValues() map[TDnsPolicyType][]TDnsPolicyValue

func (*SPrivateCloudBaseProviderFactory) GetSupportedDnsTypes

func (factory *SPrivateCloudBaseProviderFactory) GetSupportedDnsTypes() map[TDnsZoneType][]TDnsType

func (*SPrivateCloudBaseProviderFactory) GetSupportedDnsZoneTypes

func (factory *SPrivateCloudBaseProviderFactory) GetSupportedDnsZoneTypes() []TDnsZoneType

func (*SPrivateCloudBaseProviderFactory) GetTTLRange

func (factory *SPrivateCloudBaseProviderFactory) GetTTLRange(zoneType TDnsZoneType, productType TDnsProductType) TTlRange

func (*SPrivateCloudBaseProviderFactory) IsCloudeventRegional

func (factory *SPrivateCloudBaseProviderFactory) IsCloudeventRegional() bool

func (*SPrivateCloudBaseProviderFactory) IsCloudpolicyWithSubscription

func (factory *SPrivateCloudBaseProviderFactory) IsCloudpolicyWithSubscription() bool

func (*SPrivateCloudBaseProviderFactory) IsClouduserNeedInitPolicy

func (factory *SPrivateCloudBaseProviderFactory) IsClouduserNeedInitPolicy() bool

func (*SPrivateCloudBaseProviderFactory) IsClouduserpolicyWithSubscription

func (factory *SPrivateCloudBaseProviderFactory) IsClouduserpolicyWithSubscription() bool

func (*SPrivateCloudBaseProviderFactory) IsMultiTenant

func (factory *SPrivateCloudBaseProviderFactory) IsMultiTenant() bool

func (*SPrivateCloudBaseProviderFactory) IsNeedForceAutoCreateProject

func (factory *SPrivateCloudBaseProviderFactory) IsNeedForceAutoCreateProject() bool

func (*SPrivateCloudBaseProviderFactory) IsOnPremise

func (factory *SPrivateCloudBaseProviderFactory) IsOnPremise() bool

func (*SPrivateCloudBaseProviderFactory) IsPublicCloud

func (factory *SPrivateCloudBaseProviderFactory) IsPublicCloud() bool

func (*SPrivateCloudBaseProviderFactory) IsSupportCloudIdService

func (factory *SPrivateCloudBaseProviderFactory) IsSupportCloudIdService() bool

func (*SPrivateCloudBaseProviderFactory) IsSupportClouduserPolicy

func (factory *SPrivateCloudBaseProviderFactory) IsSupportClouduserPolicy() bool

func (*SPrivateCloudBaseProviderFactory) IsSupportCreateCloudgroup

func (factory *SPrivateCloudBaseProviderFactory) IsSupportCreateCloudgroup() bool

func (*SPrivateCloudBaseProviderFactory) IsSupportCrossCloudEnvVpcPeering

func (factory *SPrivateCloudBaseProviderFactory) IsSupportCrossCloudEnvVpcPeering() bool

func (*SPrivateCloudBaseProviderFactory) IsSupportCrossRegionVpcPeering

func (factory *SPrivateCloudBaseProviderFactory) IsSupportCrossRegionVpcPeering() bool

func (*SPrivateCloudBaseProviderFactory) IsSupportModifyRouteTable

func (factory *SPrivateCloudBaseProviderFactory) IsSupportModifyRouteTable() bool

func (*SPrivateCloudBaseProviderFactory) IsSupportPrepaidResources

func (factory *SPrivateCloudBaseProviderFactory) IsSupportPrepaidResources() bool

func (*SPrivateCloudBaseProviderFactory) IsSupportResetClouduserPassword

func (factory *SPrivateCloudBaseProviderFactory) IsSupportResetClouduserPassword() bool

func (*SPrivateCloudBaseProviderFactory) IsSupportSAMLAuth

func (factory *SPrivateCloudBaseProviderFactory) IsSupportSAMLAuth() bool

func (*SPrivateCloudBaseProviderFactory) IsSupportVpcPeeringVpcCidrOverlap

func (factory *SPrivateCloudBaseProviderFactory) IsSupportVpcPeeringVpcCidrOverlap() bool

func (*SPrivateCloudBaseProviderFactory) IsSystemCloudpolicyUnified

func (factory *SPrivateCloudBaseProviderFactory) IsSystemCloudpolicyUnified() bool

func (*SPrivateCloudBaseProviderFactory) NeedSyncSkuFromCloud

func (factory *SPrivateCloudBaseProviderFactory) NeedSyncSkuFromCloud() bool

func (*SPrivateCloudBaseProviderFactory) ValidateChangeBandwidth

func (factory *SPrivateCloudBaseProviderFactory) ValidateChangeBandwidth(instanceId string, bandwidth int64) error

func (*SPrivateCloudBaseProviderFactory) ValidateCrossRegionVpcPeeringBandWidth

func (factory *SPrivateCloudBaseProviderFactory) ValidateCrossRegionVpcPeeringBandWidth(bandwidth int) error

type SPrivateZoneVpc

type SPrivateZoneVpc struct {
	Id       string
	RegionId string
}

type SProviderInfo

type SProviderInfo struct {
	Name    string
	Url     string
	Account string
	Secret  string
	Options *jsonutils.JSONDict
}

type SPublicCloudBaseProviderFactory

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

func (*SPublicCloudBaseProviderFactory) GetAccountIdEqualizer

func (factory *SPublicCloudBaseProviderFactory) GetAccountIdEqualizer() func(origin, now string) bool

func (*SPublicCloudBaseProviderFactory) GetClouduserMinPolicyCount

func (factory *SPublicCloudBaseProviderFactory) GetClouduserMinPolicyCount() int

func (*SPublicCloudBaseProviderFactory) GetMaxCloudEventKeepDays

func (factory *SPublicCloudBaseProviderFactory) GetMaxCloudEventKeepDays() int

func (*SPublicCloudBaseProviderFactory) GetMaxCloudEventSyncDays

func (factory *SPublicCloudBaseProviderFactory) GetMaxCloudEventSyncDays() int

func (*SPublicCloudBaseProviderFactory) GetProvider

func (factory *SPublicCloudBaseProviderFactory) GetProvider(providerId, providerName, url, username, password string) (ICloudProvider, error)

func (*SPublicCloudBaseProviderFactory) GetSupportedBrands

func (factory *SPublicCloudBaseProviderFactory) GetSupportedBrands() []string

func (*SPublicCloudBaseProviderFactory) GetSupportedDnsPolicyTypes

func (factory *SPublicCloudBaseProviderFactory) GetSupportedDnsPolicyTypes() map[TDnsZoneType][]TDnsPolicyType

func (*SPublicCloudBaseProviderFactory) GetSupportedDnsPolicyValues

func (factory *SPublicCloudBaseProviderFactory) GetSupportedDnsPolicyValues() map[TDnsPolicyType][]TDnsPolicyValue

func (*SPublicCloudBaseProviderFactory) GetSupportedDnsTypes

func (factory *SPublicCloudBaseProviderFactory) GetSupportedDnsTypes() map[TDnsZoneType][]TDnsType

func (*SPublicCloudBaseProviderFactory) GetSupportedDnsZoneTypes

func (factory *SPublicCloudBaseProviderFactory) GetSupportedDnsZoneTypes() []TDnsZoneType

func (*SPublicCloudBaseProviderFactory) GetTTLRange

func (factory *SPublicCloudBaseProviderFactory) GetTTLRange(zoneType TDnsZoneType, productType TDnsProductType) TTlRange

func (*SPublicCloudBaseProviderFactory) IsCloudeventRegional

func (factory *SPublicCloudBaseProviderFactory) IsCloudeventRegional() bool

func (*SPublicCloudBaseProviderFactory) IsCloudpolicyWithSubscription

func (factory *SPublicCloudBaseProviderFactory) IsCloudpolicyWithSubscription() bool

func (*SPublicCloudBaseProviderFactory) IsClouduserNeedInitPolicy

func (factory *SPublicCloudBaseProviderFactory) IsClouduserNeedInitPolicy() bool

func (*SPublicCloudBaseProviderFactory) IsClouduserpolicyWithSubscription

func (factory *SPublicCloudBaseProviderFactory) IsClouduserpolicyWithSubscription() bool

func (*SPublicCloudBaseProviderFactory) IsMultiTenant

func (factory *SPublicCloudBaseProviderFactory) IsMultiTenant() bool

func (*SPublicCloudBaseProviderFactory) IsNeedForceAutoCreateProject

func (factory *SPublicCloudBaseProviderFactory) IsNeedForceAutoCreateProject() bool

func (*SPublicCloudBaseProviderFactory) IsOnPremise

func (factory *SPublicCloudBaseProviderFactory) IsOnPremise() bool

func (*SPublicCloudBaseProviderFactory) IsPublicCloud

func (factory *SPublicCloudBaseProviderFactory) IsPublicCloud() bool

func (*SPublicCloudBaseProviderFactory) IsSupportCloudIdService

func (factory *SPublicCloudBaseProviderFactory) IsSupportCloudIdService() bool

func (*SPublicCloudBaseProviderFactory) IsSupportClouduserPolicy

func (factory *SPublicCloudBaseProviderFactory) IsSupportClouduserPolicy() bool

func (*SPublicCloudBaseProviderFactory) IsSupportCreateCloudgroup

func (factory *SPublicCloudBaseProviderFactory) IsSupportCreateCloudgroup() bool

func (*SPublicCloudBaseProviderFactory) IsSupportCrossCloudEnvVpcPeering

func (factory *SPublicCloudBaseProviderFactory) IsSupportCrossCloudEnvVpcPeering() bool

func (*SPublicCloudBaseProviderFactory) IsSupportCrossRegionVpcPeering

func (factory *SPublicCloudBaseProviderFactory) IsSupportCrossRegionVpcPeering() bool

func (*SPublicCloudBaseProviderFactory) IsSupportModifyRouteTable

func (factory *SPublicCloudBaseProviderFactory) IsSupportModifyRouteTable() bool

func (*SPublicCloudBaseProviderFactory) IsSupportPrepaidResources

func (factory *SPublicCloudBaseProviderFactory) IsSupportPrepaidResources() bool

func (*SPublicCloudBaseProviderFactory) IsSupportResetClouduserPassword

func (factory *SPublicCloudBaseProviderFactory) IsSupportResetClouduserPassword() bool

func (*SPublicCloudBaseProviderFactory) IsSupportSAMLAuth

func (factory *SPublicCloudBaseProviderFactory) IsSupportSAMLAuth() bool

func (*SPublicCloudBaseProviderFactory) IsSupportVpcPeeringVpcCidrOverlap

func (factory *SPublicCloudBaseProviderFactory) IsSupportVpcPeeringVpcCidrOverlap() bool

func (*SPublicCloudBaseProviderFactory) IsSystemCloudpolicyUnified

func (factory *SPublicCloudBaseProviderFactory) IsSystemCloudpolicyUnified() bool

func (*SPublicCloudBaseProviderFactory) NeedSyncSkuFromCloud

func (factory *SPublicCloudBaseProviderFactory) NeedSyncSkuFromCloud() bool

func (*SPublicCloudBaseProviderFactory) ValidateChangeBandwidth

func (factory *SPublicCloudBaseProviderFactory) ValidateChangeBandwidth(instanceId string, bandwidth int64) error

func (*SPublicCloudBaseProviderFactory) ValidateCrossRegionVpcPeeringBandWidth

func (factory *SPublicCloudBaseProviderFactory) ValidateCrossRegionVpcPeeringBandWidth(bandwidth int) error

type SPublicIpInfo

type SPublicIpInfo struct {
	PublicIpBw         int
	PublicIpChargeType TElasticipChargeType
}

type SRoleCreateOptions

type SRoleCreateOptions struct {
	Name         string
	Desc         string
	SAMLProvider string
}

type SServerSku

type SServerSku struct {
	Name         string
	CpuCoreCount int
	MemorySizeMB int
}

type SServerSkuCreateOption

type SServerSkuCreateOption struct {
	Name             string
	CpuCount         int
	VmemSizeMb       int
	SysDiskMinSizeGb int
	SysDiskMaxSizeGb int
}

type SSubAccount

type SSubAccount struct {
	// 若Account不为空,可不传
	Name string
	// 描述信息
	Desc string
	// 输入必填,若为空,需要指定子账号名称
	Account          string
	HealthStatus     string // 云端服务健康状态。例如欠费、项目冻结都属于不健康状态。
	DefaultProjectId string // 默认云订阅项目Id
}

type SSubImage

type SSubImage struct {
	Index     int
	MinDiskMB int
	MinRamMb  int
	SizeBytes int64
}

type SVpcJointInterVpcNetworkOption

type SVpcJointInterVpcNetworkOption struct {
	InterVpcNetworkId       string
	NetworkAuthorityOwnerId string
}

type SWafRule

type SWafRule struct {
	Name               string
	Desc               string
	Action             *DefaultAction
	StatementCondition TWafStatementCondition
	Priority           int
	Statements         []SWafStatement
}

type SWafStatement

type SWafStatement struct {
	// 管理规则组名称
	ManagedRuleGroupName string `width:"64" charset:"utf8" nullable:"false" list:"user"`
	// 不包含的规则列表
	ExcludeRules *SExcludeRules `width:"200" charset:"utf8" nullable:"false" list:"user"`
	// 表达式类别
	// enmu: ByteMatch, GeoMatch, IPSet, LabelMatch, ManagedRuleGroup, Rate, RegexSet, RuleGroup, Size, SqliMatch, XssMatch
	Type TWafStatementType `width:"20" charset:"ascii" nullable:"false" list:"user"`
	// 是否取反操作, 仅对Azure生效
	Negation bool `nullable:"false" list:"user"`
	// 操作类型
	// enum: EQ, NE, LE, LT, GE, GT
	Operator TWafOperator `width:"20" charset:"ascii" nullable:"false" list:"user"`
	// 匹配字段
	// enmu: Body, JsonBody, Query, Method, Header, UriPath, PostArgs, Cookie
	MatchField TWafMatchField `width:"20" charset:"utf8" nullable:"false" list:"user"`
	// 匹配字段的key
	MatchFieldKey string `width:"20" charset:"utf8" nullable:"false" list:"user"`
	// 匹配字段的值列表
	MatchFieldValues *TWafMatchFieldValues `width:"250" charset:"utf8" nullable:"false" list:"user"`
	// 进行转换操作
	// enmu: CompressWithSpace, HtmlEntityDecode, Lowercase, CmdLine, UrlDecode, Trim, UrlEncode, RemoveNulls
	Transformations   *TextTransformations `width:"250" charset:"ascii" nullable:"false" list:"user"`
	ForwardedIPHeader string               `width:"20" charset:"ascii" nullable:"false" list:"user"`
	// 搜索字段, 仅Aws有用
	SearchString string `width:"64" charset:"utf8" nullable:"false" list:"user"`
	IPSetId      string `width:"36" charset:"ascii" nullable:"false" list:"user"`
	// 正则表达式Id, 目前只读
	RegexSetId string `width:"36" charset:"ascii" nullable:"false" list:"user"`
	// 自定义规则组Id, 目前只读
	RuleGroupId string `width:"36" charset:"ascii" nullable:"false" list:"user"`
}

+onecloud:model-api-gen

func (SWafStatement) GetExternalId

func (self SWafStatement) GetExternalId() string

func (SWafStatement) GetGlobalId

func (self SWafStatement) GetGlobalId() string

type SWireCreateOptions

type SWireCreateOptions struct {
	Name      string
	ZoneId    string
	Bandwidth int
	Mtu       int
}

type SZoneInfo

type SZoneInfo struct {
	Zone1  string
	Zone2  string
	Zone3  string
	ZoneId string
}

type SaveImageOptions

type SaveImageOptions struct {
	Name  string
	Notes string
}

type SecDriver

type SecDriver interface {
	GetDefaultSecurityGroupInRule() SecurityRule
	GetDefaultSecurityGroupOutRule() SecurityRule
	GetSecurityGroupRuleMaxPriority() int
	GetSecurityGroupRuleMinPriority() int
	IsOnlySupportAllowRules() bool
	IsSupportPeerSecgroup() bool
}

type SecRuleInfo

type SecRuleInfo struct {
	InDefaultRule  SecurityRule
	OutDefaultRule SecurityRule

	Rules                   SecurityRuleSet
	MinPriority             int
	MaxPriority             int
	IsOnlySupportAllowRules bool
	IsSupportPeerSecgroup   bool
	// contains filtered or unexported fields
}

func NewSecRuleInfo

func NewSecRuleInfo(driver SecDriver) SecRuleInfo

func (SecRuleInfo) AddDefaultRule

func (r SecRuleInfo) AddDefaultRule(d SecRuleInfo, inRules, outRules []SecurityRule, isSrc bool) ([]SecurityRule, []SecurityRule)

func (*SecRuleInfo) Split

func (self *SecRuleInfo) Split() (in, out SecurityRuleSet)

type SecurityGroupCreateInput

type SecurityGroupCreateInput struct {
	Name      string
	Desc      string
	VpcId     string
	ProjectId string
	Rules     []secrules.SecurityRule
}

type SecurityGroupFilterOptions

type SecurityGroupFilterOptions struct {
	VpcId     string
	Name      string
	ProjectId string
}

type SecurityGroupReference

type SecurityGroupReference struct {
	Id   string
	Name string
}

type SecurityRule

type SecurityRule struct {
	secrules.SecurityRule
	Name       string
	ExternalId string
	Id         string

	PeerSecgroupId string
	// contains filtered or unexported fields
}

func SortUniqPriority

func SortUniqPriority(rules SecurityRuleSet) []SecurityRule

func (SecurityRule) String

func (r SecurityRule) String() string

type SecurityRuleSet

type SecurityRuleSet []SecurityRule

func CompareRules

func CompareRules(src, dest SecRuleInfo, debug bool) (common, inAdds, outAdds, inDels, outDels SecurityRuleSet)

func (SecurityRuleSet) AllowList

func (srs SecurityRuleSet) AllowList() (secrules.SecurityRuleSet, bool)

func (SecurityRuleSet) CanBeSplitByProtocol

func (srs SecurityRuleSet) CanBeSplitByProtocol() bool

func (SecurityRuleSet) Debug

func (srs SecurityRuleSet) Debug()

func (SecurityRuleSet) Len

func (srs SecurityRuleSet) Len() int

func (SecurityRuleSet) Less

func (srs SecurityRuleSet) Less(i, j int) bool

func (SecurityRuleSet) Swap

func (srs SecurityRuleSet) Swap(i, j int)

type ServerStopOptions

type ServerStopOptions struct {
	IsForce      bool
	StopCharging bool
}

type ServerVncInput

type ServerVncInput struct {
	// 是否使用原生vnc控制台,此选项仅对openstack有效
	// default: false
	Origin bool `json:"origin"`
}

+onecloud:model-api-gen

type ServerVncOutput

type ServerVncOutput struct {
	Id string `json:"id"`

	// baremetal
	HostId string `json:"host_id"`
	Zone   string `json:"zone"`

	// kvm host ip
	Host     string `json:"host"`
	Protocol string `json:"protocol"`
	Port     int64  `json:"port"`

	Url          string `json:"url"`
	InstanceId   string `json:"instance_id"`
	InstanceName string `json:"instance_name"`
	Password     string `json:"password"`
	VncPassword  string `json:"vnc_password"`

	OsName string `json:"os_name"`

	// cloudpods
	ApiServer     string `json:"api_server"`
	ConnectParams string `json:"connect_params"`
	Session       string `json:"session"`

	Hypervisor string `json:"hypervisor"`
}

+onecloud:model-api-gen

type SnapshotPolicyInput

type SnapshotPolicyInput struct {
	RetentionDays              int
	RepeatWeekdays, TimePoints []int
	PolicyName                 string
}

func (*SnapshotPolicyInput) GetStringArrayRepeatWeekdays

func (spi *SnapshotPolicyInput) GetStringArrayRepeatWeekdays() []string

func (*SnapshotPolicyInput) GetStringArrayTimePoints

func (spi *SnapshotPolicyInput) GetStringArrayTimePoints() []string

type Storage

type Storage struct {
	DataDisk []StorageInfo
	SysDisk  []StorageInfo
}

type StorageInfo

type StorageInfo struct {
	StorageType string
	MaxSizeGb   int
	MinSizeGb   int
	Resizable   bool
	StepSizeGb  int
}

type SubAccounts

type SubAccounts struct {
	// 若输出则是全量子账号列表,若输入,代表允许同步的子账号
	Accounts []SSubAccount
	// 若输出是云账号查询到的区域列表,若输入,代表允许同步的区域
	Cloudregions []struct {
		// 输入必填
		Id     string
		Name   string
		Status string
	}
}

+onecloud:model-api-gen

func (SubAccounts) IsZero

func (self SubAccounts) IsZero() bool

func (SubAccounts) String

func (self SubAccounts) String() string

type SubscriptionCreateInput

type SubscriptionCreateInput struct {
	Name                string
	EnrollmentAccountId string
	OfferType           string
}

type TBackupMethod

type TBackupMethod string

type TBiosType

type TBiosType string

func ToBiosType

func ToBiosType(bios string) TBiosType

type TBucketACLType

type TBucketACLType string

type TDnsPolicyType

type TDnsPolicyType string

type TDnsPolicyValue

type TDnsPolicyValue string

type TDnsProductType

type TDnsProductType string

type TDnsTTLRangeType

type TDnsTTLRangeType string

type TDnsType

type TDnsType string

type TDnsZoneType

type TDnsZoneType string

type TElasticipChargeType

type TElasticipChargeType string

type TImageType

type TImageType string

type TMetricType

type TMetricType string
const (

	// RDS CPU利用率
	// 支持的平台: huawei, aliyun, apsara, azure, jdcloud, qcloud, aws
	// 仅azure的sqlserver支持group_by = database
	RDS_METRIC_TYPE_CPU_USAGE TMetricType = "rds_cpu.usage_active"
	// RDS 内存利用率
	// 支持平台: huawei, aliyun, apsara, azure, jdcloud, qcloud
	// 仅azure的sqlserver支持group_by = database
	RDS_METRIC_TYPE_MEM_USAGE TMetricType = "rds_mem.used_percent"
	// RDS 网络入流量
	// 支持平台: huawei, aliyun, apsara, azure, aws, jdcloud, qcloud
	// 仅azure的sqlserver支持group_by = database
	RDS_METRIC_TYPE_NET_BPS_RX TMetricType = "rds_netio.bps_recv"
	// RDS 网络出流量
	// 支持平台: huawei, aliyun, apsara, azure, aws, jdcloud, qcloud
	// 仅azure的sqlserver支持group_by = database
	RDS_METRIC_TYPE_NET_BPS_TX TMetricType = "rds_netio.bps_sent"

	// RDS磁盘使用率
	// 支持平台: huawei, aliyun, apsara, azure, jdcloud, qcloud
	// 仅azure的sqlserver支持group_by = database
	RDS_METRIC_TYPE_DISK_USAGE TMetricType = "rds_disk.used_percent"
	// RDS磁盘读取IO
	// 支持平台: huawei
	RDS_METRIC_TYPE_DISK_READ_BPS TMetricType = "rds_diskio.read_bps"
	// RDS磁盘写IO
	// 支持平台: huawei
	RDS_METRIC_TYPE_DISK_WRITE_BPS TMetricType = "rds_diskio.write_bps"
	// ---
	// 支持平台: azure
	RDS_METRIC_TYPE_DISK_IO_PERCENT TMetricType = "rds_diskio.used_percent"

	// RDS 连接数
	// 支持平台: huawei, aws, qcloud
	RDS_METRIC_TYPE_CONN_COUNT TMetricType = "rds_conn.used_count"
	// RDS 活跃连接数
	// 支持平台: azure
	RDS_METRIC_TYPE_CONN_ACTIVE TMetricType = "rds_conn.active_count"
	// 连接数使用率
	// 支持平台: aliyun, apsara, qcloud
	RDS_METRIC_TYPE_CONN_USAGE TMetricType = "rds_conn.used_percent"
	// 支持平台: azure
	// 失败连接数
	RDS_METRIC_TYPE_CONN_FAILED TMetricType = "rds_conn.failed_count"

	METRIC_TAG_DATABASE = "database"

	// RDS QPS
	// 支持平台: huawei, qcloud
	RDS_METRIC_TYPE_QPS TMetricType = "rds_qps.query_qps"
	// RDS TPS
	// 支持平台: huawei, qcloud
	RDS_METRIC_TYPE_TPS TMetricType = "rds_tps.trans_qps"
	// RDS innodb读IO
	// 支持平台: huawei, qcloud
	RDS_METRIC_TYPE_INNODB_READ_BPS TMetricType = "rds_innodb.read_bps"
	// RDS innodb写IO
	// 支持平台 huawei, qcloud
	RDS_METRIC_TYPE_INNODB_WRITE_BPS TMetricType = "rds_innodb.write_bps"

	// 虚拟机CPU使用率
	// 支持平台: kvm, huawei, aliyun, apsara, azure, esxi, google, bingocloud, aws, jdcloud, ecloud, zstack, qcloud
	VM_METRIC_TYPE_CPU_USAGE TMetricType = "vm_cpu.usage_active"
	// 虚拟机内存使用率
	// 支持平台: kvm, aliyun, apsara, azure, esxi, bingocloud, jdcloud, ecloud, qcloud
	VM_METRIC_TYPE_MEM_USAGE TMetricType = "vm_mem.used_percent"
	// 虚拟机磁盘使用率
	// 支持平台: aliyun, apsara, jdcloud, azure
	// 支持按盘符(group_by=device)平台: aliyun, apsara
	VM_METRIC_TYPE_DISK_USAGE TMetricType = "vm_disk.used_percent"

	// 虚拟机磁盘读速率
	// 支持平台: huawei, aliyun, apsara, azure, esxi, google, bingocloud, aws, jdcloud, ecloud, zstack
	VM_METRIC_TYPE_DISK_IO_READ_BPS TMetricType = "vm_diskio.read_bps"
	// 虚拟机磁盘写速率
	// 支持平台: huawei, aliyun, apsara, azure, esxi, google, bingocloud, aws, jdcloud, ecloud, zstack
	VM_METRIC_TYPE_DISK_IO_WRITE_BPS TMetricType = "vm_diskio.write_bps"
	// 虚拟机磁盘读IOPS
	// 支持平台: huawei, aliyun, apsara, azure, google, bingocloud, aws, jdcloud, ecloud, zstack
	VM_METRIC_TYPE_DISK_IO_READ_IOPS TMetricType = "vm_diskio.read_iops"
	// 虚拟机磁盘写IOPS
	// 支持平台: huawei, aliyun, apsara, azure, google, bingocloud, aws, jdcloud, ecloud, zstack
	VM_METRIC_TYPE_DISK_IO_WRITE_IOPS TMetricType = "vm_diskio.write_iops"

	// 虚拟机网络入速率
	// 支持平台: huawei, aliyun, apsara, azure, esxi, google, bingocloud, aws, jdcloud, ecloud, zstack, qcloud
	VM_METRIC_TYPE_NET_BPS_RX TMetricType = "vm_netio.bps_recv"
	// 虚拟机网络出速率
	// 支持平台: huawei, aliyun, apsara, azure, esxi, google, bingocloud, aws, jdcloud, ecloud, zstack, qcloud
	VM_METRIC_TYPE_NET_BPS_TX TMetricType = "vm_netio.bps_sent"

	// 宿主机CPU使用率
	// 支持平台: esxi
	HOST_METRIC_TYPE_CPU_USAGE TMetricType = "cpu.usage_active"
	// 宿主机内存使用率
	// 支持平台: esxi
	HOST_METRIC_TYPE_MEM_USAGE TMetricType = "mem.used_percent"
	// 宿主机磁盘读速率
	// 支持平台: esxi
	HOST_METRIC_TYPE_DISK_IO_READ_BPS TMetricType = "diskio.read_bps"
	// 宿主机磁盘写速率
	// 支持平台: esxi
	HOST_METRIC_TYPE_DISK_IO_WRITE_BPS TMetricType = "diskio.write_bps"
	// 宿主机网络入速率
	// 支持平台: esxi
	HOST_METRIC_TYPE_NET_BPS_RX TMetricType = "net.bps_recv"
	// 宿主机网络出速率
	// 支持平台: esxi
	HOST_METRIC_TYPE_NET_BPS_TX TMetricType = "net.bps_sent"

	// Redis CPU使用率
	// 支持平台: huawei, aliyun, azure, apsara, aws, qcloud
	REDIS_METRIC_TYPE_CPU_USAGE TMetricType = "dcs_cpu.usage_active"
	// Redis 内存使用率
	// 支持平台: huawei, aliyun, azure, apsara, qcloud
	REDIS_METRIC_TYPE_MEM_USAGE TMetricType = "dcs_mem.used_percent"
	// Redis 网络入速率
	// 支持平台: huawei, aliyun, apsara, qcloud
	REDIS_METRIC_TYPE_NET_BPS_RX TMetricType = "dcs_netio.bps_recv"
	// Redis 网络出速率
	// 支持平台: huawei, aliyun, apsara, qcloud
	REDIS_METRIC_TYPE_NET_BPS_TX TMetricType = "dcs_netio.bps_sent"
	// Redis 网络连接数
	// 支持平台: huawei, aliyun, apsara, azure, aws, qcloud
	REDIS_METRIC_TYPE_USED_CONN TMetricType = "dcs_conn.used_conn"
	// 每秒处理指令数
	// 支持平台: huawei, aliyun, apsara, azure, qcloud
	REDIS_METRIC_TYPE_OPT_SES TMetricType = "dcs_instantopt.opt_sec"
	// 命中key数量
	// 支持平台: huawei, aliyun, apsara, azure, qcloud
	REDIS_METRIC_TYPE_CACHE_KEYS TMetricType = "dcs_cachekeys.key_count"
	// Expired Key数量
	// 支持平台: huawei, aliyun, apsara, azure, aws, qcloud
	REDIS_METRIC_TYPE_CACHE_EXP_KEYS TMetricType = "dcs_cachekeys.expire_key_count"
	// 内存使用量
	// 支持平台: huawei, aliyun, azure, apsara, qcloud
	REDIS_METRIC_TYPE_DATA_MEM_USAGE TMetricType = "dcs_datamem.used_byte"

	// 支持平台: azure
	LB_METRIC_TYPE_SNAT_PORT TMetricType = "haproxy.used_snat_port"
	// 支持平台: azure
	LB_METRIC_TYPE_SNAT_CONN_COUNT TMetricType = "haproxy.snat_conn_count"
	// 入速率
	// 支持平台: huawei, aliyun, apsara
	LB_METRIC_TYPE_NET_BPS_RX TMetricType = "haproxy.bin"
	// 出速率
	// 支持平台: huawei, aliyun, apsara
	LB_METRIC_TYPE_NET_BPS_TX TMetricType = "haproxy.bout"
	// 状态码统计
	// 支持平台: huawei, aliyun, apsara
	LB_METRIC_TYPE_HRSP_COUNT TMetricType = "haproxy.hrsp_Nxx"

	// 对象存储出速率
	// 支持平台: huawei, aliyun, apsara
	BUCKET_METRIC_TYPE_NET_BPS_TX TMetricType = "oss_netio.bps_sent"
	// 对象存储入速率
	// 支持平台: huawei, aliyun, apsara
	BUCKET_METRIC_TYPE_NET_BPS_RX TMetricType = "oss_netio.bps_recv"
	// 请求延时
	// 支持平台: huawei, aliyun, apsara
	BUCKET_METRIC_TYPE_LATECY TMetricType = "oss_latency.req_late"
	// 请求数量
	// 支持平台: huawei, aliyun, apsara
	BUCKET_METRYC_TYPE_REQ_COUNT TMetricType = "oss_req.req_count"

	METRIC_TAG_REQUST      = "request"
	METRIC_TAG_REQUST_GET  = "get"
	METRIC_TAG_REQUST_POST = "post"
	METRIC_TAG_REQUST_2XX  = "2xx"
	METRIC_TAG_REQUST_3XX  = "3xx"
	METRIC_TAG_REQUST_4XX  = "4xx"
	METRIC_TAG_REQUST_5XX  = "5xx"

	METRIC_TAG_NET_TYPE          = "net_type"
	METRIC_TAG_NET_TYPE_INTERNET = "internet"
	METRIC_TAG_NET_TYPE_INTRANET = "intranet"

	METRIC_TAG_TYPE_DISK_TYPE     = "disk_type"
	METRIC_TAG_TYPE_DISK_TYPE_EBS = "ebs"

	// 磁盘利用率
	METRIC_TAG_DEVICE = "device"

	METRIC_TAG_NODE = "node"

	// k8s节点CPU使用率
	// 支持平台: aliyun, azure, qcloud
	K8S_NODE_METRIC_TYPE_CPU_USAGE TMetricType = "k8s_node_cpu.usage_active"
	// k8s节点内存使用率
	// 支持平台: aliyun, azure, qcloud
	K8S_NODE_METRIC_TYPE_MEM_USAGE TMetricType = "k8s_node_mem.used_percent"

	K8S_NODE_METRIC_TYPE_DISK_USAGE TMetricType = "k8s_node_disk.used_percent"
	K8S_NODE_METRIC_TYPE_NET_BPS_RX TMetricType = "k8s_node_netio.bps_recv"
	K8S_NODE_METRIC_TYPE_NET_BPS_TX TMetricType = "k8s_node_netio.bps_sent"

	// modelarts专属资源池监控数据
	MODELARTS_POOL_METRIC_TYPE_CPU_USAGE     TMetricType = "modelarts_pool_cpu.usage_percent"
	MODELARTS_POOL_METRIC_TYPE_MEM_USAGE     TMetricType = "modelarts_pool_mem.usage_percent"
	MODELARTS_POOL_METRIC_TYPE_GPU_MEM_USAGE TMetricType = "modelarts_pool_gpu_mem.usage_percent"
	MODELARTS_POOL_METRIC_TYPE_GPU_UTIL      TMetricType = "modelarts_pool_gpu_util.percent"
	MODELARTS_POOL_METRIC_TYPE_NPU_UTIL      TMetricType = "modelarts_pool_npu_util.percent"
	MODELARTS_POOL_METRIC_TYPE_NPU_MEM_USAGE TMetricType = "modelarts_pool_npu_mem.usage_percent"

	//磁盘可用容量
	MODELARTS_POOL_METRIC_TYPE_DISK_AVAILABLE_CAPACITY TMetricType = "modelarts_pool_disk.available_capacity"
	MODELARTS_POOL_METRIC_TYPE_DISK_CAPACITY           TMetricType = "modelarts_pool_disk.capacity"
	MODELARTS_POOL_METRIC_TYPE_DISK_USAGE              TMetricType = "modelarts_pool_disk.usage_percent"
)

func (TMetricType) Key

func (key TMetricType) Key() string

func (TMetricType) Name

func (key TMetricType) Name() string

type TMongoDBBackupMethod

type TMongoDBBackupMethod string

备份方法

type TMongoDBBackupStatus

type TMongoDBBackupStatus string

备份状态

type TMongoDBBackupType

type TMongoDBBackupType string

备份方式

type TOsType

type TOsType string

type TRWAccessType

type TRWAccessType string

type TResourceType

type TResourceType string
const (
	METRIC_RESOURCE_TYPE_RDS            TResourceType = "rds"
	METRIC_RESOURCE_TYPE_SERVER         TResourceType = "server"
	METRIC_RESOURCE_TYPE_HOST           TResourceType = "host"
	METRIC_RESOURCE_TYPE_REDIS          TResourceType = "redis"
	METRIC_RESOURCE_TYPE_LB             TResourceType = "lb"
	METRIC_RESOURCE_TYPE_BUCKET         TResourceType = "bucket"
	METRIC_RESOURCE_TYPE_K8S            TResourceType = "k8s"
	METRIC_RESOURCE_TYPE_STORAGE        TResourceType = "storage"
	METRIC_RESOURCE_TYPE_CLOUD_ACCOUNT  TResourceType = "cloudaccount_balance"
	METRIC_RESOURCE_TYPE_MODELARTS_POOL TResourceType = "modelarts"
)

type TTlRange

type TTlRange struct {
	RangeType   TDnsTTLRangeType
	TTLMinValue int64
	TTLMaxValue int64
	AllowedTTLs []int64 // sorted
}

func (TTlRange) GetSuppportedTTL

func (ttlR TTlRange) GetSuppportedTTL(ttl int64) int64

type TUserAccessType

type TUserAccessType string

type TWafAction

type TWafAction string

type TWafMatchField

type TWafMatchField string

type TWafMatchFieldValues

type TWafMatchFieldValues []string

func (TWafMatchFieldValues) IsZero

func (self TWafMatchFieldValues) IsZero() bool

func (TWafMatchFieldValues) String

func (self TWafMatchFieldValues) String() string

type TWafOperator

type TWafOperator string

type TWafStatementCondition

type TWafStatementCondition string

type TWafStatementType

type TWafStatementType string

type TWafTextTransformation

type TWafTextTransformation string

type TWafType

type TWafType string

type TagsUpdateInfo

type TagsUpdateInfo struct {
	OldTags map[string]string
	NewTags map[string]string
}

func SetBucketTags

func SetBucketTags(ctx context.Context, iBucket ICloudBucket, mangerId string, tags map[string]string) (TagsUpdateInfo, error)

func (TagsUpdateInfo) IsChanged

func (t TagsUpdateInfo) IsChanged() bool

type TextTransformations

type TextTransformations []TWafTextTransformation

func (TextTransformations) IsZero

func (self TextTransformations) IsZero() bool

func (TextTransformations) String

func (self TextTransformations) String() string

type VpcCreateOptions

type VpcCreateOptions struct {
	NAME                string
	CIDR                string
	GlobalVpcExternalId string
	Desc                string
}

type VpcPeeringConnectionCreateOptions

type VpcPeeringConnectionCreateOptions struct {
	Name          string
	Desc          string
	PeerVpcId     string
	PeerAccountId string
	PeerRegionId  string
	Bandwidth     int //qcloud cross region,Mbps
}

type WafAddresses

type WafAddresses []string

+onecloud:model-api-gen

func (WafAddresses) IsZero

func (self WafAddresses) IsZero() bool

func (WafAddresses) String

func (self WafAddresses) String() string

type WafCreateOptions

type WafCreateOptions struct {
	Name           string
	Desc           string
	CloudResources []SCloudResource
	SourceIps      WafSourceIps
	Type           TWafType
	DefaultAction  *DefaultAction
}

type WafRegexPatterns

type WafRegexPatterns []string

+onecloud:model-api-gen

func (WafRegexPatterns) IsZero

func (self WafRegexPatterns) IsZero() bool

func (WafRegexPatterns) String

func (self WafRegexPatterns) String() string

type WafSourceIps

type WafSourceIps []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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