Documentation
¶
Index ¶
- type Provider
- func (p *Provider) Create(workerName, flavorName, location string, hasGPU bool, image, gpuImage string, ...) (string, error)
- func (p *Provider) Delete(workerName, location string) error
- func (p *Provider) List(location string) (map[string]string, error)
- func (p *Provider) Restart(workerName, location string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
C config.OpenstackConfig
// Defaults used when arguments are empty
DefaultRegion string // fallback region when Create() location is empty
Image string // name or ID (env OPENSTACK_IMAGE)
NetworkID string // tenant network ID (env OPENSTACK_NETWORK_ID)
ExtNetworkID string // external network ID for FIPs (env OPENSTACK_EXTNET_ID)
Keypair string // existing keypair name (env OPENSTACK_KEYPAIR)
UserData []byte // cloud-init content (from env or file)
Name string // provider name (e.g., "openstack.myconfig")
// contains filtered or unexported fields
}
Provider implements basic OpenStack interactions. Fields are mostly optional; when empty, values are discovered via env or API lookups. Keep this struct very lightweight so it can be created easily in tests.
func NewFromConfig ¶
NewFromConfig constructs a Provider from YAML OpenstackConfig (no env required).
func NewFromEnv ¶
NewFromEnv constructs a Provider using environment variables (non-fatal if some are missing).
func (*Provider) Create ¶
func (p *Provider) Create(workerName, flavorName, location string, hasGPU bool, image, gpuImage string, jobId int32) (string, error)
Create boots a VM and attaches a floating IP when an external network is available. Returns the chosen public IP, or a private IP if no FIP could be allocated.
Click to show internal directories.
Click to hide internal directories.