tumblebug

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Model
	ConfigName     string `json:"ConfigName"`
	ProviderName   string `json:"ProviderName"`
	DriverName     string `json:"DriverName"`
	CredentialName string `json:"CredentialName"`
	RegionName     string `json:"RegionName"`
}

Connection info.

func NewConnection

func NewConnection(name string) *Connection

instance of a Connection Info.

func (*Connection) GET

func (self *Connection) GET() (bool, error)

get a connection info.

type Firewall

type Firewall struct {
	Model
	Config               string          `json:"connectionName"`
	VPCId                string          `json:"vNetId"`
	Description          string          `json:"description"`
	FirewallRules        []FirewallRules `json:"firewallRules"`
	CspSecurityGroupId   string          `json:"cspSecurityGroupId"`   // output
	CspSecurityGroupName string          `json:"cspSecurityGroupName"` // output
	KeyValueList         []KeyValue      `json:"keyValueList"`         // output
}

func NewFirewall

func NewFirewall(csp app.CSP, ns string, name string, conf string) *Firewall

new instance of Firewall

func (*Firewall) DELETE

func (self *Firewall) DELETE(ns string) (bool, error)

func (*Firewall) GET

func (self *Firewall) GET() (bool, error)

Firewall

func (*Firewall) POST

func (self *Firewall) POST() error

type FirewallRules

type FirewallRules struct {
	From      string `json:"fromPort"`
	To        string `json:"toPort"`
	Protocol  string `json:"ipProtocol"`
	Direction string `json:"direction"`
}

type HealthCheck

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

type Image

type Image struct {
	Model
	Config       string     `json:"connectionName"`
	CspImageId   string     `json:"cspImageId"`
	CspImageName string     `json:"cspImageName"` // output
	CreationDate string     `json:"creationDate"` // output
	Description  string     `json:"description"`  //
	GuestOS      string     `json:"guestOS"`      //
	Status       string     `json:"status"`       // output
	KeyValueList []KeyValue `json:"keyValueList"` // output
}

func NewImage

func NewImage(ns string, name string, conf string) *Image

new instance of VM-Image

func (*Image) DELETE

func (self *Image) DELETE(ns string) (bool, error)

func (*Image) GET

func (self *Image) GET() (bool, error)

VM-Image

func (*Image) POST

func (self *Image) POST() error

type KeyValue

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

type LookupImages

type LookupImages struct {
	Model
	ConnectionName string `json:"connectionName"`
	Images         []struct {
		Name string `json:"name"`
		IId  struct {
			NameId   string `json:"nameId"`   // output - NameID by user
			SystemId string `json:"systemId"` // output - SystemID by CloudOS
		} `json:"iid"`
		GuestOS      string     `json:"guestOS"`      // output - Windows7, Ubuntu etc.
		Status       string     `json:"status"`       // output - available, unavailable
		KeyValueList []KeyValue `json:"keyValueList"` //output -
	} `json:"image"`
}

func NewLookupImages

func NewLookupImages(conf string) *LookupImages

new instance of VM-Image lookup

func (*LookupImages) GET

func (self *LookupImages) GET() (bool, error)

Look up (VM-Image, VM-Spec)

type LookupSpec

type LookupSpec struct {
	Model
	Config string `json:"connectionName"`
	Spec   string `json:"cspSpecName"`
	Region string `json:"region"` // output
	Memory string `json:"mem"`    // output
	CPU    struct {
		Count string `json:"count"` // output
		Clock string `json:"clock"` // output - GHz
	} `json:"vcpu"`
}

func NewLookupSpec

func NewLookupSpec(conf string, spec string) *LookupSpec

new instance of VM-Spec-lookup

func (*LookupSpec) GET

func (spec *LookupSpec) GET() (bool, error)

type LookupSpecs

type LookupSpecs struct {
	Model
	Config  string `json:"connectionName"`
	Vmspecs []struct {
		Name   string `json:"name"` // output
		Memory string `json:"mem"`  // output
		CPU    struct {
			Count string `json:"count"` // output
			Clock string `json:"clock"` // output - GHz
		} `json:"vcpu"`
	} `json:"vmspec"`
}

func NewLookupSpecs

func NewLookupSpecs(conf string) *LookupSpecs

new instance of VM-Specs-lookup

func (*LookupSpecs) GET

func (spec *LookupSpecs) GET() (bool, error)

type MCIS

type MCIS struct {
	Model
	Description     string `json:"description"`
	Label           string `json:"label"`
	SystemLabel     string `json:"systemLabel"`
	InstallMonAgent string `json:"installMonAgent"`
	Status          string `json:"status"`
	VMs             []VM   `json:"vm"` // output
}

MCIS

func NewMCIS

func NewMCIS(ns string, name string) *MCIS

instance of a MCIS

func (*MCIS) DELETE

func (self *MCIS) DELETE() (bool, error)

func (*MCIS) FindVM

func (self *MCIS) FindVM(name string) *VM

func (*MCIS) GET

func (self *MCIS) GET() (bool, error)

MCIS

func (*MCIS) POST

func (self *MCIS) POST() error

func (*MCIS) REFINE

func (self *MCIS) REFINE() error

func (*MCIS) TERMINATE

func (self *MCIS) TERMINATE() error

type Model

type Model struct {
	Name      string `json:"name"`
	Namespace string
}

type NLB

type NLB struct {
	NLBBase
	HealthChecker HealthCheck `json:"healthChecker"`
}

func NewNLB

func NewNLB(ns string, mcisName string, groupId string, config string) *NLB

new instance of NLB

func (*NLB) DELETE

func (self *NLB) DELETE() (bool, error)

func (*NLB) GET

func (self *NLB) GET() (bool, error)

NLB

func (*NLB) POST

func (self *NLB) POST() error

type NLBBase

type NLBBase struct {
	Model
	Config      string          `json:"connectionName"`
	VPC         string          `json:"vNetId"`
	Type        string          `json:"type" enums:"PUBLIC,INTERNAL"`
	Scope       string          `json:"scope" enums:"REGION,GLOBAL"`
	Listener    NLBProtocolBase `json:"listener"`
	TargetGroup TargetGroup     `json:"targetGroup"`
}

NLB

type NLBProtocolBase

type NLBProtocolBase struct {
	Protocol string `json:"protocol"` // TCP|UDP
	Port     string `json:"port"`     // 1-65535
	Ip       string `json:"ip"`
}

type NS

type NS struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

Namespace

func NewNS

func NewNS(ns string) *NS

func (*NS) GET

func (self *NS) GET() (bool, error)

type Region

type Region struct {
	Model
	RegionName       string     `json:"RegionName"`
	ProviderName     string     `json:"ProviderName"`
	KeyValueInfoList []KeyValue `json:"KeyValueInfoList"`
}

func NewRegion

func NewRegion(name string) *Region

instance of a Region

func (*Region) GET

func (self *Region) GET() (bool, error)

get a region

type SSHKey

type SSHKey struct {
	Model
	Config     string `json:"connectionName"`
	Username   string `json:"username"`
	PrivateKey string `json:"privateKey"` // output
}

func NewSSHKey

func NewSSHKey(ns string, name string, conf string) *SSHKey

new instance of SSH-Key

func (*SSHKey) DELETE

func (self *SSHKey) DELETE(ns string) (bool, error)

func (*SSHKey) GET

func (self *SSHKey) GET() (bool, error)

SSH-Key

func (*SSHKey) POST

func (self *SSHKey) POST() error

type Spec

type Spec struct {
	Model
	Config      string `json:"connectionName"`
	CspSpecName string `json:"cspSpecName"`
}

func NewSpec

func NewSpec(ns string, name string, conf string) *Spec

new instance of VM-Spec.

func (*Spec) DELETE

func (self *Spec) DELETE(ns string) (bool, error)

func (*Spec) GET

func (self *Spec) GET() (bool, error)

VM-Spec

func (*Spec) POST

func (self *Spec) POST() error

type Subnet

type Subnet struct {
	Name      string `json:"Name"`
	CidrBlock string `json:"IPv4_CIDR"`
}

type TargetGroup

type TargetGroup struct {
	NLBProtocolBase
	MCIS      string `json:"mcis"`
	VmGroupId string `json:"subGroupId"`
}

type VM

type VM struct {
	Model
	McisName      string
	VmGroupId     string   `json:"subGroupId"`
	VmGroupSize   string   `json:"subGroupSize"`
	Config        string   `json:"connectionName"`
	VPC           string   `json:"vNetId"`
	Subnet        string   `json:"subnetId"`
	Firewalls     []string `json:"securityGroupIds"`
	SSHKey        string   `json:"sshKeyId"`
	Image         string   `json:"imageId"`
	Spec          string   `json:"specId"`
	UserAccount   string   `json:"vmUserAccount"`
	UserPassword  string   `json:"vmUserPassword"`
	Description   string   `json:"description"`
	PublicIP      string   `json:"publicIP"`                                 // output
	PrivateIP     string   `json:"privateIP"`                                // output
	Status        VMStatus `json:"status"`                                   // output
	SystemMessage string   `json:"systemMessage"`                            // output
	RootDiskType  string   `json:"rootDiskType,omitempty" example:"default"` // "", "default", "TYPE1", AWS: ["standard", "gp2", "gp3"], Azure: ["PremiumSSD", "StandardSSD", "StandardHHD"], 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"` // "default", Integer (GB): ["50", ..., "1000"]
	Region        struct {
		Region string `json:"region"`
		Zone   string `json:"zone"`
	} `json:"region"` // output
	CspViewVmDetail struct {
		VMSpecName string `json:"vmspecName"`
		IId        struct {
			SystemId string `json:"systemId"`
		} `json:"iid"`
		SecurityGroupIIds []struct {
			SystemId string `json:"systemId"`
		} `json:"securityGroupIIds"`
		SubnetIID struct {
			SystemId string `json:"systemId"`
		} `json:"subnetIID"`
	} `json:"cspViewVmDetail"` // output

}

func NewVM

func NewVM(namespace string, name string, mcisName string) *VM

instance of a VM

func (*VM) DELETE

func (self *VM) DELETE() (bool, error)

func (*VM) GET

func (self *VM) GET() (bool, error)

VM

func (*VM) GetNameInCsp

func (self *VM) GetNameInCsp() (string, error)

func (*VM) POST

func (self *VM) POST() error

type VMStatus

type VMStatus string
const (
	VM_USER_ACCOUNT = "cb-user"

	VMSTATUS_CREATING VMStatus = "Creating" // from launch to running
	VMSTATUS_RUNNING  VMStatus = "Running"
	VMSTATUS_FAILED   VMStatus = "Failed"
)

type VPC

type VPC struct {
	Model
	Config       string     `json:"connectionName"`
	CidrBlock    string     `json:"cidrBlock"`
	Subnets      []Subnet   `json:"subnetInfoList"`
	Description  string     `json:"description"`
	CspVNetId    string     `json:"cspVNetId"`    // output
	CspVNetName  string     `json:"cspVNetName"`  // output
	Status       string     `json:"status"`       // output
	KeyValueList []KeyValue `json:"keyValueList"` // output
}

MCIR

func NewVPC

func NewVPC(ns string, name string, conf string, cidrBlock string, cidrSubnet string) *VPC

new instance of VPC

func (*VPC) DELETE

func (self *VPC) DELETE() (bool, error)

func (*VPC) GET

func (self *VPC) GET() (bool, error)

VPC

func (*VPC) POST

func (self *VPC) POST() error

Jump to

Keyboard shortcuts

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