ovirt

package
v0.0.0-...-b2a629c Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCanNotLoadOvirtConfig error = errors.New("can not load ovirt config")

ErrCanNotLoadOvirtConfig is returned when the config file fails to load.

Functions

func LoadOvirtConfig

func LoadOvirtConfig() ([]byte, error)

LoadOvirtConfig from the following location (first wins): 1. OVIRT_CONFIG env variable 2 $defaultOvirtConfigPath

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (*Client, error)

func (*Client) GetConnection

func (o *Client) GetConnection() (*ovirtsdk.Connection, error)

GetConnection validates the connection we have is valid and either returns it, or creates a new one in case the connection isn't present or it was invalidated.

type Config

type Config struct {
	URL      string `yaml:"ovirt_url"`
	Username string `yaml:"ovirt_username"`
	Password string `yaml:"ovirt_password"`
	CAFile   string `yaml:"ovirt_cafile,omitempty"`
	Insecure bool   `yaml:"ovirt_insecure,omitempty"`
}

Config holds oVirt api access details.

func GetOvirtConfig

func GetOvirtConfig() (*Config, error)

GetOvirtConfig will return an Config by loading the configuration from locations specified in @LoadOvirtConfig error is return if the configuration could not be retained.

func (*Config) Save

func (c *Config) Save() error

Save will serialize the config back into the locations specified in @LoadOvirtConfig, first location with a file, wins.

Jump to

Keyboard shortcuts

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