restruntime

package
v0.0.0-...-8fc61e2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

README

runtime for REST-based API.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSubnet

func AddSubnet(c echo.Context) error

(1) get subnet info from REST Call (2) call common-runtime API (3) return REST Json Format

func ApiServer

func ApiServer(routes []route)

================ REST API Server: setup & start

func ControlVM

func ControlVM(c echo.Context) error

func CreateConnectionConfig

func CreateConnectionConfig(c echo.Context) error

================ ConnectionConfig Handler

func CreateImage

func CreateImage(c echo.Context) error

================ Image Handler

func CreateKey

func CreateKey(c echo.Context) error

createKey godoc @Summary Create SSH Key @Description Create SSH Key @Tags [CCM] Access key management @Accept json @Produce json @Param keyPairCreateReq body JSONResult{ConnectionName=string,ReqInfo=JSONResult{Name=string}} true "Request body to create key" @Success 200 {object} resources.KeyPairInfo @Failure 404 {object} SimpleMsg @Failure 500 {object} SimpleMsg @Router /keypair [post]

func CreateSecurity

func CreateSecurity(c echo.Context) error
// createSecurity godoc

// @Summary Create Security Group // @Description Create Security Group // @Tags [CCM] Security Group management // @Accept json // @Produce json // @Param securityGroupCreateReq body securityGroupCreateReq true "Request body to create Security Group" // @Success 200 {object} resources.SecurityInfo // @Failure 404 {object} SimpleMsg // @Failure 500 {object} SimpleMsg // @Router /securitygroup [post]

func CreateVPC

func CreateVPC(c echo.Context) error

createVPC godoc @Summary Create VPC @Description Create VPC @Tags [CCM] VPC management @Accept json @Produce json @Param vpcCreateReq body vpcCreateReq true "Request body to create VPC" @Success 200 {object} resources.VPCInfo @Failure 404 {object} SimpleMsg @Failure 500 {object} SimpleMsg @Router /vpc [post]

func DeleteCSPKey

func DeleteCSPKey(c echo.Context) error

(1) get args from REST Call (2) call common-runtime API (3) return REST Json Format

func DeleteCSPSecurity

func DeleteCSPSecurity(c echo.Context) error

(1) get args from REST Call (2) call common-runtime API (3) return REST Json Format

func DeleteCSPVPC

func DeleteCSPVPC(c echo.Context) error

(1) get args from REST Call (2) call common-runtime API (3) return REST Json Format

func DeleteConnectionConfig

func DeleteConnectionConfig(c echo.Context) error

func DeleteImage

func DeleteImage(c echo.Context) error

func DeleteKey

func DeleteKey(c echo.Context) error

(1) get args from REST Call (2) call common-runtime API (3) return REST Json Format

func DeleteSecurity

func DeleteSecurity(c echo.Context) error

(1) get args from REST Call (2) call common-runtime API (3) return REST Json Format

func DeleteVPC

func DeleteVPC(c echo.Context) error

(1) get args from REST Call (2) call common-runtime API (3) return REST Json Format

func EndpointInfo

func EndpointInfo(c echo.Context) error

================ Endpoint Info

func GetCloudDriver

func GetCloudDriver(c echo.Context) error

func GetConnectionConfig

func GetConnectionConfig(c echo.Context) error

func GetCredential

func GetCredential(c echo.Context) error

func GetImage

func GetImage(c echo.Context) error

func GetKey

func GetKey(c echo.Context) error

func GetOrgVMSpec

func GetOrgVMSpec(c echo.Context) error

func GetRegion

func GetRegion(c echo.Context) error

func GetSecurity

func GetSecurity(c echo.Context) error

func GetVM

func GetVM(c echo.Context) error

func GetVMSpec

func GetVMSpec(c echo.Context) error

func GetVMStatus

func GetVMStatus(c echo.Context) error

func GetVPC

func GetVPC(c echo.Context) error

func ListAllKey

func ListAllKey(c echo.Context) error

list all KeyPairs for management (1) get args from REST Call (2) get all KeyPair List by common-runtime API (3) return REST Json Format

func ListAllSecurity

func ListAllSecurity(c echo.Context) error

list all SGs for management (1) get args from REST Call (2) get all SG List by common-runtime API (3) return REST Json Format

func ListAllVM

func ListAllVM(c echo.Context) error

list all VMs for management (1) get args from REST Call (2) get all VM List by common-runtime API (3) return REST Json Format

func ListAllVPC

func ListAllVPC(c echo.Context) error

list all VPCs for management (1) get args from REST Call (2) get all VPC List by common-runtime API (3) return REST Json Format

func ListCloudDriver

func ListCloudDriver(c echo.Context) error

func ListCloudOS

func ListCloudOS(c echo.Context) error

================ List of support CloudOS

func ListConnectionConfig

func ListConnectionConfig(c echo.Context) error

func ListCredential

func ListCredential(c echo.Context) error

func ListImage

func ListImage(c echo.Context) error

func ListKey

func ListKey(c echo.Context) error

func ListOrgVMSpec

func ListOrgVMSpec(c echo.Context) error

func ListRegion

func ListRegion(c echo.Context) error

func ListSecurity

func ListSecurity(c echo.Context) error

func ListVM

func ListVM(c echo.Context) error

func ListVMSpec

func ListVMSpec(c echo.Context) error

================ VMSpec Handler

func ListVMStatus

func ListVMStatus(c echo.Context) error

func ListVPC

func ListVPC(c echo.Context) error

func RegisterCloudDriver

func RegisterCloudDriver(c echo.Context) error

================ CloudDriver Handler

func RegisterCredential

func RegisterCredential(c echo.Context) error

================ Credential Handler

func RegisterRegion

func RegisterRegion(c echo.Context) error

================ Region Handler

func RemoveCSPSubnet

func RemoveCSPSubnet(c echo.Context) error

(1) get args from REST Call (2) call common-runtime API (3) return REST Json Format

func RemoveSubnet

func RemoveSubnet(c echo.Context) error

(1) get args from REST Call (2) call common-runtime API (3) return REST Json Format

func RunServer

func RunServer()

func SSHRun

func SSHRun(c echo.Context) error

================ SSH RUN

func StartVM

func StartVM(c echo.Context) error

================ VM Handler (1) check exist(NameID) (2) create Resource (3) insert IID

func TerminateCSPVM

func TerminateCSPVM(c echo.Context) error

(1) get args from REST Call (2) call common-runtime API (3) return REST Json Format

func TerminateVM

func TerminateVM(c echo.Context) error

(1) get args from REST Call (2) call common-runtime API (3) return REST Json Format

func UnRegisterCloudDriver

func UnRegisterCloudDriver(c echo.Context) error

func UnRegisterCredential

func UnRegisterCredential(c echo.Context) error

func UnRegisterRegion

func UnRegisterRegion(c echo.Context) error

Types

type BooleanInfo

type BooleanInfo struct {
	Result string // true or false
}

REST API Return struct for boolean type

type JSONResult

type JSONResult struct {
}

JSONResult's data field will be overridden by the specific type

type SSHRUNReqInfo

type SSHRUNReqInfo struct {
	UserName   string   // ex) "root"
	PrivateKey []string // ex)   ["-----BEGIN RSA PRIVATE KEY-----",
	//          "MIIEoQIBAAKCAQEArVNOLwMIp5VmZ4VPZotcoCHdEzimKalAsz+ccLfvAA1Y2ELH",
	//          "..."]
	ServerPort string // ex) "node12:22"
	Command    string // ex) "hostname"
}

type SimpleMsg

type SimpleMsg struct {
	Message string `json:"message" example:"Any message"`
}

JSON Simple message struct

type StatusInfo

type StatusInfo struct {
	Status string // PENDING | RUNNING | SUSPENDING | SUSPENDED | REBOOTING | TERMINATING | TERMINATED
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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