mcis

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SPIDER_URL string

Functions

func BenchmarkAction added in v0.1.4

func BenchmarkAction(nsId string, mcisId string, action string, option string) (multiInfo, error)

func Close added in v0.1.4

func Close(client scp.Client)

func Connect added in v0.1.4

func Connect(sshInfo SSHInfo) (scp.Client, error)

func ConnectKeyPath added in v0.1.4

func ConnectKeyPath(sshKeyPathInfo SSHKeyPathInfo) (scp.Client, error)

func Copy added in v0.1.4

func Copy(client scp.Client, sourcePath string, remotePath string) error

func InstallAgentToMcis added in v0.1.9

func InstallAgentToMcis(nsId string, mcisId string, req *mcisCmdReq) (agentInstallContent, error)

func RestCheckMcis

func RestCheckMcis(c echo.Context) error

func RestCheckVm

func RestCheckVm(c echo.Context) error

func RestDelAllMcis

func RestDelAllMcis(c echo.Context) error

func RestDelMcis

func RestDelMcis(c echo.Context) error

func RestDelMcisVm

func RestDelMcisVm(c echo.Context) error

func RestGetAllBenchmark added in v0.1.9

func RestGetAllBenchmark(c echo.Context) error

func RestGetAllMcis

func RestGetAllMcis(c echo.Context) error

func RestGetBenchmark added in v0.1.4

func RestGetBenchmark(c echo.Context) error

func RestGetMcis

func RestGetMcis(c echo.Context) error

func RestGetMcisVm

func RestGetMcisVm(c echo.Context) error

func RestPostCmdMcis added in v0.1.4

func RestPostCmdMcis(c echo.Context) error

func RestPostCmdMcisVm added in v0.1.4

func RestPostCmdMcisVm(c echo.Context) error

func RestPostInstallAgentToMcis added in v0.1.4

func RestPostInstallAgentToMcis(c echo.Context) error

func RestPostMcis

func RestPostMcis(c echo.Context) error

func RestPostMcisRecommand

func RestPostMcisRecommand(c echo.Context) error

func RestPostMcisVm

func RestPostMcisVm(c echo.Context) error

func RestPutMcis

func RestPutMcis(c echo.Context) error

func RestPutMcisVm

func RestPutMcisVm(c echo.Context) error

func RunCommand added in v0.1.4

func RunCommand(client scp.Client, cmd string) (string, error)

func RunSSH added in v0.1.4

func RunSSH(vmIP string, userName string, privateKey string, cmd string) (*string, error)

func RunSSHAsync added in v0.1.5

func RunSSHAsync(wg *sync.WaitGroup, vmID string, vmIP string, userName string, privateKey string, cmd string, returnResult *[]sshResult)

func SSHCopy added in v0.1.4

func SSHCopy(sshInfo SSHInfo, sourcePath string, remotePath string) error

func SSHCopyByKeyPath added in v0.1.4

func SSHCopyByKeyPath(sshInfo SSHKeyPathInfo, sourcePath string, remotePath string) error

func SSHRun added in v0.1.4

func SSHRun(sshInfo SSHInfo, cmd string) (string, error)

=============== for One Call Service

func SSHRunByKeyPath added in v0.1.4

func SSHRunByKeyPath(sshInfo SSHKeyPathInfo, cmd string) (string, error)

func ValidateStatus added in v0.1.7

func ValidateStatus()

Types

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type RegionInfo

type RegionInfo struct {
	Region string
	Zone   string
}

type SSHInfo added in v0.1.4

type SSHInfo struct {
	UserName   string // ex) "root"
	PrivateKey []byte // ex)   []byte(`-----BEGIN RSA PRIVATE KEY-----
	//              MIIEoQIBAAKCAQEArVNOLwMIp5VmZ4VPZotcoCHdEzimKalAsz+ccLfvAA1Y2ELH
	//              ...`)
	ServerPort string // ex) "node12:22"
}

====================================================================

type SSHKeyPathInfo added in v0.1.4

type SSHKeyPathInfo struct {
	UserName   string // ex) "root"
	KeyPath    string // ex) "/root/.ssh/id_rsa // You should use the full path.
	ServerPort string // ex) "node12:22"
}

====================================================================

type VMInfo added in v0.1.3

type VMInfo struct {
	IId               common.IID // {NameId, SystemId}
	ImageIId          common.IID
	VpcIID            common.IID
	SubnetIID         common.IID   // AWS, ex) subnet-8c4a53e4
	SecurityGroupIIds []common.IID // AWS, ex) sg-0b7452563e1121bb6
	KeyPairIId        common.IID
	VMSpecName        string //  instance type or flavour, etc... ex) t2.micro or f1.micro

	StartTime time.Time // Timezone: based on cloud-barista server location.

	Region RegionInfo //  ex) {us-east1, us-east1-c} or {ap-northeast-2}

	VMUserId     string // ex) user1
	VMUserPasswd string

	NetworkInterface string // ex) eth0
	PublicIP         string
	PublicDNS        string
	PrivateIP        string
	PrivateDNS       string

	VMBootDisk  string // ex) /dev/sda1
	VMBlockDisk string // ex)

	KeyValueList []KeyValue
}

type VMOperation added in v0.1.7

type VMOperation string

type VMReqInfo added in v0.1.3

type VMReqInfo struct {
	Name               string
	ImageName          string
	VPCName            string
	SubnetName         string
	SecurityGroupNames []string
	VMSpecName         string
	KeyPairName        string

	VMUserId     string
	VMUserPasswd string
}

type VMStatus added in v0.1.3

type VMStatus string // Spider

GO do not support Enum. So, define like this.

const (
	Creating VMStatus = "Creating" // from launch to running
	Running  VMStatus = "Running"

	Suspending VMStatus = "Suspending" // from running to suspended
	Suspended  VMStatus = "Suspended"
	Resuming   VMStatus = "Resuming" // from suspended to running

	Rebooting VMStatus = "Rebooting" // from running to running

	Terminating VMStatus = "Terminating" // from running, suspended to terminated
	Terminated  VMStatus = "Terminated"
	NotExist    VMStatus = "NotExist" // VM does not exist

	Failed VMStatus = "Failed"
)

type VMStatusInfo added in v0.1.3

type VMStatusInfo struct {
	VmStatus VMStatus
}

Jump to

Keyboard shortcuts

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