Documentation ¶
Index ¶
- Constants
- Variables
- func CURLPerform(method string, url string, body map[string]interface{}, strBody string, ...) (*simplejson.Json, error)
- func CURLPostFormData(url, contentType string, body *bytes.Buffer, opts ...HTTPOption) (*simplejson.Json, error)
- func CURLResponseRawJson(method string, url string, opts ...HTTPOption) (*simplejson.Json, error)
- func ConvertControllerAddrToPodIP(controllerIP string, controllerPort uint32) (string, error)
- func GetByFilter(url string, body, filters map[string]interface{}, opts ...HTTPOption) (*simplejson.Json, error)
- func GetDefaultRouteIP() string
- func GetORGID(cmd *cobra.Command) int
- func GetTimeout(cmd *cobra.Command) time.Duration
- func GetURLInfo(cmd *cobra.Command, urlPath string, opts ...HTTPOption)
- func IsChineseChar(str string) bool
- func JsonFormat(jsonByte []byte) (string, error)
- func PrettyPrint(data interface{})
- type DomainEnabled
- type DomainState
- type DomainType
- type Filter
- type HTTPConf
- type HTTPOption
- type PluginType
- type PluginUser
- type Server
- type VtapException
- type VtapState
- type VtapTapMode
- type VtapType
Constants ¶
View Source
const ( SUCCESS = "SUCCESS" DEFAULT_ENCRYPTION_PASSWORD = "******" )
Variables ¶
View Source
var (
DefaultTimeout = time.Duration(time.Second * 30)
)
View Source
var DomainTypes []DomainType = []DomainType{ DOMAIN_TYPE_OPENSTACK, DOMAIN_TYPE_VSPHERE, DOMAIN_TYPE_TENCENT, DOMAIN_TYPE_FILEREADER, DOMAIN_TYPE_AWS, DOMAIN_TYPE_ALIYUN, DOMAIN_TYPE_HUAWEI_PRIVATE, DOMAIN_TYPE_KUBERNETES, DOMAIN_TYPE_SIMULATION, DOMAIN_TYPE_HUAWEI, DOMAIN_TYPE_QINGCLOUD, DOMAIN_TYPE_QINGCLOUD_PRIVATE, DOMAIN_TYPE_AZURE, DOMAIN_TYPE_APSARA_STACK, DOMAIN_TYPE_TENCENT_TCE, DOMAIN_TYPE_AGENT_SYNC, DOMAIN_TYPE_MICROSOFT_ACS, DOMAIN_TYPE_BAIDU_BCE, DOMAIN_TYPE_ESHORE, DOMAIN_TYPE_CLOUD_TOWER, DOMAIN_TYPE_NFVO, DOMAIN_TYPE_SUGON, DOMAIN_TYPE_VOLCENGINE, DOMAIN_TYPE_H3C, }
View Source
var RESOURCE_TYPES = []string{
"SubDomains", "Regions", "AZs", "Hosts", "VMs", "VPCs", "Networks", "Subnets", "VRouters",
"RoutingTables", "DHCPPorts", "SecurityGroups", "SecurityGroupRules", "VMSecurityGroups",
"NATGateways", "NATRules", "NATVMConnections", "LBs", "LBListeners", "LBTargetServers",
"LBVMConnections", "PeerConnections", "CENs", "RedisInstances", "RDSInstances", "VInterfaces",
"IPs", "FloatingIPs", "PodClusters", "PodNodes", "VMPodNodeConnections", "PodNamespaces",
"PodGroups", "PodReplicaSets", "Pods", "PodServices", "PodServicePorts", "PodGroupPorts",
"PodIngresses", "PodIngressRules", "PodIngressRuleBackends", "Processes", "PrometheusTargets", "VIPs",
}
View Source
var VtapTapModes []VtapTapMode = []VtapTapMode{ VTAP_TAP_MODE_LOCAL, VTAP_TAP_MODE_MIRROR, VTAP_TAP_MODE_DEDICATED, }
Functions ¶
func CURLPerform ¶
func CURLPerform(method string, url string, body map[string]interface{}, strBody string, opts ...HTTPOption) (*simplejson.Json, error)
功能:调用其他模块API并获取返回结果
func CURLPostFormData ¶
func CURLPostFormData(url, contentType string, body *bytes.Buffer, opts ...HTTPOption) (*simplejson.Json, error)
func CURLResponseRawJson ¶
func CURLResponseRawJson(method string, url string, opts ...HTTPOption) (*simplejson.Json, error)
func GetByFilter ¶
func GetByFilter(url string, body, filters map[string]interface{}, opts ...HTTPOption) (*simplejson.Json, error)
GetByFilter 通过 Get 方法获取数据,自动拼接 url param 参数
func GetDefaultRouteIP ¶
func GetDefaultRouteIP() string
func GetURLInfo ¶
func GetURLInfo(cmd *cobra.Command, urlPath string, opts ...HTTPOption)
func IsChineseChar ¶
func JsonFormat ¶
func PrettyPrint ¶
func PrettyPrint(data interface{})
Types ¶
type DomainEnabled ¶
type DomainEnabled int
const ( // attention: following line comments are used by `stringer` DOMAIN_ENABLED_DISABLE DomainEnabled = iota DOMAIN_ENABLED_ENABLE )
type DomainState ¶
type DomainState int
const ( // attention: following line comments are used by `stringer` DOMAIN_STATE_NORMAL DomainState = iota + 1 DOMAIN_STATE_EXCEPTION DOMAIN_STATE_WARN )
type DomainType ¶
type DomainType int
const ( // attention: following line comments are used by `stringer` DOMAIN_TYPE_UNKNOWN DomainType = -1 DOMAIN_TYPE_OPENSTACK DomainType = 1 // openstack DOMAIN_TYPE_VSPHERE DomainType = 2 // vsphere DOMAIN_TYPE_TENCENT DomainType = 4 // tencent DOMAIN_TYPE_FILEREADER DomainType = 5 // filereader DOMAIN_TYPE_AWS DomainType = 6 // aws DOMAIN_TYPE_ALIYUN DomainType = 9 // aliyun DOMAIN_TYPE_HUAWEI_PRIVATE DomainType = 10 // huawei_private DOMAIN_TYPE_KUBERNETES DomainType = 11 // kubernetes DOMAIN_TYPE_SIMULATION DomainType = 12 // simulation DOMAIN_TYPE_HUAWEI DomainType = 13 // huawei DOMAIN_TYPE_QINGCLOUD DomainType = 14 // qingcloud DOMAIN_TYPE_QINGCLOUD_PRIVATE DomainType = 15 // qingcloud_private DOMAIN_TYPE_AZURE DomainType = 18 // azure DOMAIN_TYPE_APSARA_STACK DomainType = 19 // apsara_stack DOMAIN_TYPE_TENCENT_TCE DomainType = 20 // tencent_tce DOMAIN_TYPE_AGENT_SYNC DomainType = 23 // agent_sync DOMAIN_TYPE_MICROSOFT_ACS DomainType = 24 // microsoft_acs DOMAIN_TYPE_BAIDU_BCE DomainType = 25 // baidu_bce DOMAIN_TYPE_ESHORE DomainType = 26 // eshore DOMAIN_TYPE_CLOUD_TOWER DomainType = 27 // cloudtower DOMAIN_TYPE_NFVO DomainType = 28 // nfvo DOMAIN_TYPE_SUGON DomainType = 29 // sugon DOMAIN_TYPE_VOLCENGINE DomainType = 30 // volcengine DOMAIN_TYPE_H3C DomainType = 31 // h3c )
func GetDomainTypeByName ¶
func GetDomainTypeByName(domainTypeName string) DomainType
type HTTPOption ¶
type HTTPOption func(*HTTPConf)
func WithORGID ¶
func WithORGID(orgID int) HTTPOption
func WithTimeout ¶
func WithTimeout(t time.Duration) HTTPOption
type PluginType ¶
type PluginType int
const ( // attention: following line comments are used by `stringer` PLUGIN_TYPE_WASM PluginType = 1 + iota PLUGIN_TYPE_SO PLUGIN_TYPE_LUA )
type PluginUser ¶
type PluginUser int
const ( // attention: following line comments are used by `stringer` PLUGIN_USER_AGENT PluginUser = 1 + iota PLUGIN_USER_SERVER )
type Server ¶
func GetServerInfo ¶
type VtapException ¶
type VtapException uint64
const ( // attention: following line comments are used by `stringer` VTAP_EXCEPTION_LICENSE_NOT_ENGOUTH VtapException = 0x10000000 VTAP_EXCEPTION_ALLOC_ANALYZER_FAILED VtapException = 0x40000000 VTAP_EXCEPTION_ALLOC_CONTROLLER_FAILED VtapException = 0x80000000 )
need synchronized update with the server
type VtapTapMode ¶
type VtapTapMode int
const ( // attention: following line comments are used by `stringer` VTAP_TAP_MODE_LOCAL VtapTapMode = iota // local VTAP_TAP_MODE_MIRROR //mirror VTAP_TAP_MODE_DEDICATED // dedicated )
func GetVtapTapModeByName ¶
func GetVtapTapModeByName(tapModeName string) VtapTapMode
type VtapType ¶
type VtapType int
const ( // attention: following line comments are used by `stringer` VTAP_TYPE_KVM VtapType = 1 + iota VTAP_TYPE_ESXI VTAP_TYPE_WORKLOAD_V // CHOST_VM VTAP_TYPE_WORKLOAD_P // CHOST_BM VTAP_TYPE_DEDICATED VTAP_TYPE_POD_HOST // K8S_BM VTAP_TYPE_POD_VM // K8S_VM VTAP_TYPE_TUNNEL_DECAPSULATION // TUN_DECAP VTAP_TYPE_HYPER_V VTAP_TYPE_K8S_SIDECAR )
Directories ¶
Path | Synopsis |
---|---|
Package printutil for output styling.
|
Package printutil for output styling. |
Click to show internal directories.
Click to hide internal directories.