openstack

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf added in v0.2.0

func Errorf(format string, a ...any) *string

func ValidateBlueprint

func ValidateBlueprint(blueprint *OpenstackBlueprint) error

Types

type OpenstackBlueprint

type OpenstackBlueprint struct {
	// Inherit standard object values
	models.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:"-"`
}

type OpenstackHost

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

type OpenstackNetwork

type OpenstackNetwork struct {
	// Openstack network id
	ID *string `yaml:"id,omitempty"`
	// 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
	models.Object `yaml:",inline"`
	// Openstack specific values
	Data     *OpenstackResourceType `yaml:"-"`
	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 id
	ID *string `yaml:"id,omitempty"`
	// 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 {
	pgrpc.DefaultProviderServer
}

func (*ProviderOpenstack) Author

func (provider *ProviderOpenstack) Author() string

func (ProviderOpenstack) Configure

func (provider ProviderOpenstack) Configure(ctx context.Context, request *pgrpc.ConfigureRequest) (*pgrpc.ConfigureReply, error)

func (ProviderOpenstack) DeployResource added in v0.2.0

func (provider ProviderOpenstack) DeployResource(ctx context.Context, request *pgrpc.DeployResourceRequest) (*pgrpc.DeployResourceReply, error)

func (*ProviderOpenstack) Description

func (provider *ProviderOpenstack) Description() string

func (ProviderOpenstack) DestroyResource added in v0.2.0

func (provider ProviderOpenstack) DestroyResource(ctx context.Context, request *pgrpc.DestroyResourceRequest) (*pgrpc.DestroyResourceReply, error)

func (ProviderOpenstack) ExtractResourceMetadata added in v0.2.0

func (*ProviderOpenstack) Name

func (provider *ProviderOpenstack) Name() string

func (ProviderOpenstack) ResourcePower added in v0.2.0

func (provider ProviderOpenstack) ResourcePower(ctx context.Context, request *pgrpc.ResourcePowerRequest) (*pgrpc.ResourcePowerReply, error)

func (ProviderOpenstack) RetrieveData added in v0.2.0

func (provider ProviderOpenstack) RetrieveData(ctx context.Context, request *pgrpc.RetrieveDataRequest) (*pgrpc.RetrieveDataReply, error)

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"`
	PreferredConsoleType     remoteconsoles.ConsoleType     `yaml:"console_type,omitempty"`
	PreferredConsoleProtocol remoteconsoles.ConsoleProtocol `yaml:"console_protocol,omitempty"`
}

func ConfigFromBytes

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

Jump to

Keyboard shortcuts

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