openstack

package
v0.0.0-...-891df37 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(cloudName string) (*gophercloud.ProviderClient, error)

NewProvider returns a new authenticated ProviderClient

Types

type Instance

type Instance struct {
	Logger hclog.Logger
	// contains filtered or unexported fields
}

Instance represents a OpenStack Compute Service client

func (*Instance) Get

func (i *Instance) Get(uuid string) (*servers.Server, error)

type InstanceClient

type InstanceClient interface {
	// Get retrieves a instance information from Provider
	Get(uuid string) (*servers.Server, error)
}

func NewInstance

func NewInstance(client *gophercloud.ProviderClient, logger hclog.Logger) (InstanceClient, error)

NewInstance returns a new OpenStack Compute Service client with given provider

type Metadata

type Metadata struct {
	UUID             string `json:"uuid"`
	Name             string `json:"name"`
	AvailabilityZone string `json:"availability_zone"`
	ProjectID        string `json:"project_id"`
}

Metadata represents the information fetched from OpenStack metadata service

func GetMetadataFromMetadataService

func GetMetadataFromMetadataService() (*Metadata, error)

GetMetadataFromMetadataService gets metadata from OpenStack Metadata service.

Jump to

Keyboard shortcuts

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