openstack

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const MAJOR_VERSION = "1"

Variables

This section is empty.

Functions

func ValidateBlueprint

func ValidateBlueprint(blueprint *OpenstackBlueprint) error

Types

type OpenstackBlueprint

type OpenstackBlueprint struct {
	// Inherit standard object values
	providers.Blueprint `yaml:",inline"`
	// Openstack specific values
	Objects  map[string]OpenstackObject  `yaml:",inline"`
	Hosts    map[string]OpenstackHost    `yaml:"-"`
	Networks map[string]OpenstackNetwork `yaml:"-"`
	Routers  map[string]OpenstackRouter  `yaml:"-"`
}

func UnmarshalBlueprintBytes

func UnmarshalBlueprintBytes(in []byte) (*OpenstackBlueprint, error)

func UnmarshalBlueprintBytesWithVars

func UnmarshalBlueprintBytesWithVars(in []byte, vars map[string]interface{}) (*OpenstackBlueprint, error)

func UnmarshalBlueprintFile

func UnmarshalBlueprintFile(filepath string) (*OpenstackBlueprint, error)

func UnmarshalBlueprintFileWithVars

func UnmarshalBlueprintFileWithVars(filepath string, varFilepath string) (*OpenstackBlueprint, error)

type OpenstackHost

type OpenstackHost struct {
	// Openstack instance name
	Name *string `yaml:"name,omitempty"`
	// Openstack instance description
	Description *string `yaml:"description,omitempty"`
	// Hostname of the host
	Hostname string `yaml:"hostname"`
	// Image of the host
	Image string `yaml:"image"`
	// Flavor of the host
	Flavor string `yaml:"flavor"`
	// Disk size of the host (in GB)
	DiskSize int `yaml:"disk_size"`
	// Networks to attach this host to
	Networks map[string]OpenstackNetworkAttachment `yaml:"networks"`
	// Any userdata to pass to created instance
	UserData []byte `yaml:"user_data,omitempty"`
}

type OpenstackNetwork

type OpenstackNetwork struct {
	// Openstack network name
	Name *string `yaml:"name,omitempty"`
	// Openstack network description
	Description *string `yaml:"description,omitempty"`
	// The subnet CIDR for the network
	Subnet netip.Prefix `yaml:"subnet"`
	// The gateway for the network
	Gateway *netip.Addr `yaml:"gateway,omitempty"`
	// DHCP ranges for the network (omit to disable DHCP)
	DHCP []OpenstackNetworkDHCP `yaml:"dhcp,omitempty"`
	// DNS servers for the network (omit to disable DNS)
	Resolvers []net.Addr `yaml:"resolvers,omitempty"`
}

type OpenstackNetworkAttachment

type OpenstackNetworkAttachment struct {
	// Should this interface get IP via DHCP (overrides IP setting if set)
	DHCP bool `yaml:"dhcp,omitempty"`
	// IPv4 address to use for the interface
	IP *netip.Addr `yaml:"ip,omitempty"`
}

type OpenstackNetworkDHCP

type OpenstackNetworkDHCP struct {
	// The start IP address for the DHCP range
	Start netip.Addr `yaml:"start"`
	// The end IP address for the DHCP range
	End netip.Addr `yaml:"end"`
}

type OpenstackObject

type OpenstackObject struct {
	// Inherit standard object values
	providers.Object `yaml:",inline"`
	// Openstack specific values
	Resource OpenstackResourceType `yaml:"-"`
	Host     *OpenstackHost        `yaml:"-"`
	Network  *OpenstackNetwork     `yaml:"-"`
	Router   *OpenstackRouter      `yaml:"-"`
}

func (*OpenstackObject) UnmarshalYAML

func (o *OpenstackObject) UnmarshalYAML(n *yaml.Node) error

type OpenstackResourceType

type OpenstackResourceType string
const (
	OpenstackResourceTypeHost    OpenstackResourceType = "openstack.v1.host"
	OpenstackResourceTypeNetwork OpenstackResourceType = "openstack.v1.network"
	OpenstackResourceTypeRouter  OpenstackResourceType = "openstack.v1.router"
)

type OpenstackRouter

type OpenstackRouter struct {
	// Openstack router name
	Name *string `yaml:"name,omitempty"`
	// Openstack router description
	Description *string `yaml:"description,omitempty"`
	// The ID or Name of the external Openstack network to attach this router to
	ExternalNetwork string `yaml:"external_network"`
	// Networks to attach this host to
	Networks map[string]OpenstackNetworkAttachment `yaml:"networks"`
}

type ProviderOpenstack

type ProviderOpenstack struct {
	providerGRPC.DefaultProviderServer
}

func (*ProviderOpenstack) Author

func (provider *ProviderOpenstack) Author() string

func (ProviderOpenstack) Configure

func (ProviderOpenstack) Deploy

func (*ProviderOpenstack) Description

func (provider *ProviderOpenstack) Description() string

func (ProviderOpenstack) Destroy

func (*ProviderOpenstack) Name

func (provider *ProviderOpenstack) Name() string

func (*ProviderOpenstack) Version

func (provider *ProviderOpenstack) Version() string

type ProviderOpenstackConfig

type ProviderOpenstackConfig struct {
	AuthUrl     string `yaml:"auth_url"`
	Username    string `yaml:"username"`
	Password    string `yaml:"password"`
	ProjectID   string `yaml:"project_id"`
	ProjectName string `yaml:"project_name"`
	RegionName  string `yaml:"region_name"`
	DomainName  string `yaml:"domain_name,omitempty"`
	DomainId    string `yaml:"domain_id,omitempty"`
}

func ConfigFromBytes

func ConfigFromBytes(in []byte) (*ProviderOpenstackConfig, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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