models

package
v0.0.0-...-f149185 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

* * File : vm.go * Author : Iman Tabrizian <[email protected]> * Date : 04.04.2019 * Last Modified Date: 17.05.2019 * Last Modified By : Iman Tabrizian <[email protected]>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthRequest

func AuthRequest(verb string, url string, body string, authToken string) []byte

Types

type App

type App struct {
	Image    string
	Location string
	ExposeIP string
}

type AuthConfiguration

type AuthConfiguration struct {
	Username string
	Password string
	Region   string
	Url      string
	Project  string
	Version  string
}

type Configuration

type Configuration struct {
	Auth AuthConfiguration
	VM   VMConfiguration
}

type IOpenStackClient

type IOpenStackClient interface {
	GetAuthToken() string
	GetNovaURL() string
	GetFlavorID(string) string
	GetImageID(string) string
	GetNetworkID(string) string
	GetSecgroupID(string) string
}

type IVMConfiguration

type IVMConfiguration interface {
	GetImage() string
	GetNetwork() string
	GetSecgroup() string
	GetFlavor() string
}

type VM

type VM struct {
	Name      string
	IP        []string
	OverlayIp string
	Id        string
	OsClient  IOpenStackClient
}

func CreateOrFindVM

func CreateOrFindVM(osClient IOpenStackClient, name string, vmConfiguration IVMConfiguration) (*VM, error)

func GetVM

func GetVM(osClient IOpenStackClient, id string) (*VM, error)

func GetVMByName

func GetVMByName(osClient IOpenStackClient, name string) (*VM, error)

func NewVM

func NewVM(osClient IOpenStackClient, name string, vmConfiguration IVMConfiguration) (*VM, error)

func (*VM) RefreshVM

func (vm *VM) RefreshVM() []byte

func (*VM) Update

func (vm *VM) Update()

func (*VM) WaitForIP

func (vm *VM) WaitForIP()

type VMConfiguration

type VMConfiguration struct {
	Image    string
	Network  string
	Secgroup string
	Flavor   string
}

func (*VMConfiguration) GetFlavor

func (vmConfiguration *VMConfiguration) GetFlavor() string

func (*VMConfiguration) GetImage

func (vmConfiguration *VMConfiguration) GetImage() string

func (*VMConfiguration) GetNetwork

func (vmConfiguration *VMConfiguration) GetNetwork() string

func (*VMConfiguration) GetSecgroup

func (vmConfiguration *VMConfiguration) GetSecgroup() string

Jump to

Keyboard shortcuts

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