command

package
v0.0.0-...-ea0670a Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYO1 = "tyo1"
	TYO2 = "tyo2"
	SIN1 = "sin1"
	SJC1 = "sjc1"
)

Regions

View Source
const (
	IDENTITY = "identity"
	COMPUTE  = "compute"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	Region   Region
	Service  Service
	Token    string
	TenantId string
	// contains filtered or unexported fields
}

func NewApi

func NewApi(service string, region string) (api *Api, err error)

func (*Api) Do

func (api *Api) Do() chan []byte

func (*Api) Endpoint

func (api *Api) Endpoint(path []string) (*url.URL, error)

func (*Api) LastError

func (api *Api) LastError() error

func (*Api) Prepare

func (api *Api) Prepare(method string, path []string, body []byte) error

type Command

type Command struct {
}

type Compute

type Compute struct {
	*Command
	// contains filtered or unexported fields
}

func NewCompute

func NewCompute(ident *Identity) *Compute

func (*Compute) Download

func (cmd *Compute) Download(url string) error

func (*Compute) Eject

func (cmd *Compute) Eject(server *Server) (err error)

func (*Compute) EjectIntractive

func (cmd *Compute) EjectIntractive() (err error)

func (*Compute) Insert

func (cmd *Compute) Insert(server *Server, iso *ISOImage) (err error)

func (*Compute) InsertIntractive

func (cmd *Compute) InsertIntractive() error

func (*Compute) Iso

func (cmd *Compute) Iso(id string) (iso *ISOImage, err error)

func (*Compute) Isos

func (cmd *Compute) Isos() (isos *ISOImages, err error)

func (*Compute) Server

func (cmd *Compute) Server(id string) (server *Server, err error)

func (*Compute) Servers

func (cmd *Compute) Servers() (servers *Servers, err error)

type ISOImage

type ISOImage struct {
	Id    string
	Name  string
	Url   string
	Path  string
	Ctime string
	Size  int64
}

type ISOImages

type ISOImages struct {
	IsoImages []*ISOImage `json:"iso-images"`
}

type Identity

type Identity struct {
	ApiUsername   string
	ApiPassword   string
	ApiTenantId   string
	ApiTenantName string

	Token        string
	TokenExpires time.Time
	Region       string

	*Command
}

func NewIdentity

func NewIdentity() *Identity

func (*Identity) Auth

func (cmd *Identity) Auth() (err error)

type Region

type Region struct {
	Name string
}

func (*Region) Set

func (r *Region) Set(region string) error

type Server

type Server struct {
	Id       string
	Name     string
	Metadata struct {
		InstanceNameTag string `json:"instance_name_tag"`
	} `json:"metadata"`
}

func (*Server) String

func (s *Server) String() string

type Servers

type Servers struct {
	Servers []*Server
}

type Service

type Service struct {
	Name    string
	Version string
}

func (*Service) Set

func (s *Service) Set(service string) error

Jump to

Keyboard shortcuts

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