bminstances

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MPL-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(client *edgecloud.ServiceClient, opts CreateOptsBuilder) (r tasks.Result)

Create creates an baremetal instance.

func ListAll

func ListAll(client *edgecloud.ServiceClient, opts ListOptsBuilder) ([]instances.Instance, error)

ListAll is a convenience function that returns all instances.

func Rebuild

func Rebuild(client *edgecloud.ServiceClient, instanceID string, opts RebuildInstanceOptsBuilder) (r tasks.Result)

Rebuild an baremetal instance with new image_id.

Types

type CreateNewInterfaceFloatingIPOpts

type CreateNewInterfaceFloatingIPOpts struct {
	Source             types.FloatingIPSource `json:"source" validate:"required,enum"`
	ExistingFloatingID string                 `json:"existing_floating_id" validate:"rfe=Source:existing,sfe=Source:new,omitempty,uuid4"`
}

func (CreateNewInterfaceFloatingIPOpts) Validate

func (opts CreateNewInterfaceFloatingIPOpts) Validate() error

Validate CreateNewInterfaceFloatingIPOpts.

type CreateOpts

type CreateOpts struct {
	Flavor        string                     `json:"flavor" required:"true"`
	Names         []string                   `json:"names,omitempty" validate:"required_without=NameTemplates"`
	NameTemplates []string                   `json:"name_templates,omitempty" validate:"required_without=Names"`
	ImageID       string                     `json:"image_id,omitempty" validate:"required_without=AppTemplateID"`
	AppTemplateID string                     `json:"apptemplate_id,omitempty" validate:"required_without=ImageID"`
	Interfaces    []InterfaceOpts            `json:"interfaces" required:"true" validate:"required,dive"`
	Keypair       string                     `json:"keypair_name,omitempty"`
	Password      string                     `json:"password" validate:"omitempty,required_with=Username"`
	Username      string                     `json:"username" validate:"omitempty,required_with=Password"`
	UserData      string                     `json:"user_data,omitempty" validate:"omitempty,base64"`
	AppConfig     map[string]interface{}     `json:"app_config,omitempty" validate:"omitempty"`
	Metadata      *instances.MetadataSetOpts `json:"metadata,omitempty" validate:"omitempty,dive"`
}

CreateOpts represents options used to create a instance.

func (CreateOpts) ToInstanceCreateMap

func (opts CreateOpts) ToInstanceCreateMap() (map[string]interface{}, error)

ToInstanceCreateMap builds a request body from CreateOpts.

func (CreateOpts) Validate

func (opts CreateOpts) Validate() error

Validate CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToInstanceCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type InterfaceOpts

type InterfaceOpts struct {
	Type       types.InterfaceType               `json:"type" validate:"omitempty,enum"`
	NetworkID  string                            `json:"network_id,omitempty" validate:"rfe=Type:subnet,omitempty,uuid4"`
	SubnetID   string                            `json:"subnet_id,omitempty" validate:"rfe=Type:subnet,omitempty,uuid4"`
	PortID     string                            `json:"port_id,omitempty" validate:"rfe=Type:reserved_fixed_ip,allowed_without_all=NetworkID SubnetID,omitempty,uuid4"`
	FloatingIP *CreateNewInterfaceFloatingIPOpts `json:"floating_ip,omitempty" validate:"omitempty,dive"`
}

func (InterfaceOpts) Validate

func (opts InterfaceOpts) Validate() error

Validate InterfaceOpts.

type ListOpts

type ListOpts struct {
	Name     string            `q:"name"`
	FlavorID string            `q:"flavor_id"`
	Metadata map[string]string `q:"metadata_kv" validate:"omitempty"`
}

ListOpts allows the filtering and sorting of paginated collections through the API.

func (ListOpts) ToInstanceListQuery

func (opts ListOpts) ToInstanceListQuery() (string, error)

ToInstanceListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToInstanceListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type RebuildInstanceOpts

type RebuildInstanceOpts struct {
	ImageID string `json:"image_id" required:"true" validate:"required"`
}

RebuildInstanceOpts allows rebuild a baremetal instance with new image_id.

func (RebuildInstanceOpts) ToRebuildInstanceCreateMap

func (opts RebuildInstanceOpts) ToRebuildInstanceCreateMap() (map[string]interface{}, error)

ToRebuildInstanceCreateMap formats a RebuildInstanceOpts into a query string.

type RebuildInstanceOptsBuilder

type RebuildInstanceOptsBuilder interface {
	ToRebuildInstanceCreateMap() (map[string]interface{}, error)
}

RebuildInstanceOptsBuilder allows extensions to add additional parameters to the Rebuild request.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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