model

package
v0.9.14 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Overview

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Package model is to handle object of CB-Tumblebug

Index

Constants

View Source
const (
	StrManager               string = "cb-tumblebug"
	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"
	StrSubGroup              string = "subGroup"
	StrK8s                   string = "k8s"
	StrKubernetes            string = "kubernetes"
	StrContainer             string = "container"
	StrNamespace             string = "ns"
	StrCommon                string = "common"
	StrEmpty                 string = "empty"
	StrSharedResourceName    string = "-shared-"

	// SystemCommonNs is const for SystemCommon NameSpace ID
	SystemCommonNs string = "system"
)
View Source
const (
	AttachDataDisk    string = "attach"
	DetachDataDisk    string = "detach"
	AvailableDataDisk string = "available"
)

type DataDiskCmd string

View Source
const (
	LabelManager         string = "sys.manager"
	LabelNamespace       string = "sys.namespace"
	LabelLabelType       string = "sys.labelType"
	LabelId              string = "sys.id"
	LabelName            string = "sys.name"
	LabelUid             string = "sys.uid"
	LabelCspResourceId   string = "sys.cspResourceId"
	LabelCspResourceName string = "sys.cspResourceName"
	LabelMciId           string = "sys.mciId"
	LabelMciName         string = "sys.mciName"
	LabelMciUid          string = "sys.mciUid"
	LabelMciDescription  string = "sys.mciDescription"
	LabelSubGroupId      string = "sys.subGroupId"
	LabelCreatedTime     string = "sys.createdTime"
	LabelConnectionName  string = "sys.connectionName"
	LabelDescription     string = "sys.description"
	LabelRegistered      string = "sys.registered"
	LabelPurpose         string = "sys.purpose"
	LabelDeploymentType  string = "sys.deploymentType"
	LabelDiskType        string = "sys.diskType"
	LabelDiskSize        string = "sys.diskSize"
	LabelVersion         string = "sys.version"
	LabelVNetId          string = "sys.vNetId"
	LabelIpv4_CIDR       string = "sys.ipv4_CIDR"
	LabelZone            string = "sys.zone"
	LabelStatus          string = "sys.status"
	LabelCspVNetId       string = "sys.cspVNetId"
	LabelCspVNetName     string = "sys.cspVNetName"
	LabelCidr            string = "sys.cidr"
)
View Source
const (
	// ActionCreate is const for Create
	ActionCreate string = "Create"

	// ActionTerminate is const for Terminate
	ActionTerminate string = "Terminate"

	// ActionSuspend is const for Suspend
	ActionSuspend string = "Suspend"

	// ActionResume is const for Resume
	ActionResume string = "Resume"

	// ActionReboot is const for Reboot
	ActionReboot string = "Reboot"

	// ActionRefine is const for Refine
	ActionRefine string = "Refine"

	// ActionComplete is const for Complete
	ActionComplete string = "None"
)
View Source
const (
	// StatusRunning is const for Running
	StatusRunning string = "Running"

	// StatusSuspended is const for Suspended
	StatusSuspended string = "Suspended"

	// StatusFailed is const for Failed
	StatusFailed string = "Failed"

	// StatusTerminated is const for Terminated
	StatusTerminated string = "Terminated"

	// StatusCreating is const for Creating
	StatusCreating string = "Creating"

	// StatusSuspending is const for Suspending
	StatusSuspending string = "Suspending"

	// StatusResuming is const for Resuming
	StatusResuming string = "Resuming"

	// StatusRebooting is const for Rebooting
	StatusRebooting string = "Rebooting"

	// StatusTerminating is const for Terminating
	StatusTerminating string = "Terminating"

	// StatusUndefined is const for Undefined
	StatusUndefined string = "Undefined"

	// StatusComplete is const for Complete
	StatusComplete string = "None"
)
View Source
const (
	// AutoStatusReady is const for "Ready" status.
	AutoStatusReady string = "Ready"

	// AutoStatusChecking is const for "Checking" status.
	AutoStatusChecking string = "Checking"

	// AutoStatusDetected is const for "Detected" status.
	AutoStatusDetected string = "Detected"

	// AutoStatusOperating is const for "Operating" status.
	AutoStatusOperating string = "Operating"

	// AutoStatusStabilizing is const for "Stabilizing" status.
	AutoStatusStabilizing string = "Stabilizing"

	// AutoStatusTimeout is const for "Timeout" status.
	AutoStatusTimeout string = "Timeout"

	// AutoStatusError is const for "Failed" status.
	AutoStatusError string = "Failed"

	// AutoStatusSuspended is const for "Suspended" status.
	AutoStatusSuspended string = "Suspended"
)

Status for mci automation

View Source
const (
	// AutoActionScaleOut is const for "ScaleOut" action.
	AutoActionScaleOut string = "ScaleOut"

	// AutoActionScaleIn is const for "ScaleIn" action.
	AutoActionScaleIn string = "ScaleIn"
)

Action for mci automation

View Source
const (
	MonMetricAll     string = "all"
	MonMetricCpu     string = "cpu"
	MonMetricCpufreq string = "cpufreq"
	MonMetricMem     string = "mem"
	MonMetricNet     string = "net"
	MonMetricSwap    string = "swap"
	MonMetricDisk    string = "disk"
	MonMetricDiskio  string = "diskio"
)
View Source
const DefaultSystemLabel string = "Managed by CB-Tumblebug"

DefaultSystemLabel is const for string to specify the Default System Label

View Source
const MilkywayPort string = ":1324/milkyway/"

MilkywayPort is const for MilkywayPort

View Source
const StrAutoGen string = "autogen"

Variables

View Source
var AutocontrolDurationMs string
View Source
var DBDatabase string
View Source
var DBPassword string
View Source
var DBUrl string
View Source
var DBUser string
View Source
var DefaultCredentialHolder string
View Source
var DefaultNamespace string
View Source
var DragonflyRestUrl string
View Source
var EtcdEndpoints string
View Source
var MyDB *sql.DB
View Source
var ResourceTypeRegistry = map[string]func() interface{}{
	StrSSHKey:        func() interface{} { return &TbSshKeyInfo{} },
	StrImage:         func() interface{} { return &TbImageInfo{} },
	StrCustomImage:   func() interface{} { return &TbCustomImageInfo{} },
	StrSecurityGroup: func() interface{} { return &TbSecurityGroupInfo{} },
	StrSpec:          func() interface{} { return &TbSpecInfo{} },
	StrVNet:          func() interface{} { return &TbVNetInfo{} },
	StrSubnet:        func() interface{} { return &TbSubnetInfo{} },
	StrDataDisk:      func() interface{} { return &TbDataDiskInfo{} },
	StrNLB:           func() interface{} { return &TbNLBInfo{} },
	StrVM:            func() interface{} { return &TbVmInfo{} },
	StrMCI:           func() interface{} { return &TbMciInfo{} },
	StrK8s:           func() interface{} { return &TbK8sClusterInfo{} },
	StrNamespace:     func() interface{} { return &NsInfo{} },
}

ResourceTypeRegistry is map for Resource type

View Source
var SelfEndpoint string
View Source
var SpiderRestUrl string
View Source
var SshDefaultUserName = []string{"cb-user", "ubuntu", "root", "ec2-user"}

SshDefaultUserName is array for temporal constants

View Source
var StartTime string
View Source
var SystemReady bool

SystemReady is global variable for checking SystemReady status

View Source
var TerrariumRestUrl string

Functions

func GetLabelConstantsMap added in v0.9.12

func GetLabelConstantsMap() map[string]string

GetLabelConstantsMap returns a map with label-related system constants as keys and their example values.

func GetLabelTypes added in v0.9.12

func GetLabelTypes() []string

GetLabelTypes returns a list of label types.

Types

type AgentInstallContent

type AgentInstallContent struct {
	MciId  string `json:"mciId"`
	VmId   string `json:"vmId"`
	VmIp   string `json:"vmIp"`
	Result string `json:"result"`
}

AgentInstallContent ...

type AgentInstallContentWrapper

type AgentInstallContentWrapper struct {
	ResultArray []AgentInstallContent `json:"resultArray"`
}

AgentInstallContentWrapper ...

type AutoAction

type AutoAction struct {
	ActionType   string         `json:"actionType" example:"ScaleOut" enums:"ScaleOut,ScaleIn"`
	VmDynamicReq TbVmDynamicReq `json:"vmDynamicReq"`

	// PostCommand is field for providing command to VMs after its creation. example:"wget https://raw.githubusercontent.com/cloud-barista/cb-tumblebug/main/scripts/setweb.sh -O ~/setweb.sh; chmod +x ~/setweb.sh; sudo ~/setweb.sh"
	PostCommand   MciCmdReq `json:"postCommand"`
	PlacementAlgo string    `json:"placementAlgo" example:"random"`
}

AutoAction is struct for MCI auto-control action.

type AutoCondition

type AutoCondition struct {
	Metric           string   `json:"metric" example:"cpu"`
	Operator         string   `json:"operator" example:">=" enums:"<,<=,>,>="`
	Operand          string   `json:"operand" example:"80"`
	EvaluationPeriod string   `json:"evaluationPeriod" example:"10"`
	EvaluationValue  []string `json:"evaluationValue"`
}

AutoCondition is struct for MCI auto-control condition.

type BastionInfo

type BastionInfo struct {
	VmId []string `json:"vmId"`
}

BastionInfo is struct for bastion info

type BastionNode

type BastionNode struct {
	MciId string `json:"mciId"`
	VmId  string `json:"vmId"`
}

BastionNode is a struct that represents TB BastionNode object.

type BenchmarkInfo

type BenchmarkInfo struct {
	Result      string          `json:"result"`
	Unit        string          `json:"unit"`
	Desc        string          `json:"desc"`
	Elapsed     string          `json:"elapsed"`
	SpecId      string          `json:"specid"`
	RegionName  string          `json:"regionName"`
	ResultArray []BenchmarkInfo `json:"resultarray"` // struct-element cycle ?
}

BenchmarkInfo is struct for BenchmarkInfo

type BenchmarkInfoArray

type BenchmarkInfoArray struct {
	ResultArray []BenchmarkInfo `json:"resultarray"`
}

BenchmarkInfoArray is struct for BenchmarkInfoArray

type BenchmarkReq

type BenchmarkReq struct {
	Host string `json:"host"`
	Spec string `json:"spec"`
}

BenchmarkReq is struct for BenchmarkReq

type CSPDetail

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 CheckMciDynamicReqInfo

type CheckMciDynamicReqInfo struct {
	ReqCheck []CheckVmDynamicReqInfo `json:"reqCheck" validate:"required"`
}

CheckMciDynamicReqInfo is struct to check requirements to create a new MCI instance dynamically (with default resource option)

type CheckVmDynamicReqInfo

type CheckVmDynamicReqInfo struct {

	// ConnectionConfigCandidates will provide ConnectionConfig options
	ConnectionConfigCandidates []string `json:"connectionConfigCandidates" default:""`

	Spec   TbSpecInfo    `json:"spec" default:""`
	Image  []TbImageInfo `json:"image" default:""`
	Region RegionDetail  `json:"region" default:""`

	// Latest system message such as error message
	SystemMessage string `json:"systemMessage" example:"Failed because ..." default:""` // systeam-given string message

}

CheckVmDynamicReqInfo is struct to check requirements to create a new server instance dynamically (with default resource option)

type Cloud

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

type CloudDriverInfo struct {
	DriverName        string
	ProviderName      string
	DriverLibFileName string
}

CloudDriverInfo is struct for containing a CB-Spider struct for cloud driver info

type CloudInfo

type CloudInfo struct {
	CSPs map[string]CSPDetail `mapstructure:"cloud" json:"csps"`
}

CloudInfo is structure for cloud information

type CloudSetting

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

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

type ConnConfigList

type ConnConfigList struct {
	Connectionconfig []ConnConfig `json:"connectionconfig"`
}

ConnConfigList is struct for containing a CB-Spider struct for connection config list

type ControlVmResult

type ControlVmResult struct {
	VmId   string `json:"vmId"`
	Status string `json:"Status"`
	Error  error  `json:"Error"`
}

ControlVmResult is struct for result of VM control

type ControlVmResultWrapper

type ControlVmResultWrapper struct {
	ResultArray []ControlVmResult `json:"resultarray"`
}

ControlVmResultWrapper is struct for array of results of VM control

type Credential

type Credential struct {
	Credentialholder map[string]map[string]map[string]string `yaml:"credentialholder"`
}

type CredentialInfo

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

type CredentialReq

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 CspRegion added in v0.9.10

type CspRegion struct {
	ConnectionName string       `json:"connectionName"`
	NeededVNets    []NeededVNet `json:"neededVNets"`
}

type CustomImageStatus

type CustomImageStatus string
const (
	MyImageAvailable   CustomImageStatus = "Available"
	MyImageUnavailable CustomImageStatus = "Unavailable"
)

type DeploymentPlan

type DeploymentPlan struct {
	Filter   FilterInfo   `json:"filter"`
	Priority PriorityInfo `json:"priority"`
	Limit    string       `json:"limit" example:"5" enums:"1,2,30"`
}

DeploymentPlan is struct for .

type DfAgentInstallReq

type DfAgentInstallReq struct {
	NsId        string `json:"ns_id"`
	MciId       string `json:"mci_id"`
	VmId        string `json:"vm_id"`
	PublicIp    string `json:"public_ip"`
	UserName    string `json:"user_name"`
	SshKey      string `json:"ssh_key"`
	CspType     string `json:"cspType"`
	ServiceType string `json:"service_type"`
	Port        string `json:"port"`
}

DfAgentInstallReq is struct for CB-Dragonfly monitoring agent installation request

type DiskStatus

type DiskStatus string
const (
	DiskCreating  DiskStatus = "Creating"
	DiskAvailable DiskStatus = "Available"
	DiskAttached  DiskStatus = "Attached"
	DiskDeleting  DiskStatus = "Deleting"
	DiskError     DiskStatus = "Error"
)

type FilterCondition

type FilterCondition struct {
	Metric    string      `json:"metric" example:"vCPU" enums:"vCPU,memoryGiB,costPerHour"`
	Condition []Operation `json:"condition"`
}

FilterCondition is struct for .

type FilterInfo

type FilterInfo struct {
	Policy []FilterCondition `json:"policy"`
}

FilterInfo is struct for .

type FilterSpecsByRangeRequest

type FilterSpecsByRangeRequest struct {
	Id                  string `json:"id"`
	Name                string `json:"name"`
	ConnectionName      string `json:"connectionName"`
	ProviderName        string `json:"providerName"`
	RegionName          string `json:"regionName"`
	CspSpecName         string `json:"cspSpecName"`
	InfraType           string `json:"infraType"`
	OsType              string `json:"osType"`
	VCPU                Range  `json:"vCPU"`
	MemoryGiB           Range  `json:"memoryGiB"`
	StorageGiB          Range  `json:"storageGiB"`
	MaxTotalStorageTiB  Range  `json:"maxTotalStorageTiB"`
	NetBwGbps           Range  `json:"netBwGbps"`
	AcceleratorModel    string `json:"acceleratorModel"`
	AcceleratorCount    Range  `json:"acceleratorCount"`
	AcceleratorMemoryGB Range  `json:"acceleratorMemoryGB"`
	AcceleratorType     string `json:"acceleratorType"`
	CostPerHour         Range  `json:"costPerHour"`
	Description         string `json:"description"`
	EvaluationStatus    string `json:"evaluationStatus"`
	EvaluationScore01   Range  `json:"evaluationScore01"`
	EvaluationScore02   Range  `json:"evaluationScore02"`
	EvaluationScore03   Range  `json:"evaluationScore03"`
	EvaluationScore04   Range  `json:"evaluationScore04"`
	EvaluationScore05   Range  `json:"evaluationScore05"`
	EvaluationScore06   Range  `json:"evaluationScore06"`
	EvaluationScore07   Range  `json:"evaluationScore07"`
	EvaluationScore08   Range  `json:"evaluationScore08"`
	EvaluationScore09   Range  `json:"evaluationScore09"`
	EvaluationScore10   Range  `json:"evaluationScore10"`
}

FilterSpecsByRangeRequest is for 'FilterSpecsByRange'

type IID

type IID struct {
	NameId   string // NameID by user
	SystemId string // SystemID by CloudOS
}

Spider 2020-03-30 https://github.com/cloud-barista/cb-spider/blob/master/cloud-control-manager/cloud-driver/interfaces/resources/IId.go

type IdList

type IdList struct {
	IdList []string `json:"output"`
	// contains filtered or unexported fields
}

func (*IdList) AddItem

func (list *IdList) AddItem(id string)

AddItem adds a new item to the model.IdList

type InspectResource

type InspectResource struct {
	ConnectionName   string                `json:"connectionName"`
	ResourceType     string                `json:"resourceType"`
	SystemMessage    string                `json:"systemMessage"`
	ResourceOverview ResourceCountOverview `json:"resourceOverview"`
	Resources        ResourcesByManageType `json:"resources"`
}

InspectResource is struct for InspectResource per Cloud Connection

type InspectResourceAllResult

type InspectResourceAllResult struct {
	ElapsedTime          int                     `json:"elapsedTime"`
	RegisteredConnection int                     `json:"registeredConnection"`
	AvailableConnection  int                     `json:"availableConnection"`
	TumblebugOverview    inspectOverview         `json:"tumblebugOverview"`
	CspOnlyOverview      inspectOverview         `json:"cspOnlyOverview"`
	InspectResult        []InspectResourceResult `json:"inspectResult"`
}

InspectResourceAllResult is struct for Inspect Resource Result for All Clouds

type InspectResourceResult

type InspectResourceResult struct {
	ConnectionName    string          `json:"connectionName"`
	SystemMessage     string          `json:"systemMessage"`
	ElapsedTime       int             `json:"elapsedTime"`
	TumblebugOverview inspectOverview `json:"tumblebugOverview"`
	CspOnlyOverview   inspectOverview `json:"cspOnlyOverview"`
}

InspectResourceResult is struct for Inspect Resource Result

type K8sClusterDetail

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

type K8sClusterInfo struct {
	CSPs map[string]K8sClusterDetail `mapstructure:"k8scluster" json:"k8s_cluster"`
}

K8sClusterInfo is structure for kubernetes cluster information

type K8sClusterNodeGroupsOnCreation

type K8sClusterNodeGroupsOnCreation struct {
	Result string `json:"result" example:"true"`
}

type K8sClusterNodeImageDetail

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

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

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

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

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

type K8sClusterSetting struct {
	Enable string `yaml:"enable"`
}

K8sClusterSetting is structure for K8sCluster setting

type K8sClusterVersionDetail

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

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 KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

KeyValue is struct for key-value pair

type KeyWithEncryptedValue

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 Label added in v0.9.10

type Label struct {
	Labels map[string]string `json:"labels"`
}

Label is a struct to handle labels

type LabelInfo

type LabelInfo struct {
	ResourceKey string            `json:"resourceKey"`
	Labels      map[string]string `json:"labels"`
}

LabelInfo represents the label-related information for a resource.

type LabelableResource

type LabelableResource interface {
	GetLabels() map[string]string
	SetLabels(labels map[string]string)
}

LabelableResource is an interface for resources that support labels.

type Location

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 McNlbInfo

type McNlbInfo struct {
	MciAccessInfo *MciAccessInfo  `json:"mciAccessInfo"`
	McNlbHostInfo *TbMciInfo      `json:"mcNlbHostInfo"`
	DeploymentLog MciSshCmdResult `json:"deploymentLog"`
}

McNlbInfo is a struct for response of CreateMcSwNlb

type MciAccessInfo

type MciAccessInfo struct {
	MciId                 string
	MciNlbListener        *MciAccessInfo `json:"mciNlbListener,omitempty"`
	MciSubGroupAccessInfo []MciSubGroupAccessInfo
}

MciAccessInfo is struct to retrieve overall access information of a MCI

type MciCmdReq

type MciCmdReq struct {
	UserName string   `json:"userName" example:"cb-user" default:""`
	Command  []string `` /* 128-byte string literal not displayed */
}

MciCmdReq is struct for remote command

type MciConnectionConfigCandidatesReq

type MciConnectionConfigCandidatesReq struct {
	// CommonSpec is field for id of a spec in common namespace
	CommonSpecs []string `json:"commonSpec" validate:"required" example:"aws+ap-northeast-2+t2.small,gcp+us-west1+g1-small"`
}

MciConnectionConfigCandidatesReq is struct for a request to check requirements to create a new MCI instance dynamically (with default resource option)

type MciPolicyInfo

type MciPolicyInfo struct {
	Name   string   `json:"Name"` //MCI Name (for request)
	Id     string   `json:"Id"`   //MCI Id (generated ID by the Name)
	Policy []Policy `json:"policy"`

	ActionLog   string `json:"actionLog"`
	Description string `json:"description" example:"Description"`
}

MciPolicyInfo is struct for MCI auto-control Policy object.

type MciPolicyReq

type MciPolicyReq struct {
	Policy      []Policy `json:"policy"`
	Description string   `json:"description" example:"Description"`
}

MciPolicyReq is struct for MCI auto-control Policy Request.

type MciRecommendReq

type MciRecommendReq struct {
	VmReq          []TbVmRecommendReq `json:"vmReq"`
	PlacementAlgo  string             `json:"placementAlgo"`
	PlacementParam []KeyValue         `json:"placementParam"`
	MaxResultNum   string             `json:"maxResultNum"`
}

MciRecommendReq is struct for MciRecommendReq

type MciSshCmdResult

type MciSshCmdResult struct {
	Results []SshCmdResult `json:"results"`
}

MciSshCmdResult is struct for Set of SshCmd Results in terms of MCI

type MciStatusInfo

type MciStatusInfo struct {
	Id   string `json:"id"`
	Name string `json:"name"`

	Status       string          `json:"status"`
	StatusCount  StatusCountInfo `json:"statusCount"`
	TargetStatus string          `json:"targetStatus"`
	TargetAction string          `json:"targetAction"`

	// InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes)
	InstallMonAgent string `json:"installMonAgent" example:"[yes, no]"` // yes or no

	MasterVmId    string `json:"masterVmId" example:"vm-asiaeast1-cb-01"`
	MasterIp      string `json:"masterIp" example:"32.201.134.113"`
	MasterSSHPort string `json:"masterSSHPort"`

	// Label is for describing the object by keywords
	Label map[string]string `json:"label"`

	// SystemLabel is for describing the mci in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel" example:"Managed by CB-Tumblebug" default:""`

	Vm []TbVmStatusInfo `json:"vm"`
}

MciStatusInfo is struct to define simple information of MCI with updated status of all VMs

type MciSubGroupAccessInfo

type MciSubGroupAccessInfo struct {
	SubGroupId      string
	NlbListener     *TbNLBListenerInfo `json:"nlbListener,omitempty"`
	BastionVmId     string
	MciVmAccessInfo []MciVmAccessInfo
}

MciSubGroupAccessInfo is struct for MciSubGroupAccessInfo

type MciVmAccessInfo

type MciVmAccessInfo struct {
	VmId           string `json:"vmId"`
	PublicIP       string `json:"publicIP"`
	PrivateIP      string `json:"privateIP"`
	SSHPort        string `json:"sshPort"`
	PrivateKey     string `json:"privateKey,omitempty"`
	VmUserName     string `json:"vmUserName,omitempty"`
	VmUserPassword string `json:"vmUserPassword,omitempty"`
}

MciVmAccessInfo is struct for MciVmAccessInfo

type MonAgentInstallReq

type MonAgentInstallReq struct {
	NsId     string `json:"nsId,omitempty"`
	MciId    string `json:"mciId,omitempty"`
	VmId     string `json:"vmId,omitempty"`
	PublicIp string `json:"publicIp,omitempty"`
	Port     string `json:"port,omitempty"`
	UserName string `json:"userName,omitempty"`
	SshKey   string `json:"sshKey,omitempty"`
	CspType  string `json:"cspType,omitempty"`
}

MonAgentInstallReq struct

type MonResultSimple

type MonResultSimple struct {
	Metric string `json:"metric"`
	VmId   string `json:"vmId"`
	Value  string `json:"value"`
	Err    string `json:"err"`
}

MonResultSimple struct is for containing vm monitoring results

type MonResultSimpleResponse

type MonResultSimpleResponse struct {
	NsId          string            `json:"nsId"`
	MciId         string            `json:"mciId"`
	MciMonitoring []MonResultSimple `json:"mciMonitoring"`
}

MonResultSimpleResponse struct is for containing Mci monitoring results

type MultihostBenchmarkReq

type MultihostBenchmarkReq struct {
	Multihost []BenchmarkReq `json:"multihost"`
}

MultihostBenchmarkReq is struct for MultihostBenchmarkReq

type NLBListenerReq

type NLBListenerReq struct {
	Protocol string `json:"protocol" example:"TCP"` // TCP|UDP
	Port     string `json:"port" example:"80"`      // 1-65535
}

NLBListenerReq is a struct to handle NLB Listener information of the CB-Spider's & CB-Tumblebug's REST API request

type NeededVNet added in v0.9.10

type NeededVNet struct {
	SubnetCount         int    `json:"subnetCount"`
	SubnetSize          int    `json:"subnetSize"`
	ZoneSelectionMethod string `json:"zoneSelectionMethod"`
}

type NlbSetting

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

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 {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"default"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`

	// Name is human-readable string to represent the object
	Name string `json:"name" example:"default"`

	Description string `json:"description" example:"Description for this namespace"`
}

swagger:response NsInfo

type NsReq

type NsReq struct {
	Name        string `json:"name" example:"default"`
	Description string `json:"description" example:"Description for this namespace"`
}

type Operation

type Operation struct {
	Operator string `json:"operator" example:"<=" enums:">=,<=,=="` // >=, <=, ==
	Operand  string `json:"operand" example:"4" enums:"4,8,.."`     // 10, 70, 80, 98, ...
}

Operation is struct for .

type OptionalParameter

type OptionalParameter struct {
	Value string
	Set   bool
}

OptionalParameter is struct for optional parameter for function (ex. VmId)

type ParameterKeyVal

type ParameterKeyVal struct {
	Key string   `json:"key" example:"coordinateClose" enums:"coordinateClose,coordinateWithin,coordinateFair"` // coordinate
	Val []string `json:"val" example:"44.146838/-116.411403"`                                                   // ["Latitude,Longitude","12,543",..,"31,433"]
}

Operation is struct for .

type Policy

type Policy struct {
	AutoCondition AutoCondition `json:"autoCondition"`
	AutoAction    AutoAction    `json:"autoAction"`
	Status        string        `json:"status"`
}

Policy is struct for MCI auto-control Policy request that includes AutoCondition, AutoAction, Status.

type PriorityCondition

type PriorityCondition struct {
	Metric    string            `json:"metric" example:"location" enums:"location,cost,random,performance,latency"`
	Weight    string            `json:"weight" example:"0.3" enums:"0.1,0.2,..."`
	Parameter []ParameterKeyVal `json:"parameter,omitempty"`
}

FilterCondition is struct for .

type PriorityInfo

type PriorityInfo struct {
	Policy []PriorityCondition `json:"policy"`
}

PriorityInfo is struct for .

type PublicKeyResponse

type PublicKeyResponse struct {
	PublicKeyTokenId string `json:"publicKeyTokenId"`
	PublicKey        string `json:"publicKey"`
}

PublicKeyResponse is struct for containing the public key response

type Range

type Range struct {
	Min float32 `json:"min"`
	Max float32 `json:"max"`
}

Range struct is for 'FilterSpecsByRange'

type RegionDetail

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

type RegionInfo

type RegionInfo struct {
	Region string
	Zone   string
}

RegionInfo is struct for region information

type RegionList

type RegionList struct {
	Regions []RegionDetail `mapstructure:"regions" json:"regions"`
}

RegionList is structure for region list

type RegionZoneInfo

type RegionZoneInfo struct {
	AssignedRegion string `json:"assignedRegion"`
	AssignedZone   string `json:"assignedZone"`
}

RegionZoneInfo is struct for containing region struct

type RegisterResourceAllResult

type RegisterResourceAllResult struct {
	ElapsedTime           int                      `json:"elapsedTime"`
	RegisteredConnection  int                      `json:"registeredConnection"`
	AvailableConnection   int                      `json:"availableConnection"`
	RegisterationOverview RegisterationOverview    `json:"registerationOverview"`
	RegisterationResult   []RegisterResourceResult `json:"registerationResult"`
}

RegisterResourceAllResult is struct for Register Resource Result for All Clouds

type RegisterResourceResult

type RegisterResourceResult struct {
	ConnectionName        string                `json:"connectionName"`
	SystemMessage         string                `json:"systemMessage"`
	ElapsedTime           int                   `json:"elapsedTime"`
	RegisterationOverview RegisterationOverview `json:"registerationOverview"`
	RegisterationOutputs  IdList                `json:"registerationOutputs"`
}

RegisterResourceResult is struct for Register Resource Result

type RegisterationOverview

type RegisterationOverview struct {
	VNet          int `json:"vNet"`
	SecurityGroup int `json:"securityGroup"`
	SshKey        int `json:"sshKey"`
	DataDisk      int `json:"dataDisk"`
	CustomImage   int `json:"customImage"`
	Vm            int `json:"vm"`
	NLB           int `json:"nlb"`
	Failed        int `json:"failed"`
}

RegisterResource is struct for Register Resource

type ResourceCountOverview

type ResourceCountOverview struct {
	OnTumblebug int `json:"onTumblebug"`
	OnSpider    int `json:"onSpider"`
	OnCspTotal  int `json:"onCspTotal"`
	OnCspOnly   int `json:"onCspOnly"`
}

ResourceCountOverview is struct for Resource Count Overview

type ResourceIds added in v0.9.10

type ResourceIds struct {
	CspResourceId   string
	CspResourceName string
	ConnectionName  string
}

ResourceIds is struct for containing id and name of each Resource type

type ResourceOnCsp

type ResourceOnCsp struct {
	Count int                 `json:"count"`
	Info  []ResourceOnCspInfo `json:"info"`
}

ResourceOnCsp is struct for Resource on CSP

type ResourceOnCspInfo

type ResourceOnCspInfo struct {
	CspResourceId string `json:"cspResourceId"`
	RefNameOrId   string `json:"refNameOrId"`
}

ResourceOnCspInfo is struct for Resource on CSP Info

type ResourceOnSpider

type ResourceOnSpider struct {
	Count int                    `json:"count"`
	Info  []ResourceOnSpiderInfo `json:"info"`
}

ResourceOnSpider is struct for Resource on Spider

type ResourceOnSpiderInfo

type ResourceOnSpiderInfo struct {
	IdBySp        string `json:"idBySp"`
	CspResourceId string `json:"cspResourceId"`
}

ResourceOnSpiderInfo is struct for Resource on Spider Info

type ResourceOnTumblebug

type ResourceOnTumblebug struct {
	Count int                       `json:"count"`
	Info  []ResourceOnTumblebugInfo `json:"info"`
}

ResourceOnTumblebug is struct for Resource on Tumblebug

type ResourceOnTumblebugInfo

type ResourceOnTumblebugInfo struct {
	IdByTb        string `json:"idByTb"`
	CspResourceId string `json:"cspResourceId"`
	NsId          string `json:"nsId"`
	MciId         string `json:"mciId,omitempty"`
	ObjectKey     string `json:"objectKey"`
}

ResourceOnTumblebugInfo is struct for Resource on Tumblebug Info

type ResourcesByManageType

type ResourcesByManageType struct {
	OnTumblebug ResourceOnTumblebug `json:"onTumblebug"`
	OnSpider    ResourceOnSpider    `json:"onSpider"`
	OnCspTotal  ResourceOnCsp       `json:"onCspTotal"`
	OnCspOnly   ResourceOnCsp       `json:"onCspOnly"`
}

ResourcesByManageType is struct for Resources by Manage Type

type RetrievedRegionList added in v0.9.10

type RetrievedRegionList struct {
	Region []SpiderRegionZoneInfo `json:"region"`
}

RetrievedRegionList is array struct for Region

type RuntimeConfig

type RuntimeConfig struct {
	Cloud Cloud `yaml:"cloud"`
	Nlbsw Nlbsw `yaml:"nlbsw"`
}

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 SpecBenchmarkInfo

type SpecBenchmarkInfo struct {
	SpecId     string `json:"specid"`
	Cpus       string `json:"cpus"`
	Cpum       string `json:"cpum"`
	MemR       string `json:"memR"`
	MemW       string `json:"memW"`
	FioR       string `json:"fioR"`
	FioW       string `json:"fioW"`
	DbR        string `json:"dbR"`
	DbW        string `json:"dbW"`
	Rtt        string `json:"rtt"`
	EvaledTime string `json:"evaledTime"`
}

SpecBenchmarkInfo is struct for SpecBenchmarkInfo

type SpiderAccessInfo

type SpiderAccessInfo struct {
	Endpoint   string // ex) https://1.2.3.4:6443
	Kubeconfig string
}

SpiderAccessInfo is a struct to handle Cluster Access information from the CB-Spider's REST API response

type SpiderAddonsInfo

type SpiderAddonsInfo struct {
	KeyValueList []KeyValue
}

SpiderAddonsInfo is a struct to handle Cluster Addons information from the CB-Spider's REST API response

type SpiderAllList

type SpiderAllList struct {
	MappedList     []SpiderNameIdSystemId
	OnlySpiderList []SpiderNameIdSystemId
	OnlyCSPList    []SpiderNameIdSystemId
}

type SpiderAllListWrapper

type SpiderAllListWrapper struct {
	AllList SpiderAllList
}

type SpiderChangeAutoscaleSizeReq

type SpiderChangeAutoscaleSizeReq struct {
	ConnectionName string
	ReqInfo        SpiderChangeAutoscaleSizeReqInfo
}

SpiderChangeAutoscaleSizeReq is a wrapper struct to create JSON body of 'Change Autoscale Size' request.

type SpiderChangeAutoscaleSizeReqInfo

type SpiderChangeAutoscaleSizeReqInfo struct {
	DesiredNodeSize string
	MinNodeSize     string
	MaxNodeSize     string
}

SpiderChangeAutoscaleSizeReqInfo is a wrapper struct to create JSON body of 'Change Autoscale Size' request.

type SpiderChangeAutoscaleSizeRes

type SpiderChangeAutoscaleSizeRes struct {
	ConnectionName string
	NodeGroupInfo  SpiderNodeGroupInfo
}

SpiderChangeAutoscaleSizeRes is a wrapper struct to get JSON body of 'Change Autoscale Size' response

type SpiderClusterInfo

type SpiderClusterInfo struct {
	IId IID // {NameId, SystemId}

	Version string // Kubernetes Version, ex) 1.23.3
	Network SpiderNetworkInfo

	NodeGroupList []SpiderNodeGroupInfo
	AccessInfo    SpiderAccessInfo
	Addons        SpiderAddonsInfo

	Status SpiderClusterStatus

	CreatedTime  time.Time
	KeyValueList []KeyValue
}

SpiderClusterInfo is a struct to handle Cluster information from the CB-Spider's REST API response

type SpiderClusterReq

type SpiderClusterReq struct {
	NameSpace      string // should be empty string from Tumblebug
	ConnectionName string
	ReqInfo        SpiderClusterReqInfo
}

SpiderClusterReq is a wrapper struct to create JSON body of 'Create Cluster request'

type SpiderClusterReqInfo

type SpiderClusterReqInfo struct {
	// (1) Cluster Info
	Name    string
	Version string

	// (2) Network Info
	VPCName            string
	SubnetNames        []string
	SecurityGroupNames []string

	// (3) NodeGroupInfo List
	NodeGroupList []SpiderNodeGroupReqInfo
}

SpiderClusterReqInfo is a struct to create JSON body of 'Create Cluster request'

type SpiderClusterRes

type SpiderClusterRes struct {
	ConnectionName string
	ClusterInfo    SpiderClusterInfo
}

SpiderClusterRes is a wrapper struct to handle a Cluster information from the CB-Spider's REST API response

type SpiderClusterStatus

type SpiderClusterStatus string
const (
	SpiderClusterCreating SpiderClusterStatus = "Creating"
	SpiderClusterActive   SpiderClusterStatus = "Active"
	SpiderClusterInactive SpiderClusterStatus = "Inactive"
	SpiderClusterUpdating SpiderClusterStatus = "Updating"
	SpiderClusterDeleting SpiderClusterStatus = "Deleting"
)

type SpiderConnConfig

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

type SpiderConnectionName struct {
	ConnectionName string `json:"ConnectionName"`
}

type SpiderDiskAttachDetachReq

type SpiderDiskAttachDetachReq struct {
	VMName string
}

SpiderDiskAttachDetachReq is a struct to create JSON body of 'Attach/Detach disk request'

type SpiderDiskAttachDetachReqWrapper

type SpiderDiskAttachDetachReqWrapper struct {
	ConnectionName string
	ReqInfo        SpiderDiskAttachDetachReq
}

SpiderDiskAttachDetachReqWrapper is a wrapper struct to create JSON body of 'Attach/Detach disk request'

type SpiderDiskInfo

type SpiderDiskInfo struct {
	// Fields for request
	Name  string
	CSPid string

	// Fields for both request and response
	DiskType string // "", "SSD(gp2)", "Premium SSD", ...
	DiskSize string // "", "default", "50", "1000"  # (GB)

	// Fields for response
	IId IID // {NameId, SystemId}

	Status  DiskStatus // DiskCreating | DiskAvailable | DiskAttached | DiskDeleting | DiskError
	OwnerVM IID        // When the Status is DiskAttached

	CreatedTime  time.Time
	KeyValueList []KeyValue
}

SpiderDiskInfo is a struct to create JSON body of 'Get disk request'

type SpiderDiskReqInfoWrapper

type SpiderDiskReqInfoWrapper struct {
	ConnectionName string
	ReqInfo        SpiderDiskInfo
}

SpiderDiskReqInfoWrapper is a wrapper struct to create JSON body of 'Get disk request'

type SpiderDiskUpsizeReq

type SpiderDiskUpsizeReq struct {
	Size string // "", "default", "50", "1000"  # (GB)
}

SpiderDiskUpsizeReq is a struct to create JSON body of 'Upsize disk request'

type SpiderDiskUpsizeReqWrapper

type SpiderDiskUpsizeReqWrapper struct {
	ConnectionName string
	ReqInfo        SpiderDiskUpsizeReq
}

SpiderDiskUpsizeReqWrapper is a wrapper struct to create JSON body of 'Upsize disk request'

type SpiderGpuInfo

type SpiderGpuInfo struct {
	Count string
	Mfr   string
	Model string
	Mem   string
}

SpiderGpuInfo is a struct to handle GPU Info from CB-Spider.

type SpiderImageInfo

type SpiderImageInfo struct {
	// Fields for request
	Name string

	// Fields for response
	IId          IID    // {NameId, SystemId}
	GuestOS      string // Windows7, Ubuntu etc.
	Status       string // available, unavailable
	KeyValueList []KeyValue
}

SpiderImageInfo is a struct to create JSON body of 'Get image request'

type SpiderImageList

type SpiderImageList struct {
	Image []SpiderImageInfo `json:"image"`
}

SpiderImageList is struct for Spider Image List

type SpiderImageReqInfoWrapper

type SpiderImageReqInfoWrapper struct {
	ConnectionName string
	ReqInfo        SpiderImageInfo
}

SpiderImageReqInfoWrapper is a wrapper struct to create JSON body of 'Get image request'

type SpiderImageType

type SpiderImageType string
const (
	PublicImage SpiderImageType = "PublicImage"
	MyImage     SpiderImageType = "MyImage"
)

type SpiderKeyPairInfo

type SpiderKeyPairInfo struct {
	// Fields for request
	Name  string
	CSPId string

	// Fields for response
	IId          IID // {NameId, SystemId}
	Fingerprint  string
	PublicKey    string
	PrivateKey   string
	VMUserID     string
	KeyValueList []KeyValue
}

SpiderKeyPairInfo is a struct to create JSON body of 'Create keypair request'

type SpiderKeyPairReqInfoWrapper

type SpiderKeyPairReqInfoWrapper struct {
	ConnectionName string
	ReqInfo        SpiderKeyPairInfo
}

SpiderKeyPairReqInfoWrapper is a wrapper struct to create JSON body of 'Create keypair request'

type SpiderMyImageInfo

type SpiderMyImageInfo struct {
	IId IID // {NameId, SystemId}

	SourceVM IID

	Status CustomImageStatus // Available | Deleting

	CreatedTime  time.Time
	KeyValueList []KeyValue
}

type SpiderMyImageRegisterReq

type SpiderMyImageRegisterReq struct {
	ConnectionName string
	ReqInfo        struct {
		Name  string
		CSPId string // or, CSPid ?
	}
}

type SpiderMyImageReq

type SpiderMyImageReq struct {
	ConnectionName string
	ReqInfo        struct {
		Name     string
		SourceVM string
	}
}

type SpiderNLBAddRemoveVMReqInfoWrapper

type SpiderNLBAddRemoveVMReqInfoWrapper struct {
	ConnectionName string
	ReqInfo        SpiderNLBSubGroupReq
}

SpiderNLBAddRemoveVMReqInfoWrapper is a wrapper struct to create JSON body of 'Add/Remove VMs to/from NLB' request

type SpiderNLBHealthCheckerInfo

type SpiderNLBHealthCheckerInfo struct {
	Protocol  string `json:"protocol" example:"TCP"` // TCP|HTTP|HTTPS
	Port      string `json:"port" example:"22"`      // Listener Port or 1-65535
	Interval  int    `json:"interval" example:"10"`  // secs, Interval time between health checks.
	Timeout   int    `json:"timeout" example:"10"`   // secs, Waiting time to decide an unhealthy VM when no response.
	Threshold int    `json:"threshold" example:"3"`  // num, The number of continuous health checks to change the VM status.

	CspID        string     `json:"cspID"` // Optional, May be Used by Driver.
	KeyValueList []KeyValue `json:"keyValueList"`
}

type SpiderNLBHealthCheckerReq

type SpiderNLBHealthCheckerReq struct {
	Protocol  string `json:"protocol" example:"TCP"`      // TCP|HTTP|HTTPS
	Port      string `json:"port" example:"22"`           // Listener Port or 1-65535
	Interval  string `json:"interval" example:"default"`  // secs, Interval time between health checks.
	Timeout   string `json:"timeout" example:"default"`   // secs, Waiting time to decide an unhealthy VM when no response.
	Threshold string `json:"threshold" example:"default"` // num, The number of continuous health checks to change the VM status.
}

type SpiderNLBHealthInfo

type SpiderNLBHealthInfo struct {
	AllVMs       *[]IID
	HealthyVMs   *[]IID
	UnHealthyVMs *[]IID
}

type SpiderNLBHealthInfoWrapper

type SpiderNLBHealthInfoWrapper struct {
	Healthinfo SpiderNLBHealthInfo
}

type SpiderNLBInfo

type SpiderNLBInfo struct {
	IId    IID // {NameId, SystemId}
	VpcIID IID // {NameId, SystemId}

	Type  string // PUBLIC(V) | INTERNAL
	Scope string // REGION(V) | GLOBAL

	//------ Frontend
	Listener SpiderNLBListenerInfo

	//------ Backend
	VMGroup       SpiderNLBSubGroupInfo
	HealthChecker SpiderNLBHealthCheckerInfo

	CreatedTime  time.Time
	KeyValueList []KeyValue
}

SpiderNLBInfo is a struct to handle NLB information from the CB-Spider's REST API response

type SpiderNLBListenerInfo

type SpiderNLBListenerInfo struct {
	Protocol string `json:"protocol" example:"TCP"` // TCP|UDP
	IP       string `json:"ip" example:""`          // Auto Generated and attached
	Port     string `json:"port" example:"80"`      // 1-65535
	DNSName  string `json:"dnsName" example:""`     // Optional, Auto Generated and attached

	CspID        string     `json:"cspID"` // Optional, May be Used by Driver.
	KeyValueList []KeyValue `json:"keyValueList"`
}

SpiderNLBListenerInfo is a struct to handle NLB Listener information from the CB-Spider's REST API response

type SpiderNLBReqInfo

type SpiderNLBReqInfo struct {
	Name    string
	VPCName string
	Type    string // PUBLIC(V) | INTERNAL
	Scope   string // REGION(V) | GLOBAL

	Listener NLBListenerReq

	VMGroup       SpiderNLBSubGroupReq
	HealthChecker SpiderNLBHealthCheckerReq
}

SpiderNLBReqInfo is a struct to create JSON body of 'Create NLB request'

type SpiderNLBReqInfoWrapper

type SpiderNLBReqInfoWrapper struct {
	ConnectionName string
	ReqInfo        SpiderNLBReqInfo
}

SpiderNLBReqInfoWrapper is a wrapper struct to create JSON body of 'Create NLB request'

type SpiderNLBSubGroupInfo

type SpiderNLBSubGroupInfo struct {
	Protocol string // TCP|UDP|HTTP|HTTPS
	Port     string // 1-65535
	VMs      *[]IID

	CspID        string     `json:"cspID"` // Optional, May be Used by Driver.
	KeyValueList []KeyValue `json:"keyValueList"`
}

SpiderNLBSubGroupInfo is a struct from NLBSubGroupInfo from Spider

type SpiderNLBSubGroupReq

type SpiderNLBSubGroupReq struct {
	Protocol string // TCP|HTTP|HTTPS
	Port     string // Listener Port or 1-65535
	VMs      []string
}

type SpiderNameIdSystemId

type SpiderNameIdSystemId struct {
	NameId   string
	SystemId string
}

type SpiderNetworkInfo

type SpiderNetworkInfo struct {
	VpcIID            IID // {NameId, SystemId}
	SubnetIIDs        []IID
	SecurityGroupIIDs []IID

	KeyValueList []KeyValue
}

SpiderNetworkInfo is a struct to handle Cluster Network information from the CB-Spider's REST API response

type SpiderNodeGroupInfo

type SpiderNodeGroupInfo struct {
	IId IID // {NameId, SystemId}

	// VM config.
	ImageIID     IID
	VMSpecName   string
	RootDiskType string // "SSD(gp2)", "Premium SSD", ...
	RootDiskSize string // "", "default", "50", "1000" (GB)
	KeyPairIID   IID

	// Scaling config.
	OnAutoScaling   bool // default: true
	DesiredNodeSize int
	MinNodeSize     int
	MaxNodeSize     int

	Status SpiderNodeGroupStatus
	Nodes  []IID

	KeyValueList []KeyValue
}

SpiderNodeGroupInfo is a struct to handle Cluster Node Group information from the CB-Spider's REST API response

type SpiderNodeGroupReq

type SpiderNodeGroupReq struct {
	NameSpace      string // should be empty string from Tumblebug
	ConnectionName string
	ReqInfo        SpiderNodeGroupReqInfo
}

SpiderNodeGroupReq is a wrapper struct to create JSON body of 'Add NodeGroup' request

type SpiderNodeGroupReqInfo

type SpiderNodeGroupReqInfo struct {
	Name         string
	ImageName    string
	VMSpecName   string
	RootDiskType string
	RootDiskSize string
	KeyPairName  string

	// autoscale config.
	OnAutoScaling   string
	DesiredNodeSize string
	MinNodeSize     string
	MaxNodeSize     string
}

SpiderNodeGroupReqInfo is a wrapper struct to create JSON body of 'Add NodeGroup' request

type SpiderNodeGroupStatus

type SpiderNodeGroupStatus string
const (
	SpiderNodeGroupCreating SpiderNodeGroupStatus = "Creating"
	SpiderNodeGroupActive   SpiderNodeGroupStatus = "Active"
	SpiderNodeGroupInactive SpiderNodeGroupStatus = "Inactive"
	SpiderNodeGroupUpdating SpiderNodeGroupStatus = "Updating"
	SpiderNodeGroupDeleting SpiderNodeGroupStatus = "Deleting"
)

type SpiderRegionZoneInfo

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

type SpiderSecurityInfo

type SpiderSecurityInfo struct {
	// Fields for request
	Name    string
	VPCName string
	CSPId   string

	// Fields for both request and response
	SecurityRules []SpiderSecurityRuleInfo

	// Fields for response
	IId          IID    // {NameId, SystemId}
	VpcIID       IID    // {NameId, SystemId}
	Direction    string // @todo userd??
	KeyValueList []KeyValue
}

SpiderSecurityRuleInfo is a struct to create JSON body of 'Create security group request'

type SpiderSecurityInfoList

type SpiderSecurityInfoList struct {
	SecurityGroup []SpiderSecurityInfo
}

SpiderSecurityInfoList is a struct to handle 'List security group' response from CB-Spider.

type SpiderSecurityReqInfoWrapper

type SpiderSecurityReqInfoWrapper struct {
	ConnectionName string
	ReqInfo        SpiderSecurityInfo
}

SpiderSecurityReqInfoWrapper is a wrapper struct to create JSON body of 'Create security group request'

type SpiderSecurityRuleInfo

type SpiderSecurityRuleInfo struct {
	FromPort   string //`json:"fromPort"`
	ToPort     string //`json:"toPort"`
	IPProtocol string //`json:"ipProtocol"`
	Direction  string //`json:"direction"`
	CIDR       string
}

SpiderSecurityRuleInfo is a struct to handle security group rule info from/to CB-Spider.

type SpiderSecurityRuleReqInfoIntermediateWrapper

type SpiderSecurityRuleReqInfoIntermediateWrapper struct {
	RuleInfoList []SpiderSecurityRuleInfo
}

SpiderSecurityRuleReqInfoIntermediateWrapper is a intermediate wrapper struct between SpiderSecurityRuleReqInfoWrapper and SpiderSecurityRuleInfo.

type SpiderSecurityRuleReqInfoWrapper

type SpiderSecurityRuleReqInfoWrapper struct {
	ConnectionName string
	ReqInfo        SpiderSecurityRuleReqInfoIntermediateWrapper
}

SpiderSecurityRuleReqInfoWrapper is a wrapper struct to create JSON body of 'Create security rule'

type SpiderSetAutoscalingReq

type SpiderSetAutoscalingReq struct {
	ConnectionName string
	ReqInfo        SpiderSetAutoscalingReqInfo
}

SpiderSetAutoscalingReq is a wrapper struct to create JSON body of 'Set Autoscaling On/Off' request.

type SpiderSetAutoscalingReqInfo

type SpiderSetAutoscalingReqInfo struct {
	OnAutoScaling string
}

SpiderSetAutoscalingReqInfo is a wrapper struct to create JSON body of 'Set Autoscaling On/Off' request.

type SpiderSetAutoscalingRes

type SpiderSetAutoscalingRes struct {
	Result string
}

SpiderSetAutoscalingRes is a wrapper struct to create JSON body of 'Set Autoscaling On/Off' response.

type SpiderSpecInfo

type SpiderSpecInfo struct {
	Region string
	Name   string
	VCpu   SpiderVCpuInfo
	Mem    string
	Gpu    []SpiderGpuInfo

	KeyValueList []KeyValue
}

SpiderSpecInfo is a struct to create JSON body of 'Get spec request'

type SpiderSpecList

type SpiderSpecList struct {
	Vmspec []SpiderSpecInfo `json:"vmspec"`
}

SpiderSpecList is a struct to handle spec list from the CB-Spider's REST API response

type SpiderUpgradeClusterReq

type SpiderUpgradeClusterReq struct {
	NameSpace      string // should be empty string from Tumblebug
	ConnectionName string
	ReqInfo        SpiderUpgradeClusterReqInfo
}

SpiderUpgradeClusterReq is a wrapper struct to create JSON body of 'Upgrade Cluster' request

type SpiderUpgradeClusterReqInfo

type SpiderUpgradeClusterReqInfo struct {
	Version string
}

SpiderUpgradeClusterReqInfo is a wrapper struct to create JSON body of 'Upgrade Cluster' request

type SpiderVCpuInfo

type SpiderVCpuInfo struct {
	Count string
	Clock string // GHz
}

SpiderVCpuInfo is a struct to handle vCPU Info from CB-Spider.

type SpiderVMInfo

type SpiderVMInfo struct {
	// Fields for request
	Name               string
	ImageName          string
	VPCName            string
	SubnetName         string
	SecurityGroupNames []string
	KeyPairName        string
	CSPid              string // VM ID given by CSP (required for registering VM)
	DataDiskNames      []string

	// Fields for both request and response
	VMSpecName   string // instance type or flavour, etc... ex) t2.micro or f1.micro
	VMUserId     string // ex) user1
	VMUserPasswd string
	RootDiskType string // "SSD(gp2)", "Premium SSD", ...
	RootDiskSize string // "default", "50", "1000" (GB)
	ImageType    SpiderImageType

	// Fields for response
	IId               IID // {NameId, SystemId}
	ImageIId          IID
	VpcIID            IID
	SubnetIID         IID   // AWS, ex) subnet-8c4a53e4
	SecurityGroupIIds []IID // AWS, ex) sg-0b7452563e1121bb6
	KeyPairIId        IID
	DataDiskIIDs      []IID
	StartTime         time.Time
	Region            RegionInfo //  ex) {us-east1, us-east1-c} or {ap-northeast-2}
	NetworkInterface  string     // ex) eth0
	PublicIP          string
	PublicDNS         string
	PrivateIP         string
	PrivateDNS        string
	RootDeviceName    string // "/dev/sda1", ...
	SSHAccessPoint    string
	KeyValueList      []KeyValue
}

Ref: cb-spider/cloud-control-manager/cloud-driver/interfaces/resources/VMHandler.go SpiderVMInfo is struct from CB-Spider for VM information

type SpiderVMReqInfoWrapper

type SpiderVMReqInfoWrapper struct {
	ConnectionName string
	ReqInfo        SpiderVMInfo
}

SpiderVMReqInfoWrapper is struct from CB-Spider (VMHandler.go) for wrapping SpiderVMInfo

type SshCmdResult

type SshCmdResult struct {
	MciId   string         `json:"mciId"`
	VmId    string         `json:"vmId"`
	VmIp    string         `json:"vmIp"`
	Command map[int]string `json:"command"`
	Stdout  map[int]string `json:"stdout"`
	Stderr  map[int]string `json:"stderr"`
	Err     error          `json:"err"`
}

SshCmdResult is struct for SshCmd Result

type SshInfo

type SshInfo struct {
	UserName   string // ex) root
	PrivateKey []byte // ex) -----BEGIN RSA PRIVATE KEY-----
	EndPoint   string // ex) node12:22
}

SshInfo is struct for ssh info

type StatusCountInfo

type StatusCountInfo struct {

	// CountTotal is for Total VMs
	CountTotal int `json:"countTotal"`

	// CountCreating is for counting Creating
	CountCreating int `json:"countCreating"`

	// CountRunning is for counting Running
	CountRunning int `json:"countRunning"`

	// CountFailed is for counting Failed
	CountFailed int `json:"countFailed"`

	// CountSuspended is for counting Suspended
	CountSuspended int `json:"countSuspended"`

	// CountRebooting is for counting Rebooting
	CountRebooting int `json:"countRebooting"`

	// CountTerminated is for counting Terminated
	CountTerminated int `json:"countTerminated"`

	// CountSuspending is for counting Suspending
	CountSuspending int `json:"countSuspending"`

	// CountResuming is for counting Resuming
	CountResuming int `json:"countResuming"`

	// CountTerminating is for counting Terminating
	CountTerminating int `json:"countTerminating"`

	// CountUndefined is for counting Undefined
	CountUndefined int `json:"countUndefined"`
}

StatusCountInfo is struct to count the number of VMs in each status. ex: Running=4, Suspended=8.

type SystemLabelInfo added in v0.9.12

type SystemLabelInfo struct {
	LabelTypes   []string          `json:"labelTypes"`
	SystemLabels map[string]string `json:"systemLabels"`
}

SystemLabelInfo is a struct to return LabelTypes and System label Keys

type TbAttachDetachDataDiskReq

type TbAttachDetachDataDiskReq struct {
	DataDiskId string `json:"dataDiskId" validate:"required"`
}

TbAttachDetachDataDiskReq is a wrapper struct to create JSON body of 'Attach/Detach disk request'

type TbChangeK8sNodeGroupAutoscaleSizeReq

type TbChangeK8sNodeGroupAutoscaleSizeReq struct {
	DesiredNodeSize string `json:"desiredNodeSize" example:"1"`
	MinNodeSize     string `json:"minNodeSize" example:"1"`
	MaxNodeSize     string `json:"maxNodeSize" example:"3"`
}

TbChangeK8sNodeGroupAutoscaleSizeReq is a struct to handle 'Change K8sNodeGroup's Autoscale Size' request toward CB-Tumblebug.

type TbChangeK8sNodeGroupAutoscaleSizeRes

type TbChangeK8sNodeGroupAutoscaleSizeRes struct {
	TbK8sNodeGroupInfo
}

TbChangeK8sNodeGroupAutoscaleSizeRes is a struct to handle 'Change K8sNodeGroup's Autoscale Size' response from CB-Tumblebug.

type TbCustomImageInfo

type TbCustomImageInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name                 string            `json:"name" example:"aws-ap-southeast-1"`
	Namespace            string            `json:"namespace,omitempty" example:"default"` // required to save in RDB
	ConnectionName       string            `json:"connectionName" example:"aws-ap-southeast-1"`
	SourceVmId           string            `json:"sourceVmId" example:"aws-ap-southeast-1-1"`
	Description          string            `json:"description"`
	CreationDate         time.Time         `json:"creationDate,omitempty" example:"2022-10-18T08:12:48Z"`
	GuestOS              string            `json:"guestOS,omitempty"` // Windows7, Ubuntu etc.
	Status               CustomImageStatus `json:"status" example:"Available"`
	KeyValueList         []KeyValue        `json:"keyValueList,omitempty"`
	AssociatedObjectList []string          `json:"associatedObjectList,omitempty" example:"/ns/default/mci/mci01/vm/aws-ap-southeast-1-1"`
	IsAutoGenerated      bool              `json:"isAutoGenerated,omitempty"`

	// SystemLabel is for describing the Resource in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel,omitempty" example:"Managed by CB-Tumblebug" default:""`
}

TbCustomImageInfo is a struct for custom image (VM snapshot)

type TbCustomImageReq

type TbCustomImageReq struct {
	// This field is for 'Register existing custom image'
	CspResourceId string `json:"cspResourceId"`

	ConnectionName string `json:"connectionName"`
	Name           string `json:"name" validate:"required"`
	SourceVmId     string `json:"sourceVmId"`
	Description    string `json:"description"`
}

TbCustomImageReq is a struct to handle a request for Create custom image (VM snapshot)

type TbDataDiskInfo

type TbDataDiskInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name                 string     `json:"name" example:"aws-ap-southeast-1"`
	ConnectionName       string     `json:"connectionName,omitempty" example:"aws-ap-southeast-1"`
	DiskType             string     `json:"diskType" example:"standard"`
	DiskSize             string     `json:"diskSize" example:"77"`
	Status               DiskStatus `json:"status" example:"Available"` // Available, Unavailable, Attached, ...
	AssociatedObjectList []string   `json:"associatedObjectList" example:"/ns/default/mci/mci01/vm/aws-ap-southeast-1-1"`
	CreatedTime          time.Time  `json:"createdTime,omitempty" example:"2022-10-12T05:09:51.05Z"`
	KeyValueList         []KeyValue `json:"keyValueList,omitempty"`
	Description          string     `json:"description,omitempty" example:"Available"`

	// Latest system message such as error message
	SystemMessage string `json:"systemMessage" example:"Failed because ..." default:""` // systeam-given string message

	IsAutoGenerated bool `json:"isAutoGenerated,omitempty"`

	// SystemLabel is for describing the Resource in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel,omitempty" example:"Managed by CB-Tumblebug" default:""`
}

TbDataDiskInfo is a struct that represents TB dataDisk object.

type TbDataDiskReq

type TbDataDiskReq struct {
	Name           string `json:"name" validate:"required" example:"aws-ap-southeast-1-datadisk"`
	ConnectionName string `json:"connectionName" validate:"required" example:"aws-ap-southeast-1"`
	DiskType       string `json:"diskType" example:"default"`
	DiskSize       string `json:"diskSize" validate:"required" example:"77" default:"100"`
	Description    string `json:"description,omitempty"`

	// Fields for "Register existing dataDisk" feature
	// CspResourceId is required to register object from CSP (option=register)
	CspResourceId string `json:"cspResourceId"`
}

TbDataDiskReq is a struct to handle 'Register dataDisk' request toward CB-Tumblebug.

type TbDataDiskUpsizeReq

type TbDataDiskUpsizeReq struct {
	DiskSize    string `json:"diskSize" validate:"required"`
	Description string `json:"description"`
}

TbDataDiskUpsizeReq is a struct to handle 'Upsize dataDisk' request toward CB-Tumblebug.

type TbDataDiskVmReq

type TbDataDiskVmReq struct {
	Name        string `json:"name" validate:"required" example:"aws-ap-southeast-1-datadisk"`
	DiskType    string `json:"diskType" example:"default"`
	DiskSize    string `json:"diskSize" validate:"required" example:"77" default:"100"`
	Description string `json:"description,omitempty"`
}

TbDataDiskVmReq is a struct to handle 'Provisioning dataDisk to VM' request toward CB-Tumblebug.

type TbFirewallRuleInfo

type TbFirewallRuleInfo struct {
	FromPort   string `validate:"required"` //`json:"fromPort"`
	ToPort     string `validate:"required"` //`json:"toPort"`
	IPProtocol string `validate:"required"` //`json:"ipProtocol"`
	Direction  string `validate:"required"` //`json:"direction"`
	CIDR       string
}

TbFirewallRuleInfo is a struct to handle firewall rule info of CB-Tumblebug.

type TbIdNameInDetailInfo

type TbIdNameInDetailInfo struct {
	IdInTb    string `json:"idInTb"`
	IdInSp    string `json:"idInSp"`
	IdInCsp   string `json:"idInCsp"`
	NameInCsp string `json:"nameInCsp"`
}

TbVmIdNameInDetailInfo is struct for details related with ID and Name

type TbImageInfo

type TbImageInfo struct {
	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`

	// CspImageName is name of the image given by CSP
	CspImageName string `json:"cspImageName,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name                 string     `json:"name" example:"aws-ap-southeast-1"`
	Namespace            string     `json:"namespace,omitempty" example:"default"` // required to save in RDB
	ConnectionName       string     `json:"connectionName,omitempty"`
	InfraType            string     `json:"infraType,omitempty"` // vm|k8s|kubernetes|container, etc.
	Description          string     `json:"description,omitempty"`
	CreationDate         string     `json:"creationDate,omitempty"`
	GuestOS              string     `json:"guestOS,omitempty"` // Windows7, Ubuntu etc.
	Status               string     `json:"status,omitempty"`  // available, unavailable
	KeyValueList         []KeyValue `json:"keyValueList,omitempty"`
	AssociatedObjectList []string   `json:"associatedObjectList,omitempty"`
	IsAutoGenerated      bool       `json:"isAutoGenerated,omitempty"`

	// SystemLabel is for describing the Resource in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel,omitempty" example:"Managed by CB-Tumblebug" default:""`
}

TbImageInfo is a struct that represents TB image object.

type TbImageReq

type TbImageReq struct {
	Name           string `json:"name" validate:"required"`
	ConnectionName string `json:"connectionName" validate:"required"`
	CspImageName   string `json:"cspImageName" validate:"required"`
	Description    string `json:"description"`
}

TbImageReq is a struct to handle 'Register image' request toward CB-Tumblebug.

type TbInspectResourcesResponse

type TbInspectResourcesResponse struct {
	InspectResources []InspectResource `json:"inspectResources"`
}

TbInspectResourcesResponse is struct for response of InspectResources request

type TbK8sAccessInfo

type TbK8sAccessInfo struct {
	Endpoint   string `json:"endpoint" example:"http://1.2.3.4:6443"`
	Kubeconfig string `json:"kubeconfig" example:"apiVersion: v1\nclusters:\n- cluster:\n certificate-authority-data: LS0..."`
}

TbK8sAccessInfo is a struct to handle K8sCluster Access information from the CB-Tumblebug's REST API response

type TbK8sAddonsInfo

type TbK8sAddonsInfo struct {
	KeyValueList []KeyValue `json:"keyValueList"`
}

TbK8sAddonsInfo is a struct to handle K8sCluster Addons information from the CB-Tumblebug's REST API response

type TbK8sClusterInfo

type TbK8sClusterInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name           string `json:"name" example:"aws-ap-southeast-1"`
	ConnectionName string `json:"connectionName" example:"alibaba-ap-northeast-2"`

	// ConnectionConfig shows connection info to cloud service provider
	ConnectionConfig ConnConfig `json:"connectionConfig"`

	Description string `json:"description" example:"My K8sCluster"`

	// Latest system message such as error message
	SystemMessage string `json:"systemMessage" example:"Failed because ..." default:""` // systeam-given string message

	// Label is for describing the object by keywords
	Label map[string]string `json:"label"`

	// SystemLabel is for describing the Resource in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel" example:"Managed by CB-Tumblebug" default:""`

	CspViewK8sClusterDetail SpiderClusterInfo `json:cspViewK8sClusterDetail,omitempty"`
}

TbK8sClusterInfo is a struct that represents TB K8sCluster object.

type TbK8sClusterNetworkInfo

type TbK8sClusterNetworkInfo struct {
	VNetId           string   `json:"vNetId" example:"vpc-01"`
	SubnetIds        []string `json:"subnetIds" example:"subnet-01"`
	SecurityGroupIds []string `json:"securityGroupIds" example:"sg-01"`

	KeyValueList []KeyValue `json:"keyValueList"`
}

TbK8sClusterNetworkInfo is a struct to handle K8sCluster Network information from the CB-Tumblebug's REST API response

type TbK8sClusterReq

type TbK8sClusterReq struct {
	//Namespace      string `json:"namespace" validate:"required" example:"default"`
	ConnectionName string `json:"connectionName" validate:"required" example:"alibaba-ap-northeast-2"`
	Description    string `json:"description" example:"My K8sCluster"`

	// (1) K8sCluster Info
	Name    string `json:"name" validate:"required" example:"k8scluster-01"`
	Version string `json:"version" example:"1.30.1-aliyun.1"`

	// (2) Network Info
	VNetId           string   `json:"vNetId" validate:"required" example:"vpc-01"`
	SubnetIds        []string `json:"subnetIds" validate:"required" example:"subnet-01"`
	SecurityGroupIds []string `json:"securityGroupIds" validate:"required" example:"sg-01"`

	// (3) NodeGroupInfo List
	K8sNodeGroupList []TbK8sNodeGroupReq `json:"k8sNodeGroupList"`

	// Fields for "Register existing K8sCluster" feature
	// @description CspResourceId is required to register a k8s cluster from CSP (option=register)
	CspResourceId string `json:"cspResourceId" example:"required when option is register"`
}

TbK8sClusterReq is a struct to handle 'Create K8sCluster' request toward CB-Tumblebug.

type TbK8sClusterStatus

type TbK8sClusterStatus string
const (
	TbK8sClusterCreating TbK8sClusterStatus = "Creating"
	TbK8sClusterActive   TbK8sClusterStatus = "Active"
	TbK8sClusterInactive TbK8sClusterStatus = "Inactive"
	TbK8sClusterUpdating TbK8sClusterStatus = "Updating"
	TbK8sClusterDeleting TbK8sClusterStatus = "Deleting"
)

type TbK8sNodeGroupInfo

type TbK8sNodeGroupInfo struct {
	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name string `json:"name" example:"aws-ap-southeast-1"`

	// Label is for describing the object by keywords
	Label map[string]string `json:"label"`

	CspViewK8sNodeGroupDetail SpiderNodeGroupInfo `json:"cspViewK8sNodeGroupDetail,omitempty"`
}

TbK8sNodeGroupInfo is a struct to handle K8sCluster's Node Group information from the CB-Tumblebug's REST API response

type TbK8sNodeGroupReq

type TbK8sNodeGroupReq struct {
	Name         string `json:"name" example:"ng-01"`
	ImageId      string `json:"imageId" example:"image-01"`
	SpecId       string `json:"specId" example:"spec-01"`
	RootDiskType string `json:"rootDiskType" example:"cloud_essd" enum:"default, TYPE1, ..."` // "", "default", "TYPE1", AWS: ["standard", "gp2", "gp3"], Azure: ["PremiumSSD", "StandardSSD", "StandardHDD"], GCP: ["pd-standard", "pd-balanced", "pd-ssd", "pd-extreme"], ALIBABA: ["cloud_efficiency", "cloud", "cloud_ssd"], TENCENT: ["CLOUD_PREMIUM", "CLOUD_SSD"]
	RootDiskSize string `json:"rootDiskSize" example:"40" enum:"default, 30, 42, ..."`        // "default", Integer (GB): ["50", ..., "1000"]
	SshKeyId     string `json:"sshKeyId" example:"sshkey-01"`

	// autoscale config.
	OnAutoScaling   string `json:"onAutoScaling" example:"true"`
	DesiredNodeSize string `json:"desiredNodeSize" example:"1"`
	MinNodeSize     string `json:"minNodeSize" example:"1"`
	MaxNodeSize     string `json:"maxNodeSize" example:"3"`
}

TbK8sNodeGroupReq is a struct to handle requests related to K8sNodeGroup toward CB-Tumblebug.

type TbK8sNodeGroupStatus

type TbK8sNodeGroupStatus string
const (
	TbK8sNodeGroupCreating TbK8sNodeGroupStatus = "Creating"
	TbK8sNodeGroupActive   TbK8sNodeGroupStatus = "Active"
	TbK8sNodeGroupInactive TbK8sNodeGroupStatus = "Inactive"
	TbK8sNodeGroupUpdating TbK8sNodeGroupStatus = "Updating"
	TbK8sNodeGroupDeleting TbK8sNodeGroupStatus = "Deleting"
)

type TbMciDynamicReq

type TbMciDynamicReq struct {
	Name string `json:"name" validate:"required" example:"mci01"`

	// InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes)
	InstallMonAgent string `json:"installMonAgent" example:"no" default:"no" enums:"yes,no"` // yes or no

	// Label is for describing the object by keywords
	Label map[string]string `json:"label"`

	// SystemLabel is for describing the mci in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel" example:"" default:""`

	Description string `json:"description" example:"Made in CB-TB"`

	Vm []TbVmDynamicReq `json:"vm" validate:"required"`
}

TbMciDynamicReq is struct for requirements to create MCI dynamically (with default resource option)

type TbMciInfo

type TbMciInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`

	// Name is human-readable string to represent the object
	Name string `json:"name" example:"aws-ap-southeast-1"`

	Status       string          `json:"status"`
	StatusCount  StatusCountInfo `json:"statusCount"`
	TargetStatus string          `json:"targetStatus"`
	TargetAction string          `json:"targetAction"`

	// InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes)
	InstallMonAgent string `json:"installMonAgent" example:"yes" default:"yes" enums:"yes,no"` // yes or no

	// ConfigureCloudAdaptiveNetwork is an option to configure Cloud Adaptive Network (CLADNet) ([yes/no] default:yes)
	ConfigureCloudAdaptiveNetwork string `json:"configureCloudAdaptiveNetwork" example:"yes" default:"no" enums:"yes,no"` // yes or no

	// Label is for describing the object by keywords
	Label map[string]string `json:"label"`

	// SystemLabel is for describing the mci in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel" example:"Managed by CB-Tumblebug" default:""`

	// Latest system message such as error message
	SystemMessage string `json:"systemMessage" example:"Failed because ..." default:""` // systeam-given string message

	PlacementAlgo string     `json:"placementAlgo,omitempty"`
	Description   string     `json:"description"`
	Vm            []TbVmInfo `json:"vm"`

	// List of IDs for new VMs. Return IDs if the VMs are newly added. This field should be used for return body only.
	NewVmList []string `json:"newVmList"`
}

TbMciInfo is struct for MCI info

type TbMciReq

type TbMciReq struct {
	Name string `json:"name" validate:"required" example:"mci01"`

	// InstallMonAgent Option for CB-Dragonfly agent installation ([yes/no] default:yes)
	InstallMonAgent string `json:"installMonAgent" example:"no" default:"yes" enums:"yes,no"` // yes or no

	// Label is for describing the object by keywords
	Label map[string]string `json:"label"`

	// SystemLabel is for describing the mci in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel" example:"" default:""`

	PlacementAlgo string `json:"placementAlgo,omitempty"`
	Description   string `json:"description" example:"Made in CB-TB"`

	Vm []TbVmReq `json:"vm" validate:"required"`
}

TbMciReq is struct for requirements to create MCI

type TbNLBAddRemoveVMReq

type TbNLBAddRemoveVMReq struct {
	TargetGroup TbNLBTargetGroupInfo `json:"targetGroup"`
}

TbNLBAddRemoveVMReq is a struct to handle 'Add/Remove VMs to/from NLB' request toward CB-Tumblebug.

type TbNLBHealthCheckerInfo

type TbNLBHealthCheckerInfo struct {
	Protocol  string `json:"protocol" example:"TCP"` // TCP|HTTP|HTTPS
	Port      string `json:"port" example:"22"`      // Listener Port or 1-65535
	Interval  int    `json:"interval" example:"10"`  // secs, Interval time between health checks.
	Timeout   int    `json:"timeout" example:"10"`   // secs, Waiting time to decide an unhealthy VM when no response.
	Threshold int    `json:"threshold" example:"3"`  // num, The number of continuous health checks to change the VM status.

	KeyValueList []KeyValue `json:"keyValueList"`
}

type TbNLBHealthCheckerReq

type TbNLBHealthCheckerReq struct {
	Interval  string `json:"interval" example:"default"`  // secs, Interval time between health checks.
	Timeout   string `json:"timeout" example:"default"`   // secs, Waiting time to decide an unhealthy VM when no response.
	Threshold string `json:"threshold" example:"default"` // num, The number of continuous health checks to change the VM status.
}

type TbNLBHealthInfo

type TbNLBHealthInfo struct {
	AllVMs       []string
	HealthyVMs   []string
	UnHealthyVMs []string
}

type TbNLBInfo

type TbNLBInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name string `json:"name" example:"aws-ap-southeast-1"`

	ConnectionName string `json:"connectionName"`

	Type  string // PUBLIC(V) | INTERNAL
	Scope string // REGION(V) | GLOBAL

	Listener TbNLBListenerInfo `json:"listener"`

	TargetGroup   TbNLBTargetGroupInfo   `json:"targetGroup"`
	HealthChecker TbNLBHealthCheckerInfo `json:"healthChecker"`

	CreatedTime time.Time

	Description          string     `json:"description"`
	Status               string     `json:"status"`
	KeyValueList         []KeyValue `json:"keyValueList"`
	AssociatedObjectList []string   `json:"associatedObjectList"`
	IsAutoGenerated      bool       `json:"isAutoGenerated"`
	Location             Location   `json:"location"`

	// SystemLabel is for describing the Resource in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel" example:"Managed by CB-Tumblebug" default:""`
}

TbNLBInfo is a struct that represents TB nlb object.

type TbNLBListenerInfo

type TbNLBListenerInfo struct {
	Protocol string `json:"protocol" example:"TCP"`                                               // TCP|UDP
	IP       string `json:"ip" example:"x.x.x.x"`                                                 // Auto Generated and attached
	Port     string `json:"port" example:"80"`                                                    // 1-65535
	DNSName  string `json:"dnsName" example:"default-group-cd3.elb.ap-northeast-2.amazonaws.com"` // Optional, Auto Generated and attached

	KeyValueList []KeyValue `json:"keyValueList"`
}

TbNLBListenerInfo is a struct to handle NLB Listener information from the CB-Tumblebug's REST API response

type TbNLBReq

type TbNLBReq struct {
	Description string `json:"description"`
	// Existing NLB (used only for option=register)
	CspResourceId string `json:"cspResourceId"`

	Type  string `json:"type" validate:"required" enums:"PUBLIC,INTERNAL" example:"PUBLIC"` // PUBLIC(V) | INTERNAL
	Scope string `json:"scope" validate:"required" enums:"REGION,GLOBAL" example:"REGION"`  // REGION(V) | GLOBAL

	// Frontend
	Listener NLBListenerReq `json:"listener" validate:"required"`
	// Backend
	TargetGroup TbNLBTargetGroupReq `json:"targetGroup" validate:"required"`
	// HealthChecker
	HealthChecker TbNLBHealthCheckerReq `json:"healthChecker" validate:"required"`
}

TbNLBReq is a struct to handle 'Create nlb' request toward CB-Tumblebug.

type TbNLBTargetGroupInfo

type TbNLBTargetGroupInfo struct {
	Protocol string `json:"protocol" example:"TCP"` // TCP|HTTP|HTTPS
	Port     string `json:"port" example:"80"`      // Listener Port or 1-65535

	SubGroupId string   `json:"subGroupId" example:"g1"`
	VMs        []string `json:"vms"`

	KeyValueList []KeyValue
}

type TbNLBTargetGroupReq

type TbNLBTargetGroupReq struct {
	Protocol   string `json:"protocol" example:"TCP"` // TCP|HTTP|HTTPS
	Port       string `json:"port" example:"80"`      // Listener Port or 1-65535
	SubGroupId string `json:"subGroupId" example:"g1"`
}

type TbRegisterSubnetReq added in v0.9.9

type TbRegisterSubnetReq struct {
	ConnectionName string `json:"connectionName" validate:"required"`
	CspResourceId  string `json:"cspResourceId" validate:"required"`
	Name           string `json:"name" validate:"required"`
	Zone           string `json:"zone,omitempty"`
	Description    string `json:"description,omitempty"`
}

type TbRegisterVNetReq added in v0.9.9

type TbRegisterVNetReq struct {
	ConnectionName string `json:"connectionName" validate:"required"`
	CspResourceId  string `json:"cspResourceId" validate:"required"`
	Name           string `json:"name" validate:"required"`
	Description    string `json:"description,omitempty"`
}

TbRegisterVNetReq TbRegisterVNetReq contains the information needed to register a vNet that has already been created via another external method.

type TbScaleOutSubGroupReq

type TbScaleOutSubGroupReq struct {
	// Define addtional VMs to scaleOut
	NumVMsToAdd string `json:"numVMsToAdd" validate:"required" example:"2"`
}

TbVmReq is struct to get requirements to create a new server instance

type TbSecurityGroupInfo

type TbSecurityGroupInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name string `json:"name" example:"aws-ap-southeast-1"`

	ConnectionName       string               `json:"connectionName"`
	VNetId               string               `json:"vNetId"`
	Description          string               `json:"description"`
	FirewallRules        []TbFirewallRuleInfo `json:"firewallRules"`
	KeyValueList         []KeyValue           `json:"keyValueList"`
	AssociatedObjectList []string             `json:"associatedObjectList"`
	IsAutoGenerated      bool                 `json:"isAutoGenerated"`

	// SystemLabel is for describing the Resource in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel" example:"Managed by CB-Tumblebug" default:""`
}

TbSecurityGroupInfo is a struct that represents TB security group object.

type TbSecurityGroupReq

type TbSecurityGroupReq struct {
	Name           string                `json:"name" validate:"required"`
	ConnectionName string                `json:"connectionName" validate:"required"`
	VNetId         string                `json:"vNetId" validate:"required"`
	Description    string                `json:"description"`
	FirewallRules  *[]TbFirewallRuleInfo `json:"firewallRules"` // validate:"required"`

	// CspResourceId is required to register object from CSP (option=register)
	CspResourceId string `json:"cspResourceId"`
}

TbSecurityGroupReq is a struct to handle 'Create security group' request toward CB-Tumblebug.

type TbSetK8sNodeGroupAutoscalingReq

type TbSetK8sNodeGroupAutoscalingReq struct {
	OnAutoScaling string `json:"onAutoScaling" example:"true"`
}

TbSetK8sNodeGroupAutoscalingReq is a struct to handle 'Set K8sNodeGroup's Autoscaling' request toward CB-Tumblebug.

type TbSetK8sNodeGroupAutoscalingRes

type TbSetK8sNodeGroupAutoscalingRes struct {
	Result string `json:"result" example:"true"`
}

TbSetK8sNodeGroupAutoscalingRes is a struct to handle 'Set K8sNodeGroup's Autoscaling' response from CB-Tumblebug.

type TbSpecInfo

type TbSpecInfo struct {
	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`

	// CspSpecName is name of the spec given by CSP
	CspSpecName string `json:"cspSpecName,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name           string `json:"name" example:"aws-ap-southeast-1"`
	Namespace      string `json:"namespace,omitempty" example:"default"`
	ConnectionName string `json:"connectionName,omitempty"`
	ProviderName   string `json:"providerName,omitempty"`
	RegionName     string `json:"regionName,omitempty"`
	// InfraType can be one of vm|k8s|kubernetes|container, etc.
	InfraType             string   `json:"infraType,omitempty"`
	OsType                string   `json:"osType,omitempty"`
	VCPU                  uint16   `json:"vCPU,omitempty"`
	MemoryGiB             float32  `json:"memoryGiB,omitempty"`
	StorageGiB            uint32   `json:"storageGiB,omitempty"`
	MaxTotalStorageTiB    uint16   `json:"maxTotalStorageTiB,omitempty"`
	NetBwGbps             uint16   `json:"netBwGbps,omitempty"`
	AcceleratorModel      string   `json:"acceleratorModel,omitempty"`
	AcceleratorCount      uint8    `json:"acceleratorCount,omitempty"`
	AcceleratorMemoryGB   float32  `json:"acceleratorMemoryGB,omitempty"`
	AcceleratorType       string   `json:"acceleratorType,omitempty"`
	CostPerHour           float32  `json:"costPerHour,omitempty"`
	Description           string   `json:"description,omitempty"`
	OrderInFilteredResult uint16   `json:"orderInFilteredResult,omitempty"`
	EvaluationStatus      string   `json:"evaluationStatus,omitempty"`
	EvaluationScore01     float32  `json:"evaluationScore01"`
	EvaluationScore02     float32  `json:"evaluationScore02"`
	EvaluationScore03     float32  `json:"evaluationScore03"`
	EvaluationScore04     float32  `json:"evaluationScore04"`
	EvaluationScore05     float32  `json:"evaluationScore05"`
	EvaluationScore06     float32  `json:"evaluationScore06"`
	EvaluationScore07     float32  `json:"evaluationScore07"`
	EvaluationScore08     float32  `json:"evaluationScore08"`
	EvaluationScore09     float32  `json:"evaluationScore09"`
	EvaluationScore10     float32  `json:"evaluationScore10"`
	RootDiskType          string   `json:"rootDiskType"`
	RootDiskSize          string   `json:"rootDiskSize"`
	AssociatedObjectList  []string `json:"associatedObjectList,omitempty"`
	IsAutoGenerated       bool     `json:"isAutoGenerated,omitempty"`

	// SystemLabel is for describing the Resource in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel,omitempty" example:"Managed by CB-Tumblebug" default:""`
}

TbSpecInfo is a struct that represents TB spec object.

type TbSpecReq

type TbSpecReq struct {
	// Name is human-readable string to represent the object, used to generate Id
	Name           string `json:"name" validate:"required"`
	ConnectionName string `json:"connectionName" validate:"required"`
	// CspSpecName is name of the spec given by CSP
	CspSpecName string `json:"cspSpecName" validate:"required"`
	Description string `json:"description"`
}

TbSpecReq is a struct to handle 'Register spec' request toward CB-Tumblebug.

type TbSshKeyInfo

type TbSshKeyInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name string `json:"name" example:"aws-ap-southeast-1"`

	ConnectionName string `json:"connectionName,omitempty"`
	Description    string `json:"description,omitempty"`

	Fingerprint          string     `json:"fingerprint,omitempty"`
	Username             string     `json:"username,omitempty"`
	VerifiedUsername     string     `json:"verifiedUsername,omitempty"`
	PublicKey            string     `json:"publicKey,omitempty"`
	PrivateKey           string     `json:"privateKey,omitempty"`
	KeyValueList         []KeyValue `json:"keyValueList,omitempty"`
	AssociatedObjectList []string   `json:"associatedObjectList,omitempty"`
	IsAutoGenerated      bool       `json:"isAutoGenerated,omitempty"`

	// SystemLabel is for describing the Resource in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel,omitempty" example:"Managed by CB-Tumblebug" default:""`
}

TbSshKeyInfo is a struct that represents TB SSH key object.

type TbSshKeyReq

type TbSshKeyReq struct {
	Name           string `json:"name" validate:"required"`
	ConnectionName string `json:"connectionName" validate:"required"`
	Description    string `json:"description"`

	// Fields for "Register existing SSH keys" feature
	// CspResourceId is required to register object from CSP (option=register)
	CspResourceId    string `json:"cspResourceId"`
	Fingerprint      string `json:"fingerprint"`
	Username         string `json:"username"`
	VerifiedUsername string `json:"verifiedUsername"`
	PublicKey        string `json:"publicKey"`
	PrivateKey       string `json:"privateKey"`
}

TbSshKeyReq is a struct to handle 'Create SSH key' request toward CB-Tumblebug.

type TbSubGroupInfo

type TbSubGroupInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// Name is human-readable string to represent the object
	Name string `json:"name" example:"aws-ap-southeast-1"`

	VmId         []string `json:"vmId"`
	SubGroupSize string   `json:"subGroupSize"`
}

TbSubGroupInfo is struct to define an object that includes homogeneous VMs

type TbSubnetInfo

type TbSubnetInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name           string `json:"name" example:"aws-ap-southeast-1"`
	ConnectionName string `json:"connectionName"`
	// CspVNetName is identifier to handle CSP vNet resource
	CspVNetName string `json:"cspVNetName,omitempty" example:"we12fawefadf1221edcf"`
	// CspVNetId is vNet resource identifier managed by CSP
	CspVNetId    string        `json:"cspResourceId,omitempty" example:"csp-45eb41e14121c550a"`
	Status       string        `json:"status"`
	IPv4_CIDR    string        `json:"ipv4_CIDR"`
	Zone         string        `json:"zone,omitempty"`
	BastionNodes []BastionNode `json:"bastionNodes,omitempty"`
	KeyValueList []KeyValue    `json:"keyValueList,omitempty"`
	Description  string        `json:"description"`
}

TbSubnetInfo is a struct that represents TB subnet object.

type TbSubnetReq

type TbSubnetReq struct {
	Name        string `json:"name" validate:"required" example:"subnet00"`
	IPv4_CIDR   string `json:"ipv4_CIDR" validate:"required" example:"10.0.1.0/24"`
	Zone        string `json:"zone,omitempty"`
	Description string `json:"description,omitempty" example:"subnet00 managed by CB-Tumblebug"`
}

TbSubnetReq is a struct that represents TB subnet object.

type TbUpgradeK8sClusterReq

type TbUpgradeK8sClusterReq struct {
	Version string `json:"version" example:"1.30.1-alyun.1"`
}

TbUpgradeK8sClusterReq is a struct to handle 'Upgrade K8sCluster' request toward CB-Tumblebug.

type TbVNetInfo

type TbVNetInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name                 string         `json:"name" example:"aws-ap-southeast-1"`
	ConnectionName       string         `json:"connectionName"`
	CidrBlock            string         `json:"cidrBlock"`
	SubnetInfoList       []TbSubnetInfo `json:"subnetInfoList"`
	Description          string         `json:"description"`
	Status               string         `json:"status"`
	KeyValueList         []KeyValue     `json:"keyValueList,omitempty"`
	AssociatedObjectList []string       `json:"associatedObjectList"`
	IsAutoGenerated      bool           `json:"isAutoGenerated"`

	// SystemLabel is for describing the Resource in a keyword (any string can be used) for special System purpose
	SystemLabel string `json:"systemLabel" example:"Managed by CB-Tumblebug" default:""`
}

TbVNetInfo is a struct that represents TB vNet object.

type TbVNetReq

type TbVNetReq struct {
	Name           string        `json:"name" validate:"required" example:"vnet00"`
	ConnectionName string        `json:"connectionName" validate:"required" example:"aws-ap-northeast-2"`
	CidrBlock      string        `json:"cidrBlock" example:"10.0.0.0/16"`
	SubnetInfoList []TbSubnetReq `json:"subnetInfoList"`
	Description    string        `json:"description" example:"vnet00 managed by CB-Tumblebug"`
}

TbVNetReq is a struct to handle 'Create vNet' request toward CB-Tumblebug.

type TbVmDynamicReq

type TbVmDynamicReq struct {
	// VM name or subGroup name if is (not empty) && (> 0). If it is a group, actual VM name will be generated with -N postfix.
	Name string `json:"name" example:"g1-1"`

	// if subGroupSize is (not empty) && (> 0), subGroup will be generated. VMs will be created accordingly.
	SubGroupSize string `json:"subGroupSize" example:"3" default:"1"`

	// Label is for describing the object by keywords
	Label map[string]string `json:"label"`

	Description string `json:"description" example:"Description"`

	// CommonSpec is field for id of a spec in common namespace
	CommonSpec string `json:"commonSpec" validate:"required" example:"aws+ap-northeast-2+t2.small"`
	// CommonImage is field for id of a image in common namespace
	CommonImage string `json:"commonImage" validate:"required" example:"ubuntu18.04"`

	RootDiskType string `json:"rootDiskType,omitempty" example:"default, TYPE1, ..." default:"default"`  // "", "default", "TYPE1", AWS: ["standard", "gp2", "gp3"], Azure: ["PremiumSSD", "StandardSSD", "StandardHDD"], GCP: ["pd-standard", "pd-balanced", "pd-ssd", "pd-extreme"], ALIBABA: ["cloud_efficiency", "cloud", "cloud_essd"], TENCENT: ["CLOUD_PREMIUM", "CLOUD_SSD"]
	RootDiskSize string `json:"rootDiskSize,omitempty" example:"default, 30, 42, ..." default:"default"` // "default", Integer (GB): ["50", ..., "1000"]

	VmUserPassword string `json:"vmUserPassword,omitempty" default:""`
	// if ConnectionName is given, the VM tries to use associtated credential.
	// if not, it will use predefined ConnectionName in Spec objects
	ConnectionName string `json:"connectionName,omitempty" default:""`
}

TbVmDynamicReq is struct to get requirements to create a new server instance dynamically (with default resource option)

type TbVmInfo

type TbVmInfo struct {
	// ResourceType is the type of the resource
	ResourceType string `json:"resourceType"`

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name string `json:"name" example:"aws-ap-southeast-1"`

	// defined if the VM is in a group
	SubGroupId string `json:"subGroupId"`

	Location Location `json:"location"`

	// Required by CB-Tumblebug
	Status       string `json:"status"`
	TargetStatus string `json:"targetStatus"`
	TargetAction string `json:"targetAction"`

	// Montoring agent status
	MonAgentStatus string `json:"monAgentStatus" example:"[installed, notInstalled, failed]"` // yes or no// installed, notInstalled, failed

	// NetworkAgent status
	NetworkAgentStatus string `json:"networkAgentStatus" example:"[notInstalled, installing, installed, failed]"` // notInstalled, installing, installed, failed

	// Latest system message such as error message
	SystemMessage string `json:"systemMessage" example:"Failed because ..." default:""` // systeam-given string message

	// Created time
	CreatedTime string `json:"createdTime" example:"2022-11-10 23:00:00" default:""`

	Label       map[string]string `json:"label"`
	Description string            `json:"description"`

	Region         RegionInfo `json:"region"` // AWS, ex) {us-east1, us-east1-c} or {ap-northeast-2}
	PublicIP       string     `json:"publicIP"`
	SSHPort        string     `json:"sshPort"`
	PublicDNS      string     `json:"publicDNS"`
	PrivateIP      string     `json:"privateIP"`
	PrivateDNS     string     `json:"privateDNS"`
	RootDiskType   string     `json:"rootDiskType"`
	RootDiskSize   string     `json:"rootDiskSize"`
	RootDeviceName string     `json:"rootDeviceName"`

	ConnectionName   string     `json:"connectionName"`
	ConnectionConfig ConnConfig `json:"connectionConfig"`
	SpecId           string     `json:"specId"`
	CspSpecName      string     `json:"cspSpecName"`
	ImageId          string     `json:"imageId"`
	CspImageName     string     `json:"cspImageName"`
	VNetId           string     `json:"vNetId"`
	CspVNetId        string     `json:"cspVNetId"`
	SubnetId         string     `json:"subnetId"`
	CspSubnetId      string     `json:"cspSubnetId"`
	NetworkInterface string     `json:"networkInterface"`
	SecurityGroupIds []string   `json:"securityGroupIds"`
	DataDiskIds      []string   `json:"dataDiskIds"`
	SshKeyId         string     `json:"sshKeyId"`
	CspSshKeyId      string     `json:"cspSshKeyId"`
	VmUserName       string     `json:"vmUserName,omitempty"`
	VmUserPassword   string     `json:"vmUserPassword,omitempty"`

	AddtionalDetails []KeyValue `json:"addtionalDetails,omitempty"`
}

TbVmInfo is struct to define a server instance object

type TbVmPriority

type TbVmPriority struct {
	Priority string     `json:"priority"`
	VmSpec   TbSpecInfo `json:"vmSpec"`
}

TbVmPriority is struct for TbVmPriority

type TbVmRecommendInfo

type TbVmRecommendInfo struct {
	VmReq          TbVmRecommendReq `json:"vmReq"`
	VmPriority     []TbVmPriority   `json:"vmPriority"`
	PlacementAlgo  string           `json:"placementAlgo"`
	PlacementParam []KeyValue       `json:"placementParam"`
}

TbVmRecommendInfo is struct for TbVmRecommendInfo

type TbVmRecommendReq

type TbVmRecommendReq struct {
	RequestName  string `json:"requestName"`
	MaxResultNum string `json:"maxResultNum"`

	VcpuSize   string `json:"vcpuSize"`
	MemorySize string `json:"memorySize"`
	DiskSize   string `json:"diskSize"`

	PlacementAlgo  string     `json:"placementAlgo"`
	PlacementParam []KeyValue `json:"placementParam"`
}

TbVmRecommendReq is struct for TbVmRecommendReq

type TbVmReq

type TbVmReq struct {
	// VM name or subGroup name if is (not empty) && (> 0). If it is a group, actual VM name will be generated with -N postfix.
	Name string `json:"name" validate:"required" example:"g1-1"`

	// CspResourceId is resource identifier managed by CSP (required for option=register)
	CspResourceId string `json:"cspResourceId,omitempty" example:"i-014fa6ede6ada0b2c"`

	// if subGroupSize is (not empty) && (> 0), subGroup will be generated. VMs will be created accordingly.
	SubGroupSize string `json:"subGroupSize" example:"3" default:""`

	// Label is for describing the object by keywords
	Label map[string]string `json:"label"`

	Description string `json:"description" example:"Description"`

	ConnectionName string `json:"connectionName" validate:"required" example:"testcloud01-seoul"`
	SpecId         string `json:"specId" validate:"required"`
	// ImageType        string   `json:"imageType"`
	ImageId          string   `json:"imageId" validate:"required"`
	VNetId           string   `json:"vNetId" validate:"required"`
	SubnetId         string   `json:"subnetId" validate:"required"`
	SecurityGroupIds []string `json:"securityGroupIds" validate:"required"`
	SshKeyId         string   `json:"sshKeyId" validate:"required"`
	VmUserName       string   `json:"vmUserName,omitempty"`
	VmUserPassword   string   `json:"vmUserPassword,omitempty"`
	RootDiskType     string   `json:"rootDiskType,omitempty" example:"default, TYPE1, ..."`  // "", "default", "TYPE1", AWS: ["standard", "gp2", "gp3"], Azure: ["PremiumSSD", "StandardSSD", "StandardHDD"], GCP: ["pd-standard", "pd-balanced", "pd-ssd", "pd-extreme"], ALIBABA: ["cloud_efficiency", "cloud", "cloud_ssd"], TENCENT: ["CLOUD_PREMIUM", "CLOUD_SSD"]
	RootDiskSize     string   `json:"rootDiskSize,omitempty" example:"default, 30, 42, ..."` // "default", Integer (GB): ["50", ..., "1000"]
	DataDiskIds      []string `json:"dataDiskIds"`
}

TbVmReq is struct to get requirements to create a new server instance

type TbVmSnapshotReq

type TbVmSnapshotReq struct {
	Name string `json:"name" example:"aws-ap-southeast-1-snapshot"`
}

TbVmSnapshotReq is a struct to handle 'Create VM snapshot' request toward CB-Tumblebug.

type TbVmStatusInfo

type TbVmStatusInfo struct {

	// Id is unique identifier for the object
	Id string `json:"id" example:"aws-ap-southeast-1"`
	// Uid is universally unique identifier for the object, used for labelSelector
	Uid string `json:"uid,omitempty" example:"wef12awefadf1221edcf"`
	// CspResourceName is name assigned to the CSP resource. This name is internally used to handle the resource.
	CspResourceName string `json:"cspResourceName,omitempty" example:"we12fawefadf1221edcf"`
	// CspResourceId is resource identifier managed by CSP
	CspResourceId string `json:"cspResourceId,omitempty" example:"csp-06eb41e14121c550a"`

	// Name is human-readable string to represent the object
	Name string `json:"name" example:"aws-ap-southeast-1"`

	Status       string `json:"status"`
	TargetStatus string `json:"targetStatus"`
	TargetAction string `json:"targetAction"`
	NativeStatus string `json:"nativeStatus"`

	// Montoring agent status
	MonAgentStatus string `json:"monAgentStatus" example:"[installed, notInstalled, failed]"` // yes or no// installed, notInstalled, failed

	// Latest system message such as error message
	SystemMessage string `json:"systemMessage" example:"Failed because ..." default:""` // systeam-given string message

	// Created time
	CreatedTime string `json:"createdTime" example:"2022-11-10 23:00:00" default:""`

	PublicIp  string `json:"publicIp"`
	PrivateIp string `json:"privateIp"`
	SSHPort   string `json:"sshPort"`

	Location Location `json:"location"`
}

TbVmStatusInfo is to define simple information of VM with updated status

type VNetDesignRequest added in v0.9.10

type VNetDesignRequest struct {
	TargetPrivateNetwork string      `json:"targetPrivateNetwork"`
	SupernettingEnabled  string      `json:"supernettingEnabled"`
	CspRegions           []CspRegion `json:"cspRegions"`
}

VNetDesignRequest is a struct to handle the utility function, DesignVNet()

type VNetDesignResponse added in v0.9.10

type VNetDesignResponse struct {
	RootNetworkCIDR string      `json:"rootNetworkCIDR,omitempty"` // in case of supernetting enabled
	VNetReqList     []TbVNetReq `json:"vNetReqList"`
}

Jump to

Keyboard shortcuts

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