nodes

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package nodes provides information and interaction with the nodes API resource in the OpenStack Bare Metal service.

Example to List Nodes with Detail

nodes.ListDetail(client, nodes.ListOpts{}).EachPage(func(page pagination.Page) (bool, error) {
	nodeList, err := nodes.ExtractNodes(page)
	if err != nil {
		return false, err
	}

	for _, n := range nodeList {
		// Do something
	}

	return true, nil
})

Example to List Nodes

listOpts := nodes.ListOpts{
	ProvisionState: nodes.Deploying,
	Fields:         []string{"name"},
}

nodes.List(client, listOpts).EachPage(func(page pagination.Page) (bool, error) {
	nodeList, err := nodes.ExtractNodes(page)
	if err != nil {
		return false, err
	}

	for _, n := range nodeList {
		// Do something
	}

	return true, nil
})

Example to Create Node

createOpts := nodes.CreateOpts
	Driver:        "ipmi",
	BootInterface: "pxe",
	Name:          "coconuts",
	DriverInfo: map[string]interface{}{
		"ipmi_port":      "6230",
		"ipmi_username":  "admin",
		"deploy_kernel":  "http://172.22.0.1/images/tinyipa-stable-rocky.vmlinuz",
		"ipmi_address":   "192.168.122.1",
		"deploy_ramdisk": "http://172.22.0.1/images/tinyipa-stable-rocky.gz",
		"ipmi_password":  "admin",
	},
}

createNode, err := nodes.Create(client, createOpts).Extract()
if err != nil {
	panic(err)
}

Example to Get Node

showNode, err := nodes.Get(client, "c9afd385-5d89-4ecb-9e1c-68194da6b474").Extract()
if err != nil {
	panic(err)
}

Example to Update Node

updateOpts := nodes.UpdateOpts{
	nodes.UpdateOperation{
		Op:    ReplaceOp,
		Path:  "/maintenance",
		Value: "true",
	},
}

updateNode, err := nodes.Update(client, "c9afd385-5d89-4ecb-9e1c-68194da6b474", updateOpts).Extract()
if err != nil {
	panic(err)
}

Example to Delete Node

err = nodes.Delete(client, "c9afd385-5d89-4ecb-9e1c-68194da6b474").ExtractErr()
if err != nil {
	panic(err)
}

Example to Validate Node

validation, err := nodes.Validate(client, "a62b8495-52e2-407b-b3cb-62775d04c2b8").Extract()
if err != nil {
	panic(err)
}

Example to inject non-masking interrupts

err := nodes.InjectNMI(client, "a62b8495-52e2-407b-b3cb-62775d04c2b8").ExtractErr()
if err != nil {
	panic(err)
}

Example to get array of supported boot devices for a node

bootDevices, err := nodes.GetSupportedBootDevices(client, "a62b8495-52e2-407b-b3cb-62775d04c2b8").Extract()
if err != nil {
	panic(err)
}

Example to set boot device for a node

bootOpts := nodes.BootDeviceOpts{
	BootDevice: "pxe",
	Persistent: false,
}

err := nodes.SetBootDevice(client, "a62b8495-52e2-407b-b3cb-62775d04c2b8", bootOpts).ExtractErr()
if err != nil {
	panic(err)
}

Example to get boot device for a node

bootDevice, err := nodes.GetBootDevice(client, "a62b8495-52e2-407b-b3cb-62775d04c2b8").Extract()
if err != nil {
	panic(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractNodesInto

func ExtractNodesInto(r pagination.Page, v interface{}) error

func List

List makes a request against the API to list nodes accessible to you.

func ListDetail

func ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager

Return a list of bare metal Nodes with complete details. Some filtering is possible by passing in flags in ListOpts, but you cannot limit by the fields returned.

Types

type BootDeviceOpts

type BootDeviceOpts struct {
	BootDevice string `json:"boot_device"` // e.g., 'pxe', 'disk', etc.
	Persistent bool   `json:"persistent"`  // Whether this is one-time or not
}

func (BootDeviceOpts) ToBootDeviceMap

func (opts BootDeviceOpts) ToBootDeviceMap() (map[string]interface{}, error)

ToBootDeviceSetMap assembles a request body based on the contents of a BootDeviceOpts.

type BootDeviceOptsBuilder

type BootDeviceOptsBuilder interface {
	ToBootDeviceMap() (map[string]interface{}, error)
}

BootDeviceOptsBuilder allows extensions to add additional parameters to the SetBootDevice request.

type BootDeviceResult

type BootDeviceResult struct {
	gophercloud.Result
}

BootDeviceResult is the response from a GetBootDevice operation. Call its Extract method to interpret it as a BootDeviceOpts struct.

func GetBootDevice

func GetBootDevice(client *gophercloud.ServiceClient, id string) (r BootDeviceResult)

Get the current boot device for the given Node.

func (BootDeviceResult) Extract

func (r BootDeviceResult) Extract() (*BootDeviceOpts, error)

Extract interprets a BootDeviceResult as BootDeviceOpts, if possible.

type ChangePowerStateResult

type ChangePowerStateResult struct {
	gophercloud.ErrResult
}

ChangePowerStateResult is the response from a ChangePowerState operation. Call its ExtractErr method to determine if the call succeeded or failed.

func ChangePowerState

func ChangePowerState(client *gophercloud.ServiceClient, id string, opts PowerStateOptsBuilder) (r ChangePowerStateResult)

Request to change a Node's power state.

type ChangeStateResult

type ChangeStateResult struct {
	gophercloud.ErrResult
}

ChangeStateResult is the response from any state change operation. Call its ExtractErr method to determine if the call succeeded or failed.

func ChangeProvisionState

func ChangeProvisionState(client *gophercloud.ServiceClient, id string, opts ProvisionStateOptsBuilder) (r ChangeStateResult)

Request a change to the Node’s provision state. Acceptable target states depend on the Node’s current provision state. More detailed documentation of the Ironic State Machine is available in the developer docs.

func SetRAIDConfig

func SetRAIDConfig(client *gophercloud.ServiceClient, id string, raidConfigOptsBuilder RAIDConfigOptsBuilder) (r ChangeStateResult)

Request to change a Node's RAID config.

type CleanStep

type CleanStep struct {
	Interface string                 `json:"interface" required:"true"`
	Step      string                 `json:"step" required:"true"`
	Args      map[string]interface{} `json:"args,omitempty"`
}

A cleaning step has required keys ‘interface’ and ‘step’, and optional key ‘args’. If specified, the value for ‘args’ is a keyword variable argument dictionary that is passed to the cleaning step method.

type ConfigDrive

type ConfigDrive struct {
	MetaData    map[string]interface{} `json:"meta_data,omitempty"`
	NetworkData map[string]interface{} `json:"network_data,omitempty"`
	UserData    interface{}            `json:"user_data,omitempty"`
}

Starting with Ironic API version 1.56, a configdrive may be a JSON object with structured data. Prior to this version, it must be a base64-encoded, gzipped ISO9660 image.

type CreateOpts

type CreateOpts struct {
	// The boot interface for a Node, e.g. “pxe”.
	BootInterface string `json:"boot_interface,omitempty"`

	// The conductor group for a node. Case-insensitive string up to 255 characters, containing a-z, 0-9, _, -, and ..
	ConductorGroup string `json:"conductor_group,omitempty"`

	// The console interface for a node, e.g. “no-console”.
	ConsoleInterface string `json:"console_interface,omitempty"`

	// The deploy interface for a node, e.g. “iscsi”.
	DeployInterface string `json:"deploy_interface,omitempty"`

	// All the metadata required by the driver to manage this Node. List of fields varies between drivers, and can
	// be retrieved from the /v1/drivers/<DRIVER_NAME>/properties resource.
	DriverInfo map[string]interface{} `json:"driver_info,omitempty"`

	// name of the driver used to manage this Node.
	Driver string `json:"driver,omitempty"`

	// A set of one or more arbitrary metadata key and value pairs.
	Extra map[string]interface{} `json:"extra,omitempty"`

	// The interface used for node inspection, e.g. “no-inspect”.
	InspectInterface string `json:"inspect_interface,omitempty"`

	// Interface for out-of-band node management, e.g. “ipmitool”.
	ManagementInterface string `json:"management_interface,omitempty"`

	// Human-readable identifier for the Node resource. May be undefined. Certain words are reserved.
	Name string `json:"name,omitempty"`

	// Which Network Interface provider to use when plumbing the network connections for this Node.
	NetworkInterface string `json:"network_interface,omitempty"`

	// Interface used for performing power actions on the node, e.g. “ipmitool”.
	PowerInterface string `json:"power_interface,omitempty"`

	// Physical characteristics of this Node. Populated during inspection, if performed. Can be edited via the REST
	// API at any time.
	Properties map[string]interface{} `json:"properties,omitempty"`

	// Interface used for configuring RAID on this node, e.g. “no-raid”.
	RAIDInterface string `json:"raid_interface,omitempty"`

	// The interface used for node rescue, e.g. “no-rescue”.
	RescueInterface string `json:"rescue_interface,omitempty"`

	// A string which can be used by external schedulers to identify this Node as a unit of a specific type
	// of resource.
	ResourceClass string `json:"resource_class,omitempty"`

	// Interface used for attaching and detaching volumes on this node, e.g. “cinder”.
	StorageInterface string `json:"storage_interface,omitempty"`

	// The UUID for the resource.
	UUID string `json:"uuid,omitempty"`

	// Interface for vendor-specific functionality on this node, e.g. “no-vendor”.
	VendorInterface string `json:"vendor_interface,omitempty"`

	// A string or UUID of the tenant who owns the baremetal node.
	Owner string `json:"owner,omitempty"`
}

CreateOpts specifies node creation parameters.

func (CreateOpts) ToNodeCreateMap

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

ToNodeCreateMap assembles a request body based on the contents of a CreateOpts.

type CreateOptsBuilder

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

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

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult is the response from a Create operation.

func Create

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create requests a node to be created

func (CreateResult) Extract

func (r CreateResult) Extract() (*Node, error)

Extract interprets any nodeResult as a Node, if possible.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult is the response from a Delete operation. Call its ExtractErr method to determine if the call succeeded or failed.

func Delete

func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult)

Delete requests that a node be removed

type DiskType

type DiskType string

DiskType is used to specify the disk type for a logical disk, e.g. hdd or ssd.

const (
	HDD DiskType = "hdd"
	SSD DiskType = "ssd"
)

type DriverValidation

type DriverValidation struct {
	Result bool   `json:"result"`
	Reason string `json:"reason"`
}

Each element in the response will contain a “result” variable, which will have a value of “true” or “false”, and also potentially a reason. A value of nil indicates that the Node’s driver does not support that interface.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult is the response from a Get operation. Call its Extract method to interpret it as a Node.

func Get

func Get(client *gophercloud.ServiceClient, id string) (r GetResult)

Get requests details on a single node, by ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Node, error)

Extract interprets any nodeResult as a Node, if possible.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type InjectNMIResult

type InjectNMIResult struct {
	gophercloud.ErrResult
}

InjectNMIResult is the response from an InjectNMI operation. Call its ExtractErr method to determine if the call succeeded or failed.

func InjectNMI

func InjectNMI(client *gophercloud.ServiceClient, id string) (r InjectNMIResult)

Inject NMI (Non-Masking Interrupts) for the given Node. This feature can be used for hardware diagnostics, and actual support depends on a driver.

type InterfaceType

type InterfaceType string

InterfaceType is used to specify the interface for a logical disk.

const (
	SATA InterfaceType = "sata"
	SCSI InterfaceType = "scsi"
	SAS  InterfaceType = "sas"
)

type ListOpts

type ListOpts struct {
	// Filter the list by specific instance UUID
	InstanceUUID string `q:"instance_uuid"`

	// Filter the list by chassis UUID
	ChassisUUID string `q:"chassis_uuid"`

	// Filter the list by maintenance set to True or False
	Maintenance bool `q:"maintenance"`

	// Nodes which are, or are not, associated with an instance_uuid.
	Associated bool `q:"associated"`

	// Only return those with the specified provision_state.
	ProvisionState ProvisionState `q:"provision_state"`

	// Filter the list with the specified driver.
	Driver string `q:"driver"`

	// Filter the list with the specified resource class.
	ResourceClass string `q:"resource_class"`

	// Filter the list with the specified conductor_group.
	ConductorGroup string `q:"conductor_group"`

	// Filter the list with the specified fault.
	Fault string `q:"fault"`

	// One or more fields to be returned in the response.
	Fields []string `q:"fields"`

	// Requests a page size of items.
	Limit int `q:"limit"`

	// The ID of the last-seen item.
	Marker string `q:"marker"`

	// Sorts the response by the requested sort direction.
	SortDir string `q:"sort_dir"`

	// Sorts the response by the this attribute value.
	SortKey string `q:"sort_key"`

	// A string or UUID of the tenant who owns the baremetal node.
	Owner string `q:"owner"`
}

ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the node attributes you want to see returned. Marker and Limit are used for pagination.

func (ListOpts) ToNodeListDetailQuery

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

ToNodeListDetailQuery formats a ListOpts into a query string for the list details API.

func (ListOpts) ToNodeListQuery

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

ToNodeListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToNodeListQuery() (string, error)
	ToNodeListDetailQuery() (string, error)
}

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

type LogicalDisk

type LogicalDisk struct {
	// Size (Integer) of the logical disk to be created in GiB.  If unspecified, "MAX" will be used.
	SizeGB *int `json:"size_gb"`

	// RAID level for the logical disk.
	RAIDLevel RAIDLevel `json:"raid_level" required:"true"`

	// Name of the volume. Should be unique within the Node. If not specified, volume name will be auto-generated.
	VolumeName string `json:"volume_name,omitempty"`

	// Set to true if this is the root volume. At most one logical disk can have this set to true.
	IsRootVolume *bool `json:"is_root_volume,omitempty"`

	// Set to true if this logical disk can share physical disks with other logical disks.
	SharePhysicalDisks *bool `json:"share_physical_disks,omitempty"`

	// If this is not specified, disk type will not be a criterion to find backing physical disks
	DiskType DiskType `json:"disk_type,omitempty"`

	// If this is not specified, interface type will not be a criterion to find backing physical disks.
	InterfaceType InterfaceType `json:"interface_type,omitempty"`

	// Integer, number of disks to use for the logical disk. Defaults to minimum number of disks required
	// for the particular RAID level.
	NumberOfPhysicalDisks int `json:"number_of_physical_disks,omitempty"`

	// The name of the controller as read by the RAID interface.
	Controller string `json:"controller,omitempty"`

	// A list of physical disks to use as read by the RAID interface.
	PhysicalDisks []interface{} `json:"physical_disks,omitempty"`
}

type Node

type Node struct {
	// UUID for the resource.
	UUID string `json:"uuid"`

	// Identifier for the Node resource. May be undefined. Certain words are reserved.
	Name string `json:"name"`

	// Current power state of this Node. Usually, “power on” or “power off”, but may be “None”
	// if Ironic is unable to determine the power state (eg, due to hardware failure).
	PowerState string `json:"power_state"`

	// A power state transition has been requested, this field represents the requested (ie, “target”)
	// state either “power on”, “power off”, “rebooting”, “soft power off” or “soft rebooting”.
	TargetPowerState string `json:"target_power_state"`

	// Current provisioning state of this Node.
	ProvisionState string `json:"provision_state"`

	// A provisioning action has been requested, this field represents the requested (ie, “target”) state. Note
	// that a Node may go through several states during its transition to this target state. For instance, when
	// requesting an instance be deployed to an AVAILABLE Node, the Node may go through the following state
	// change progression: AVAILABLE -> DEPLOYING -> DEPLOYWAIT -> DEPLOYING -> ACTIVE
	TargetProvisionState string `json:"target_provision_state"`

	// Whether or not this Node is currently in “maintenance mode”. Setting a Node into maintenance mode removes it
	// from the available resource pool and halts some internal automation. This can happen manually (eg, via an API
	// request) or automatically when Ironic detects a hardware fault that prevents communication with the machine.
	Maintenance bool `json:"maintenance"`

	// Description of the reason why this Node was placed into maintenance mode
	MaintenanceReason string `json:"maintenance_reason"`

	// Fault indicates the active fault detected by ironic, typically the Node is in “maintenance mode”. None means no
	// fault has been detected by ironic. “power failure” indicates ironic failed to retrieve power state from this
	// node. There are other possible types, e.g., “clean failure” and “rescue abort failure”.
	Fault string `json:"fault"`

	// Error from the most recent (last) transaction that started but failed to finish.
	LastError string `json:"last_error"`

	// Name of an Ironic Conductor host which is holding a lock on this node, if a lock is held. Usually “null”,
	// but this field can be useful for debugging.
	Reservation string `json:"reservation"`

	// Name of the driver.
	Driver string `json:"driver"`

	// The metadata required by the driver to manage this Node. List of fields varies between drivers, and can be
	// retrieved from the /v1/drivers/<DRIVER_NAME>/properties resource.
	DriverInfo map[string]interface{} `json:"driver_info"`

	// Metadata set and stored by the Node’s driver. This field is read-only.
	DriverInternalInfo map[string]interface{} `json:"driver_internal_info"`

	// Characteristics of this Node. Populated by ironic-inspector during inspection. May be edited via the REST
	// API at any time.
	Properties map[string]interface{} `json:"properties"`

	// Used to customize the deployed image. May include root partition size, a base 64 encoded config drive, and other
	// metadata. Note that this field is erased automatically when the instance is deleted (this is done by requesting
	// the Node provision state be changed to DELETED).
	InstanceInfo map[string]interface{} `json:"instance_info"`

	// ID of the Nova instance associated with this Node.
	InstanceUUID string `json:"instance_uuid"`

	// ID of the chassis associated with this Node. May be empty or None.
	ChassisUUID string `json:"chassis_uuid"`

	// Set of one or more arbitrary metadata key and value pairs.
	Extra map[string]interface{} `json:"extra"`

	// Whether console access is enabled or disabled on this node.
	ConsoleEnabled bool `json:"console_enabled"`

	// The current RAID configuration of the node. Introduced with the cleaning feature.
	RAIDConfig map[string]interface{} `json:"raid_config"`

	// The requested RAID configuration of the node, which will be applied when the Node next transitions
	// through the CLEANING state. Introduced with the cleaning feature.
	TargetRAIDConfig map[string]interface{} `json:"target_raid_config"`

	// Current clean step. Introduced with the cleaning feature.
	CleanStep map[string]interface{} `json:"clean_step"`

	// Current deploy step.
	DeployStep map[string]interface{} `json:"deploy_step"`

	// String which can be used by external schedulers to identify this Node as a unit of a specific type of resource.
	// For more details, see: https://docs.openstack.org/ironic/latest/install/configure-nova-flavors.html
	ResourceClass string `json:"resource_class"`

	// Boot interface for a Node, e.g. “pxe”.
	BootInterface string `json:"boot_interface"`

	// Console interface for a node, e.g. “no-console”.
	ConsoleInterface string `json:"console_interface"`

	// Deploy interface for a node, e.g. “iscsi”.
	DeployInterface string `json:"deploy_interface"`

	// Interface used for node inspection, e.g. “no-inspect”.
	InspectInterface string `json:"inspect_interface"`

	// For out-of-band node management, e.g. “ipmitool”.
	ManagementInterface string `json:"management_interface"`

	// Network Interface provider to use when plumbing the network connections for this Node.
	NetworkInterface string `json:"network_interface"`

	// used for performing power actions on the node, e.g. “ipmitool”.
	PowerInterface string `json:"power_interface"`

	// Used for configuring RAID on this node, e.g. “no-raid”.
	RAIDInterface string `json:"raid_interface"`

	// Interface used for node rescue, e.g. “no-rescue”.
	RescueInterface string `json:"rescue_interface"`

	// Used for attaching and detaching volumes on this node, e.g. “cinder”.
	StorageInterface string `json:"storage_interface"`

	// Array of traits for this node.
	Traits []string `json:"traits"`

	// For vendor-specific functionality on this node, e.g. “no-vendor”.
	VendorInterface string `json:"vendor_interface"`

	// Conductor group for a node. Case-insensitive string up to 255 characters, containing a-z, 0-9, _, -, and ..
	ConductorGroup string `json:"conductor_group"`

	// The node is protected from undeploying, rebuilding and deletion.
	Protected bool `json:"protected"`

	// Reason the node is marked as protected.
	ProtectedReason string `json:"protected_reason"`

	// A string or UUID of the tenant who owns the baremetal node.
	Owner string `json:"owner"`
}

Node represents a node in the OpenStack Bare Metal API.

func ExtractNodes

func ExtractNodes(r pagination.Page) ([]Node, error)

ExtractNodes interprets the results of a single page from a List() call, producing a slice of Node entities.

type NodePage

type NodePage struct {
	pagination.LinkedPageBase
}

NodePage abstracts the raw results of making a List() request against the API. As OpenStack extensions may freely alter the response bodies of structures returned to the client, you may only safely access the data provided through the ExtractNodes call.

func (NodePage) IsEmpty

func (r NodePage) IsEmpty() (bool, error)

IsEmpty returns true if a page contains no Node results.

func (NodePage) NextPageURL

func (r NodePage) NextPageURL() (string, error)

NextPageURL uses the response's embedded link reference to navigate to the next page of results.

type NodeValidation

type NodeValidation struct {
	Boot       DriverValidation `json:"boot"`
	Console    DriverValidation `json:"console"`
	Deploy     DriverValidation `json:"deploy"`
	Inspect    DriverValidation `json:"inspect"`
	Management DriverValidation `json:"management"`
	Network    DriverValidation `json:"network"`
	Power      DriverValidation `json:"power"`
	RAID       DriverValidation `json:"raid"`
	Rescue     DriverValidation `json:"rescue"`
	Storage    DriverValidation `json:"storage"`
}

Ironic validates whether the Node’s driver has enough information to manage the Node. This polls each interface on the driver, and returns the status of that interface as an DriverValidation struct.

type Patch

type Patch interface {
	ToNodeUpdateMap() (map[string]interface{}, error)
}

type PowerStateOpts

type PowerStateOpts struct {
	Target  TargetPowerState `json:"target" required:"true"`
	Timeout int              `json:"timeout,omitempty"`
}

PowerStateOpts for a request to change a node's power state.

func (PowerStateOpts) ToPowerStateMap

func (opts PowerStateOpts) ToPowerStateMap() (map[string]interface{}, error)

ToPowerStateMap assembles a request body based on the contents of a PowerStateOpts.

type PowerStateOptsBuilder

type PowerStateOptsBuilder interface {
	ToPowerStateMap() (map[string]interface{}, error)
}

PowerStateOptsBuilder allows extensions to add additional parameters to the ChangePowerState request.

type ProvisionState

type ProvisionState string

Provision state reports the current provision state of the node, these are only used in filtering

const (
	Enroll       ProvisionState = "enroll"
	Verifying    ProvisionState = "verifying"
	Manageable   ProvisionState = "manageable"
	Available    ProvisionState = "available"
	Active       ProvisionState = "active"
	DeployWait   ProvisionState = "wait call-back"
	Deploying    ProvisionState = "deploying"
	DeployFail   ProvisionState = "deploy failed"
	DeployDone   ProvisionState = "deploy complete"
	Deleting     ProvisionState = "deleting"
	Deleted      ProvisionState = "deleted"
	Cleaning     ProvisionState = "cleaning"
	CleanWait    ProvisionState = "clean wait"
	CleanFail    ProvisionState = "clean failed"
	Error        ProvisionState = "error"
	Rebuild      ProvisionState = "rebuild"
	Inspecting   ProvisionState = "inspecting"
	InspectFail  ProvisionState = "inspect failed"
	InspectWait  ProvisionState = "inspect wait"
	Adopting     ProvisionState = "adopting"
	AdoptFail    ProvisionState = "adopt failed"
	Rescue       ProvisionState = "rescue"
	RescueFail   ProvisionState = "rescue failed"
	Rescuing     ProvisionState = "rescuing"
	UnrescueFail ProvisionState = "unrescue failed"
)

type ProvisionStateOpts

type ProvisionStateOpts struct {
	Target         TargetProvisionState `json:"target" required:"true"`
	ConfigDrive    interface{}          `json:"configdrive,omitempty"`
	CleanSteps     []CleanStep          `json:"clean_steps,omitempty"`
	RescuePassword string               `json:"rescue_password,omitempty"`
}

ProvisionStateOpts for a request to change a node's provision state. A config drive should be base64-encoded gzipped ISO9660 image.

func (ProvisionStateOpts) ToProvisionStateMap

func (opts ProvisionStateOpts) ToProvisionStateMap() (map[string]interface{}, error)

ToProvisionStateMap assembles a request body based on the contents of a CreateOpts.

type ProvisionStateOptsBuilder

type ProvisionStateOptsBuilder interface {
	ToProvisionStateMap() (map[string]interface{}, error)
}

ProvisionStateOptsBuilder allows extensions to add additional parameters to the ChangeProvisionState request.

type RAIDConfigOpts

type RAIDConfigOpts struct {
	LogicalDisks []LogicalDisk `json:"logical_disks"`
}

This is the desired RAID configuration on the bare metal node.

func (RAIDConfigOpts) ToRAIDConfigMap

func (opts RAIDConfigOpts) ToRAIDConfigMap() (map[string]interface{}, error)

type RAIDConfigOptsBuilder

type RAIDConfigOptsBuilder interface {
	ToRAIDConfigMap() (map[string]interface{}, error)
}

RAIDConfigOptsBuilder allows extensions to modify a set RAID config request.

type RAIDLevel

type RAIDLevel string

RAIDLevel type is used to specify the RAID level for a logical disk.

const (
	RAID0  RAIDLevel = "0"
	RAID1  RAIDLevel = "1"
	RAID2  RAIDLevel = "2"
	RAID5  RAIDLevel = "5"
	RAID6  RAIDLevel = "6"
	RAID10 RAIDLevel = "1+0"
	RAID50 RAIDLevel = "5+0"
	RAID60 RAIDLevel = "6+0"
)

type SetBootDeviceResult

type SetBootDeviceResult struct {
	gophercloud.ErrResult
}

BootDeviceResult is the response from a GetBootDevice operation. Call its Extract method to interpret it as a BootDeviceOpts struct.

func SetBootDevice

func SetBootDevice(client *gophercloud.ServiceClient, id string, bootDevice BootDeviceOptsBuilder) (r SetBootDeviceResult)

Set the boot device for the given Node, and set it persistently or for one-time boot. The exact behaviour of this depends on the hardware driver.

type SupportedBootDeviceResult

type SupportedBootDeviceResult struct {
	gophercloud.Result
}

SupportedBootDeviceResult is the response from a GetSupportedBootDevices operation. Call its Extract method to interpret it as an array of supported boot device values.

func GetSupportedBootDevices

func GetSupportedBootDevices(client *gophercloud.ServiceClient, id string) (r SupportedBootDeviceResult)

Retrieve the acceptable set of supported boot devices for a specific Node.

func (SupportedBootDeviceResult) Extract

func (r SupportedBootDeviceResult) Extract() ([]string, error)

Extract interprets a SupportedBootDeviceResult as an array of supported boot devices, if possible.

type TargetPowerState

type TargetPowerState string
const (
	PowerOn       TargetPowerState = "power on"
	PowerOff      TargetPowerState = "power off"
	Rebooting     TargetPowerState = "rebooting"
	SoftPowerOff  TargetPowerState = "soft power off"
	SoftRebooting TargetPowerState = "soft rebooting"
)

TargetPowerState is used when changing the power state of a node.

type TargetProvisionState

type TargetProvisionState string

TargetProvisionState is used when setting the provision state for a node.

const (
	TargetActive   TargetProvisionState = "active"
	TargetDeleted  TargetProvisionState = "deleted"
	TargetManage   TargetProvisionState = "manage"
	TargetProvide  TargetProvisionState = "provide"
	TargetInspect  TargetProvisionState = "inspect"
	TargetAbort    TargetProvisionState = "abort"
	TargetClean    TargetProvisionState = "clean"
	TargetAdopt    TargetProvisionState = "adopt"
	TargetRescue   TargetProvisionState = "rescue"
	TargetUnrescue TargetProvisionState = "unrescue"
)

type UpdateOp

type UpdateOp string
const (
	ReplaceOp UpdateOp = "replace"
	AddOp     UpdateOp = "add"
	RemoveOp  UpdateOp = "remove"
)

type UpdateOperation

type UpdateOperation struct {
	Op    UpdateOp    `json:"op" required:"true"`
	Path  string      `json:"path" required:"true"`
	Value interface{} `json:"value,omitempty"`
}

func (UpdateOperation) ToNodeUpdateMap

func (opts UpdateOperation) ToNodeUpdateMap() (map[string]interface{}, error)

type UpdateOpts

type UpdateOpts []Patch

UpdateOpts is a slice of Patches used to update a node

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult is the response from an Update operation. Call its Extract method to interpret it as a Node.

func Update

func Update(client *gophercloud.ServiceClient, id string, opts UpdateOpts) (r UpdateResult)

Update requests that a node be updated

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Node, error)

Extract interprets any nodeResult as a Node, if possible.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

type ValidateResult

type ValidateResult struct {
	gophercloud.Result
}

ValidateResult is the response from a Validate operation. Call its Extract method to interpret it as a NodeValidation struct.

func Validate

func Validate(client *gophercloud.ServiceClient, id string) (r ValidateResult)

Request that Ironic validate whether the Node’s driver has enough information to manage the Node. This polls each interface on the driver, and returns the status of that interface.

func (ValidateResult) Extract

func (r ValidateResult) Extract() (*NodeValidation, error)

Extract interprets a ValidateResult as NodeValidation, if possible.

Directories

Path Synopsis
nodes unit tests
nodes unit tests

Jump to

Keyboard shortcuts

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