Documentation
¶
Overview ¶
Package common is to include common methods for managing multi-cloud infra
Package common is to include common methods for managing multi-cloud infra ¶
Package common is to include common methods for managing multi-cloud infra ¶
Package common is to include common methods for managing multi-cloud infra ¶
Package common is to include common methods for managing multi-cloud infra
Index ¶
- Constants
- Variables
- func AdjustKeysToLowercase(cloudInfo *CloudInfo)
- func AppendIfMissing(slice []string, i string) []string
- func ChangeIdString(name string) string
- func CheckConfig(id string) (bool, error)
- func CheckConnConfigAvailable(connConfigName string) (bool, error)
- func CheckElement(a string, list []string) bool
- func CheckNs(id string) (bool, error)
- func CheckSpiderReady() error
- func CheckString(name string) error
- func ConvertToMessage(inType string, inData string, obj interface{}) error
- func ConvertToOutput(outType string, obj interface{}) (string, error)
- func CopySrcToDest(src interface{}, dest interface{}) error
- func DelAllNs() error
- func DelNs(id string) error
- func DeleteObject(key string) error
- func DeleteObjects(key string) error
- func EndRequestWithLog(c echo.Context, reqID string, err error, responseData interface{}) error
- func ExecuteHttpRequest[B any, T any](client *resty.Client, method string, url string, headers map[string]string, ...) error
- func ForwardRequestToAny(reqPath string, method string, requestBody interface{}) (interface{}, error)
- func GenChildResourceKey(nsId string, resourceType string, parentResourceId string, resourceId string) string
- func GenConnectionKey(connectionId string) string
- func GenCredentialHolderKey(holderId string) string
- func GenMciKey(nsId string, mciId string, vmId string) string
- func GenMciPolicyKey(nsId string, mciId string, vmId string) string
- func GenMciSubGroupKey(nsId string, mciId string, groupId string) string
- func GenRandomPassword(length int) string
- func GenResourceKey(nsId string, resourceType string, resourceId string) string
- func GenUid() string
- func GenerateNewRandomString(n int) string
- func GetAvailableK8sClusterNodeImage(providerName string, regionName string) (*[]K8sClusterNodeImageDetailAvailable, error)
- func GetAvailableK8sClusterVersion(providerName string, regionName string) (*[]K8sClusterVersionDetailAvailable, error)
- func GetChildIdList(key string) []string
- func GetFuncName() string
- func GetObjectList(key string) []string
- func GetObjectValue(key string) (string, error)
- func InitAllConfig() error
- func InitConfig(id string) error
- func ListConfigId() []string
- func ListNsId() ([]string, error)
- func LookupKeyValueList(kvl []KeyValue, key string) string
- func NVL(str string, def string) string
- func NsValidation() echo.MiddlewareFunc
- func OpenSQL(path string) error
- func PrintCloudInfoTable(cloudInfo CloudInfo)
- func PrintCredentialInfo(credential Credential)
- func PrintJsonPretty(v interface{})
- func RandomSleep(from int, to int)
- func RegisterAllCloudInfo() error
- func RegisterCloudInfo(providerName string) error
- func RegisterRegionZone(providerName string, regionName string) error
- func SelectDatabase(database string) error
- func SetUseBody(requestBody interface{}) bool
- func StartRequestWithLog(c echo.Context) (string, error)
- func ToLower(name string) string
- func UpdateGlobalVariable(id string) error
- func UpdateRequestProgress(reqID string, progressData interface{})
- type CSPDetail
- type CacheItem
- type Cloud
- type CloudDriverInfo
- type CloudInfo
- type CloudSetting
- type ConfigInfo
- type ConfigReq
- type ConnConfig
- type ConnConfigList
- type Credential
- type CredentialInfo
- type CredentialReq
- type IID
- type IdList
- type K8sClusterDetail
- type K8sClusterInfo
- type K8sClusterNodeGroupsOnCreation
- type K8sClusterNodeImageDetail
- type K8sClusterNodeImageDetailAvailable
- type K8sClusterRootDiskDetail
- type K8sClusterRootDiskDetailSize
- type K8sClusterRootDiskDetailType
- type K8sClusterSetting
- type K8sClusterVersionDetail
- type K8sClusterVersionDetailAvailable
- type KeyValue
- type KeyWithEncryptedValue
- type Location
- type NlbSetting
- type Nlbsw
- type NsInfo
- type NsReq
- type OptionalParameter
- type ProgressInfo
- type PublicKeyResponse
- type RegionDetail
- type RegionList
- type RegionZoneInfo
- type RequestDetails
- type RequestInfo
- type RuntimeConfig
- type SimpleMsg
- type SpiderConnConfig
- type SpiderConnectionName
- type SpiderRegionZoneInfo
Constants ¶
const ( // VeryShortDuration is a duration for very short-term cache VeryShortDuration = 1 * time.Second // ShortDuration is a duration for short-term cache ShortDuration = 2 * time.Second // MediumDuration is a duration for medium-term cache MediumDuration = 5 * time.Second // LongDuration is a duration for long-term cache LongDuration = 10 * time.Second )
const ( StrSpiderRestUrl string = "TB_SPIDER_REST_URL" StrDragonflyRestUrl string = "TB_DRAGONFLY_REST_URL" StrTerrariumRestUrl string = "TB_TERRARIUM_REST_URL" StrDBUrl string = "TB_SQLITE_URL" StrDBDatabase string = "TB_SQLITE_DATABASE" StrDBUser string = "TB_SQLITE_USER" StrDBPassword string = "TB_SQLITE_PASSWORD" StrAutocontrolDurationMs string = "TB_AUTOCONTROL_DURATION_MS" StrEtcdEndpoints string = "TB_ETCD_ENDPOINTS" ErrStrKeyNotFound string = "key not found" StrAdd string = "add" StrDelete string = "delete" StrSSHKey string = "sshKey" StrImage string = "image" StrCustomImage string = "customImage" StrSecurityGroup string = "securityGroup" StrSpec string = "spec" StrVNet string = "vNet" StrSubnet string = "subnet" StrDataDisk string = "dataDisk" StrNLB string = "nlb" StrVM string = "vm" StrMCI string = "mci" StrK8s string = "k8s" StrKubernetes string = "kubernetes" StrContainer string = "container" StrCommon string = "common" StrEmpty string = "empty" // SystemCommonNs is const for SystemCommon NameSpace ID SystemCommonNs string = "system" )
const ( AttachDataDisk string = "attach" DetachDataDisk string = "detach" AvailableDataDisk string = "available" )
type DataDiskCmd string
const NoBody = "NOBODY"
NoBody is a constant for empty body
Variables ¶
var AutocontrolDurationMs string
var DBDatabase string
var DBPassword string
var DBUrl string
var DBUser string
var DefaultCredentialHolder string
var DefaultNamespace string
var DragonflyRestUrl string
var EtcdEndpoints string
var MyDB *sql.DB
var ORM *xorm.Engine
var RequestMap = sync.Map{}
RequestMap is a map for request details
var RuntimeCloudInfo = CloudInfo{}
RuntimeCloudInfo is global variable for CloudInfo
var RuntimeConf = RuntimeConfig{}
RuntimeConf is global variable for cloud config
var RuntimeCredential = Credential{}
var RuntimeK8sClusterInfo = K8sClusterInfo{}
RuntimeK8sClusterInfo is global variable for K8sClusterInfo
var RuntimeLatancyMap = [][]string{}
RuntimeLatancyMap is global variable for LatancyMap
var RuntimeLatancyMapIndex = make(map[string]int)
RuntimeLatancyMapIndex is global variable for LatancyMap (index)
var SpiderRestUrl string
var StartTime string
var SystemReady bool
SystemReady is global variable for checking SystemReady status
var TerrariumRestUrl string
Functions ¶
func AdjustKeysToLowercase ¶ added in v0.8.7
func AdjustKeysToLowercase(cloudInfo *CloudInfo)
AdjustKeysToLowercase adjusts the keys of nested maps to lowercase.
func AppendIfMissing ¶ added in v0.3.11
func ChangeIdString ¶ added in v0.5.4
ChangeIdString is func to change strings in id or name (special chars to -, to lower string )
func CheckConfig ¶ added in v0.3.1
func CheckConnConfigAvailable ¶ added in v0.8.8
CheckConnConfigAvailable is func to check if connection config is available by checking allkeypair list
func CheckElement ¶ added in v0.6.4
func CheckSpiderReady ¶ added in v0.8.8
func CheckSpiderReady() error
CheckSpiderStatus is func to check if CB-Spider is ready
func CheckString ¶ added in v0.3.7
CheckString is func to check string by the given rule `[a-z]([-a-z0-9]*[a-z0-9])?`
func ConvertToMessage ¶
ConvertToMessage is func to change input data to gRPC message
func ConvertToOutput ¶
ConvertToOutput is func to convert gRPC message to print format
func CopySrcToDest ¶
func CopySrcToDest(src interface{}, dest interface{}) error
CopySrcToDest is func to copy data from source to target
func DeleteObject ¶ added in v0.3.3
DeleteObject is func to delete the object
func DeleteObjects ¶ added in v0.3.3
DeleteObjects is func to delete objects
func EndRequestWithLog ¶ added in v0.7.13
EndRequestWithLog updates the request details and sends the final response.
func ExecuteHttpRequest ¶ added in v0.7.5
func ExecuteHttpRequest[B any, T any]( client *resty.Client, method string, url string, headers map[string]string, useBody bool, body *B, result *T, cacheDuration time.Duration, ) error
ExecuteHttpRequest performs the HTTP request and fills the result (var requestBody interface{} = nil for empty body)
func ForwardRequestToAny ¶ added in v0.8.1
func ForwardRequestToAny(reqPath string, method string, requestBody interface{}) (interface{}, error)
ForwardRequestToAny forwards the given request to the specified path
func GenChildResourceKey ¶ added in v0.4.10
func GenChildResourceKey(nsId string, resourceType string, parentResourceId string, resourceId string) string
GenChildResourceKey is func to generate a key from resource type and id
func GenConnectionKey ¶ added in v0.8.8
GenConnectionKey is func to generate a key for connection info
func GenCredentialHolderKey ¶ added in v0.8.9
GenCredentialHolderKey is func to generate a key for credentialHolder info
func GenMciPolicyKey ¶ added in v0.9.5
GenMciPolicyKey is func to generate Mci policy key
func GenMciSubGroupKey ¶ added in v0.9.5
GenMciSubGroupKey is func to generate a key from subGroupId used in keyValue store
func GenRandomPassword ¶ added in v0.7.1
GenRandomPassword is func to return a RandomPassword
func GenResourceKey ¶
GenResourceKey is func to generate a key from resource type and id
func GenerateNewRandomString ¶ added in v0.6.7
generate a random string (from CB-MCKS source code)
func GetAvailableK8sClusterNodeImage ¶ added in v0.8.14
func GetAvailableK8sClusterNodeImage(providerName string, regionName string) (*[]K8sClusterNodeImageDetailAvailable, error)
GetAvailableK8sClusterNodeImage is func to get available kubernetes cluster node images for provider and region from K8sClusterInfo
func GetAvailableK8sClusterVersion ¶ added in v0.8.14
func GetAvailableK8sClusterVersion(providerName string, regionName string) (*[]K8sClusterVersionDetailAvailable, error)
GetAvailableK8sClusterVersion is func to get available kubernetes cluster versions for provider and region from K8sClusterInfo
func GetChildIdList ¶
GetChildIdList is func to get child id list from given key
func GetFuncName ¶ added in v0.5.4
func GetFuncName() string
GetFuncName is func to get the name of the running function
func GetObjectList ¶ added in v0.3.3
GetObjectList is func to return IDs of each child objects that has the same key
func GetObjectValue ¶ added in v0.3.3
GetObjectValue is func to return the object value
func InitAllConfig ¶ added in v0.3.9
func InitAllConfig() error
func InitConfig ¶ added in v0.3.9
func ListConfigId ¶
func ListConfigId() []string
func LookupKeyValueList ¶
LookupKeyValueList is func to lookup KeyValue list
func NsValidation ¶
func NsValidation() echo.MiddlewareFunc
func PrintCloudInfoTable ¶ added in v0.8.5
func PrintCloudInfoTable(cloudInfo CloudInfo)
PrintCloudInfoTable prints CloudInfo in table format
func PrintCredentialInfo ¶ added in v0.8.8
func PrintCredentialInfo(credential Credential)
PrintCredentialInfo prints Credential information in table format
func PrintJsonPretty ¶
func PrintJsonPretty(v interface{})
PrintJsonPretty is func to print JSON pretty with indent
func RandomSleep ¶ added in v0.4.10
RandomSleep is func to make a caller waits for during random time seconds (random value within x~y)
func RegisterAllCloudInfo ¶ added in v0.8.8
func RegisterAllCloudInfo() error
RegisterAllCloudInfo is func to register all cloud info from asset to CB-Spider
func RegisterCloudInfo ¶ added in v0.8.8
RegisterCloudInfo is func to register cloud info from asset to CB-Spider
func RegisterRegionZone ¶ added in v0.8.8
RegisterRegionZone is func to register all regions to CB-Spider
func SelectDatabase ¶
func SetUseBody ¶ added in v0.7.6
func SetUseBody(requestBody interface{}) bool
SetUseBody returns false if the given body is NoBody
func StartRequestWithLog ¶ added in v0.7.13
StartRequestWithLog initializes request tracking details
func ToLower ¶ added in v0.3.1
ToLower is func to change strings (_ to -, " " to -, to lower string ) (deprecated soon)
func UpdateGlobalVariable ¶ added in v0.3.9
func UpdateRequestProgress ¶ added in v0.8.13
func UpdateRequestProgress(reqID string, progressData interface{})
UpdateRequestProgress updates the handling status of the request.
Types ¶
type CSPDetail ¶ added in v0.8.5
type CSPDetail struct {
Description string `mapstructure:"description" json:"description"`
Driver string `mapstructure:"driver" json:"driver"`
Links []string `mapstructure:"link" json:"links"`
Regions map[string]RegionDetail `mapstructure:"region" json:"regions"`
}
CSPDetail is structure for CSP information
type Cloud ¶ added in v0.6.6
type Cloud struct {
Common CloudSetting `yaml:"common"`
Aws CloudSetting `yaml:"aws"`
Azure CloudSetting `yaml:"azure"`
Gcp CloudSetting `yaml:"gcp"`
Alibaba CloudSetting `yaml:"alibaba"`
Tencent CloudSetting `yaml:"tencent"`
Ibm CloudSetting `yaml:"ibm"`
Nhncloud CloudSetting `yaml:"nhncloud"`
Openstack CloudSetting `yaml:"openstack"`
Cloudit CloudSetting `yaml:"cloudit"`
}
Cloud is structure for cloud settings per CSP
type CloudDriverInfo ¶ added in v0.8.8
CloudDriverInfo is struct for containing a CB-Spider struct for cloud driver info
type CloudInfo ¶ added in v0.8.5
CloudInfo is structure for cloud information
func GetCloudInfo ¶ added in v0.8.7
GetCloudInfo is func to get all cloud info from the asset
type CloudSetting ¶ added in v0.6.6
type CloudSetting struct {
Enable string `yaml:"enable"`
Nlb NlbSetting `yaml:"nlb"`
K8sCluster K8sClusterSetting `yaml:"k8scluster"`
}
CloudSetting is structure for cloud settings per CSP in details
type ConfigInfo ¶
type ConfigInfo struct {
Id string `json:"id" example:"TB_SPIDER_REST_URL"`
Name string `json:"name" example:"TB_SPIDER_REST_URL"`
Value string `json:"value" example:"http://localhost:1024/spider"`
}
swagger:response ConfigInfo
func GetConfig ¶
func GetConfig(id string) (ConfigInfo, error)
func ListConfig ¶
func ListConfig() ([]ConfigInfo, error)
func UpdateConfig ¶
func UpdateConfig(u *ConfigReq) (ConfigInfo, error)
type ConfigReq ¶
type ConfigReq struct {
Name string `json:"name" example:"TB_SPIDER_REST_URL"`
Value string `json:"value" example:"http://localhost:1024/spider"`
}
swagger:request ConfigReq
type ConnConfig ¶
type ConnConfig struct {
ConfigName string `json:"configName"`
ProviderName string `json:"providerName"`
DriverName string `json:"driverName"`
CredentialName string `json:"credentialName"`
CredentialHolder string `json:"credentialHolder"`
RegionZoneInfoName string `json:"regionZoneInfoName"`
RegionZoneInfo RegionZoneInfo `json:"regionZoneInfo"`
RegionDetail RegionDetail `json:"regionDetail"`
RegionRepresentative bool `json:"regionRepresentative"`
Verified bool `json:"verified"`
}
ConnConfig is struct for containing modified CB-Spider struct for connection config
func GetConnConfig ¶
func GetConnConfig(ConnConfigName string) (ConnConfig, error)
GetConnConfig is func to get connection config
func RegisterConnectionConfig ¶ added in v0.8.8
func RegisterConnectionConfig(connConfig ConnConfig) (ConnConfig, error)
RegisterConnectionConfig is func to register connection config to CB-Spider
type ConnConfigList ¶
type ConnConfigList struct {
Connectionconfig []ConnConfig `json:"connectionconfig"`
}
ConnConfigList is struct for containing a CB-Spider struct for connection config list
func GetConnConfigList ¶
func GetConnConfigList(filterCredentialHolder string, filterVerified bool, filterRegionRepresentative bool) (ConnConfigList, error)
GetConnConfigList is func to list filtered connection configs
type Credential ¶ added in v0.8.8
type CredentialInfo ¶ added in v0.8.8
type CredentialInfo struct {
CredentialName string `json:"credentialName"`
CredentialHolder string `json:"credentialHolder"`
ProviderName string `json:"providerName"`
KeyValueInfoList []KeyValue `json:"keyValueInfoList"`
AllConnections ConnConfigList `json:"allConnections"`
}
CredentialInfo is struct for containing a struct for credential info
func RegisterCredential ¶ added in v0.8.8
func RegisterCredential(req CredentialReq) (CredentialInfo, error)
RegisterCredential is func to register credential and all related connection configs
type CredentialReq ¶ added in v0.8.8
type CredentialReq struct {
// ProviderName specifies the cloud provider associated with the credential (e.g., AWS, GCP).
ProviderName string `json:"providerName" example:"aws"`
// CredentialHolder is the entity or user that holds the credential.
CredentialHolder string `json:"credentialHolder" example:"admin"`
// PublicKeyTokenId is the unique token ID used to retrieve the corresponding private key for decryption.
PublicKeyTokenId string `json:"publicKeyTokenId" example:"cr31av30uphc738d7h0g"`
// EncryptedClientAesKeyByPublicKey is the client temporary AES key encrypted with the RSA public key.
EncryptedClientAesKeyByPublicKey string `` /* 138-byte string literal not displayed */
// CredentialKeyValueList contains key-(encrypted)value pairs that include the sensitive credential data.
CredentialKeyValueList []KeyWithEncryptedValue `json:"credentialKeyValueList"`
}
CredentialReq is struct for containing a struct for credential request @Description CredentialReq contains the necessary information to register a credential. @Description This includes the AES key encrypted with the RSA public key, which is then used to decrypt the AES key on the server side.
type IID ¶
Spider 2020-03-30 https://github.com/cloud-barista/cb-spider/blob/master/cloud-control-manager/cloud-driver/interfaces/resources/IId.go
type IdList ¶ added in v0.3.10
type IdList struct {
IdList []string `json:"output"`
// contains filtered or unexported fields
}
func GetProviderList ¶ added in v0.8.9
GetProviderList is func to list all cloud providers
type K8sClusterDetail ¶ added in v0.8.14
type K8sClusterDetail struct {
NodeGroupsOnCreation bool `mapstructure:"nodeGroupsOnCreation" json:"nodegroups_on_creation"`
Version []K8sClusterVersionDetail `mapstructure:"version" json:"versions"`
NodeImage []K8sClusterNodeImageDetail `mapstructure:"nodeImage" json:"node_images"`
RootDisk []K8sClusterRootDiskDetail `mapstructure:"rootDisk" json:"root_disks"`
}
K8sClusterDetail is structure for kubernetes cluster detail information
type K8sClusterInfo ¶ added in v0.8.14
type K8sClusterInfo struct {
CSPs map[string]K8sClusterDetail `mapstructure:"k8scluster" json:"k8s_cluster"`
}
K8sClusterInfo is structure for kubernetes cluster information
func GetK8sClusterInfo ¶ added in v0.8.14
func GetK8sClusterInfo() (K8sClusterInfo, error)
GetK8sClusterInfo is func to get all kubernetes cluster info from the asset
type K8sClusterNodeGroupsOnCreation ¶ added in v0.9.5
type K8sClusterNodeGroupsOnCreation struct {
Result string `json:"result" example:"true"`
}
func CheckNodeGroupsOnK8sCreation ¶ added in v0.9.5
func CheckNodeGroupsOnK8sCreation(providerName string) (*K8sClusterNodeGroupsOnCreation, error)
CheckNodeGroupsOnK8sCreation is func to check whether nodegroups are required during the k8scluster creation
type K8sClusterNodeImageDetail ¶ added in v0.8.14
type K8sClusterNodeImageDetail struct {
Region []string `mapstructure:"region" json:"region"`
Available []K8sClusterNodeImageDetailAvailable `mapstructure:"available" json:"availables"`
}
K8sClusterNodeImageDetail is structure for kubernetes cluster node image detail information
type K8sClusterNodeImageDetailAvailable ¶ added in v0.8.14
type K8sClusterNodeImageDetailAvailable struct {
Name string `mapstructure:"name" json:"name"`
Id string `mapstructure:"id" json:"id"`
}
K8sClusterNodeImageDetailAvailable is structure for kubernetes cluster node image detail's available information
type K8sClusterRootDiskDetail ¶ added in v0.8.14
type K8sClusterRootDiskDetail struct {
Region []string `mapstructure:"region" json:"region"`
Type []K8sClusterRootDiskDetailType `mapstructure:"type" json:"type"`
Size K8sClusterRootDiskDetailSize `mapstructure:"size" json:"size"`
}
K8sClusterRootDiskDetail is structure for kubernetes cluster root disk detail information
type K8sClusterRootDiskDetailSize ¶ added in v0.8.14
type K8sClusterRootDiskDetailSize struct {
Min uint `mapstructure:"min" json:"min"`
Max uint `mapstructure:"max" json:"max"`
}
K8sClusterRootDiskDetailSize is structure for kubernetes cluster root disk detail's size information
type K8sClusterRootDiskDetailType ¶ added in v0.8.14
type K8sClusterRootDiskDetailType struct {
Name string `mapstructure:"name" json:"name"`
Id string `mapstructure:"id" json:"id"`
}
K8sClusterRootDiskDetailType is structure for kubernetes cluster root disk detail's type information
type K8sClusterSetting ¶ added in v0.8.15
type K8sClusterSetting struct {
Enable string `yaml:"enable"`
}
K8sClusterSetting is structure for K8sCluster setting
type K8sClusterVersionDetail ¶ added in v0.8.14
type K8sClusterVersionDetail struct {
Region []string `mapstructure:"region" json:"region"`
Available []K8sClusterVersionDetailAvailable `mapstructure:"available" json:"availables"`
}
K8sClusterVersionDetail is structure for kubernetes cluster version detail information
type K8sClusterVersionDetailAvailable ¶ added in v0.8.14
type K8sClusterVersionDetailAvailable struct {
Name string `mapstructure:"name" json:"name" example:"1.30"`
Id string `mapstructure:"id" json:"id" example:"1.30.1-aliyun.1"`
}
K8sClusterVersionDetailAvailable is structure for kubernetes cluster version detail's available information
type KeyWithEncryptedValue ¶ added in v0.9.7
type KeyWithEncryptedValue struct {
// Key for the value
Key string `json:"key"`
// Should be encrypted by the public key issued by GET /credential/publicKey
Value string `json:"value"`
}
KeyWithEncryptedValue is struct for key-(encrypted)value pair
type Location ¶ added in v0.8.5
type Location struct {
Display string `mapstructure:"display" json:"display"`
Latitude float64 `mapstructure:"latitude" json:"latitude"`
Longitude float64 `mapstructure:"longitude" json:"longitude"`
}
Location is structure for location information
type NlbSetting ¶ added in v0.6.6
type NlbSetting struct {
Enable string `yaml:"enable"`
Interval string `yaml:"interval"`
Timeout string `yaml:"timeout"`
Threshold string `yaml:"threshold"`
}
NlbSetting is structure for NLB setting
type Nlbsw ¶ added in v0.6.12
type Nlbsw struct {
Sw string `yaml:"sw"`
Version string `yaml:"version"`
CommandNlbPrepare string `yaml:"commandNlbPrepare"`
CommandNlbDeploy string `yaml:"commandNlbDeploy"`
CommandNlbAddTargetNode string `yaml:"commandNlbAddTargetNode"`
CommandNlbApplyConfig string `yaml:"commandNlbApplyConfig"`
NlbMciCommonSpec string `yaml:"nlbMciCommonSpec"`
NlbMciCommonImage string `yaml:"nlbMciCommonImage"`
NlbMciSubGroupSize string `yaml:"nlbMciSubGroupSize"`
}
Nlbsw is structure for NLB setting
type NsInfo ¶
type NsInfo struct {
Id string `json:"id" example:"default"`
Name string `json:"name" example:"default"`
Description string `json:"description" example:"Description for this namespace"`
}
swagger:response NsInfo
type OptionalParameter ¶ added in v0.7.9
OptionalParameter is struct for optional parameter for function (ex. VmId)
type ProgressInfo ¶ added in v0.8.13
type ProgressInfo struct {
Title string `json:"title"`
Info interface{} `json:"info"`
Time time.Time `json:"time"`
}
ProgressInfo contains the progress information of a request.
type PublicKeyResponse ¶ added in v0.9.7
type PublicKeyResponse struct {
PublicKeyTokenId string `json:"publicKeyTokenId"`
PublicKey string `json:"publicKey"`
}
PublicKeyResponse is struct for containing the public key response
func GetPublicKeyForCredentialEncryption ¶ added in v0.9.7
func GetPublicKeyForCredentialEncryption() (PublicKeyResponse, error)
GetPublicKeyForCredentialEncryption generates an RSA key pair, stores the private key in memory, and returns the public key along with its token ID.
type RegionDetail ¶ added in v0.8.5
type RegionDetail struct {
RegionId string `mapstructure:"id" json:"regionId"`
RegionName string `mapstructure:"regionName" json:"regionName"`
Description string `mapstructure:"description" json:"description"`
Location Location `mapstructure:"location" json:"location"`
Zones []string `mapstructure:"zone" json:"zones"`
}
RegionDetail is structure for region information
func GetRegion ¶
func GetRegion(ProviderName, RegionName string) (RegionDetail, error)
GetRegion is func to get regionInfo with the native region name
type RegionList ¶
type RegionList struct {
Region []SpiderRegionZoneInfo `json:"region"`
}
RegionList is array struct for Region
func GetRegionList ¶
func GetRegionList() (RegionList, error)
GetRegionList is func to retrieve region list
type RegionZoneInfo ¶ added in v0.8.8
type RegionZoneInfo struct {
AssignedRegion string `json:"assignedRegion"`
AssignedZone string `json:"assignedZone"`
}
RegionZoneInfo is struct for containing region struct
type RequestDetails ¶ added in v0.7.13
type RequestDetails struct {
StartTime time.Time `json:"startTime"` // The time when the request was received by the server.
EndTime time.Time `json:"endTime"` // The time when the request was fully processed.
Status string `json:"status"` // The current status of the request (e.g., "Handling", "Error", "Success").
RequestInfo RequestInfo `json:"requestInfo"` // Extracted information about the request.
ResponseData interface{} `json:"responseData"` // The data sent back in response to the request.
ErrorResponse string `json:"errorResponse"` // A message describing any error that occurred during request processing.
}
RequestDetails contains detailed information about an HTTP request and its processing status.
type RequestInfo ¶ added in v0.7.13
type RequestInfo struct {
Method string `json:"method"` // HTTP method (GET, POST, etc.), indicating the request's action type.
URL string `json:"url"` // The URL the request is made to.
Header map[string]string `json:"header"` // Key-value pairs of the request headers.
Body interface{} `json:"body,omitempty"` // Optional: request body
}
RequestInfo stores the essential details of an HTTP request.
func ExtractRequestInfo ¶ added in v0.7.13
func ExtractRequestInfo(r *http.Request) RequestInfo
ExtractRequestInfo extracts necessary information from http.Request
type RuntimeConfig ¶ added in v0.6.6
RuntimeConfig is structure for global variable for cloud config
type SimpleMsg ¶
type SimpleMsg struct {
Message string `json:"message" example:"Any message"`
}
SimpleMsg is struct for JSON Simple message
type SpiderConnConfig ¶ added in v0.8.8
type SpiderConnConfig struct {
ConfigName string
ProviderName string
DriverName string
CredentialName string
RegionName string
}
SpiderConnConfig is struct for containing a CB-Spider struct for connection config
type SpiderConnectionName ¶ added in v0.3.7
type SpiderConnectionName struct {
ConnectionName string `json:"ConnectionName"`
}
type SpiderRegionZoneInfo ¶ added in v0.8.8
type SpiderRegionZoneInfo struct {
RegionName string // ex) "region01"
ProviderName string // ex) "GCP"
KeyValueInfoList []KeyValue // ex) { {region, us-east1}, {zone, us-east1-c} }
AvailableZoneList []string
}
SpiderRegionZoneInfo is struct for containing region struct of CB-Spider