func ChangePowerState(client *gophercloud.ServiceClient, id string, opts PowerStateOptsBuilder) (r ChangePowerStateResult) {
	reqBody, err := opts.ToPowerStateMap()
	if err != nil {
		r.Err = err
		return
	}
	resp, err := client.Put(powerStateURL(client, id), reqBody, nil, &gophercloud.RequestOpts{
		OkCodes: []int{202},
	})
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
Request to change a Node's power state.
package nodes
import (
	"fmt"
	"github.com/gophercloud/gophercloud"
	"github.com/gophercloud/gophercloud/pagination"
)
type ListOptsBuilder interface {
	ToNodeListQuery() (string, error)
	ToNodeListDetailQuery() (string, error)
}
type ProvisionState string
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"
	RescueWait   ProvisionState = "rescue wait"
	Unrescuing   ProvisionState = "unrescuing"
)
type TargetProvisionState string
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 ListOpts struct {
	InstanceUUID string `q:"instance_uuid"`
	ChassisUUID string `q:"chassis_uuid"`
	Maintenance bool `q:"maintenance"`
	Associated bool `q:"associated"`
	ProvisionState ProvisionState `q:"provision_state"`
	Driver string `q:"driver"`
	ResourceClass string `q:"resource_class"`
	ConductorGroup string `q:"conductor_group"`
	Fault string `q:"fault"`
	Fields []string `q:"fields"`
	Limit int `q:"limit"`
	Marker string `q:"marker"`
	SortDir string `q:"sort_dir"`
	SortKey string `q:"sort_key"`
	Owner string `q:"owner"`
}
func (opts ListOpts) ToNodeListQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	return q.String(), err
}
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager {
	url := listURL(client)
	if opts != nil {
		query, err := opts.ToNodeListQuery()
		if err != nil {
			return pagination.Pager{Err: err}
		}
		url += query
	}
	return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page {
		return NodePage{pagination.LinkedPageBase{PageResult: r}}
	})
}
func (opts ListOpts) ToNodeListDetailQuery() (string, error) {
	if len(opts.Fields) > 0 {
		return "", fmt.Errorf("fields is not a valid option when getting a detailed listing of nodes")
	}
	q, err := gophercloud.BuildQueryString(opts)
	return q.String(), err
}
func ListDetail(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager {
	url := listDetailURL(client)
	if opts != nil {
		query, err := opts.ToNodeListDetailQuery()
		if err != nil {
			return pagination.Pager{Err: err}
		}
		url += query
	}
	return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page {
		return NodePage{pagination.LinkedPageBase{PageResult: r}}
	})
}
func Get(client *gophercloud.ServiceClient, id string) (r GetResult) {
	resp, err := client.Get(getURL(client, id), &r.Body, &gophercloud.RequestOpts{
		OkCodes: []int{200},
	})
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
type CreateOptsBuilder interface {
	ToNodeCreateMap() (map[string]interface{}, error)
}
type CreateOpts struct {
	AutomatedClean *bool `json:"automated_clean,omitempty"`
	BootInterface string `json:"boot_interface,omitempty"`
	ConductorGroup string `json:"conductor_group,omitempty"`
	ConsoleInterface string `json:"console_interface,omitempty"`
	DeployInterface string `json:"deploy_interface,omitempty"`
	DriverInfo map[string]interface{} `json:"driver_info,omitempty"`
	Driver string `json:"driver,omitempty"`
	Extra map[string]interface{} `json:"extra,omitempty"`
	InspectInterface string `json:"inspect_interface,omitempty"`
	ManagementInterface string `json:"management_interface,omitempty"`
	Name string `json:"name,omitempty"`
	NetworkInterface string `json:"network_interface,omitempty"`
	PowerInterface string `json:"power_interface,omitempty"`
	Properties map[string]interface{} `json:"properties,omitempty"`
	RAIDInterface string `json:"raid_interface,omitempty"`
	RescueInterface string `json:"rescue_interface,omitempty"`
	ResourceClass string `json:"resource_class,omitempty"`
	StorageInterface string `json:"storage_interface,omitempty"`
	UUID string `json:"uuid,omitempty"`
	VendorInterface string `json:"vendor_interface,omitempty"`
	Owner string `json:"owner,omitempty"`
}
func (opts CreateOpts) ToNodeCreateMap() (map[string]interface{}, error) {
	body, err := gophercloud.BuildRequestBody(opts, "")
	if err != nil {
		return nil, err
	}
	return body, nil
}
func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) {
	reqBody, err := opts.ToNodeCreateMap()
	if err != nil {
		r.Err = err
		return
	}
	resp, err := client.Post(createURL(client), reqBody, &r.Body, nil)
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
type Patch interface {
	ToNodeUpdateMap() (map[string]interface{}, error)
}
type UpdateOpts []Patch
type UpdateOp string
const (
	ReplaceOp UpdateOp = "replace"
	AddOp     UpdateOp = "add"
	RemoveOp  UpdateOp = "remove"
)
type UpdateOperation struct {
	Op    UpdateOp    `json:"op" required:"true"`
	Path  string      `json:"path" required:"true"`
	Value interface{} `json:"value,omitempty"`
}
func (opts UpdateOperation) ToNodeUpdateMap() (map[string]interface{}, error) {
	return gophercloud.BuildRequestBody(opts, "")
}
func Update(client *gophercloud.ServiceClient, id string, opts UpdateOpts) (r UpdateResult) {
	body := make([]map[string]interface{}, len(opts))
	for i, patch := range opts {
		result, err := patch.ToNodeUpdateMap()
		if err != nil {
			r.Err = err
			return
		}
		body[i] = result
	}
	resp, err := client.Patch(updateURL(client, id), body, &r.Body, &gophercloud.RequestOpts{
		OkCodes: []int{200},
	})
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult) {
	resp, err := client.Delete(deleteURL(client, id), nil)
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
func Validate(client *gophercloud.ServiceClient, id string) (r ValidateResult) {
	resp, err := client.Get(validateURL(client, id), &r.Body, &gophercloud.RequestOpts{
		OkCodes: []int{200},
	})
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
func InjectNMI(client *gophercloud.ServiceClient, id string) (r InjectNMIResult) {
	resp, err := client.Put(injectNMIURL(client, id), map[string]string{}, nil, &gophercloud.RequestOpts{
		OkCodes: []int{204},
	})
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
type BootDeviceOpts struct {
	BootDevice string `json:"boot_device"`  
	Persistent bool   `json:"persistent"`   
}
type BootDeviceOptsBuilder interface {
	ToBootDeviceMap() (map[string]interface{}, error)
}
func (opts BootDeviceOpts) ToBootDeviceMap() (map[string]interface{}, error) {
	body, err := gophercloud.BuildRequestBody(opts, "")
	if err != nil {
		return nil, err
	}
	return body, nil
}
func SetBootDevice(client *gophercloud.ServiceClient, id string, bootDevice BootDeviceOptsBuilder) (r SetBootDeviceResult) {
	reqBody, err := bootDevice.ToBootDeviceMap()
	if err != nil {
		r.Err = err
		return
	}
	resp, err := client.Put(bootDeviceURL(client, id), reqBody, nil, &gophercloud.RequestOpts{
		OkCodes: []int{204},
	})
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
func GetBootDevice(client *gophercloud.ServiceClient, id string) (r BootDeviceResult) {
	resp, err := client.Get(bootDeviceURL(client, id), &r.Body, &gophercloud.RequestOpts{
		OkCodes: []int{200},
	})
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
func GetSupportedBootDevices(client *gophercloud.ServiceClient, id string) (r SupportedBootDeviceResult) {
	resp, err := client.Get(supportedBootDeviceURL(client, id), &r.Body, &gophercloud.RequestOpts{
		OkCodes: []int{200},
	})
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
type StepInterface string
const (
	InterfaceBIOS       StepInterface = "bios"
	InterfaceDeploy     StepInterface = "deploy"
	InterfaceManagement StepInterface = "management"
	InterfacePower      StepInterface = "power"
	InterfaceRAID       StepInterface = "raid"
)
type CleanStep struct {
	Interface StepInterface          `json:"interface" required:"true"`
	Step      string                 `json:"step" required:"true"`
	Args      map[string]interface{} `json:"args,omitempty"`
}
type DeployStep struct {
	Interface StepInterface          `json:"interface" required:"true"`
	Step      string                 `json:"step" required:"true"`
	Args      map[string]interface{} `json:"args" required:"true"`
	Priority  int                    `json:"priority" required:"true"`
}
type ProvisionStateOptsBuilder interface {
	ToProvisionStateMap() (map[string]interface{}, error)
}
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"`
}
type ProvisionStateOpts struct {
	Target         TargetProvisionState `json:"target" required:"true"`
	ConfigDrive    interface{}          `json:"configdrive,omitempty"`
	CleanSteps     []CleanStep          `json:"clean_steps,omitempty"`
	DeploySteps    []DeployStep         `json:"deploy_steps,omitempty"`
	RescuePassword string               `json:"rescue_password,omitempty"`
}
func (opts ProvisionStateOpts) ToProvisionStateMap() (map[string]interface{}, error) {
	body, err := gophercloud.BuildRequestBody(opts, "")
	if err != nil {
		return nil, err
	}
	return body, nil
}
func ChangeProvisionState(client *gophercloud.ServiceClient, id string, opts ProvisionStateOptsBuilder) (r ChangeStateResult) {
	reqBody, err := opts.ToProvisionStateMap()
	if err != nil {
		r.Err = err
		return
	}
	resp, err := client.Put(provisionStateURL(client, id), reqBody, nil, &gophercloud.RequestOpts{
		OkCodes: []int{202},
	})
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
type TargetPowerState string
const (
	PowerOn       TargetPowerState = "power on"
	PowerOff      TargetPowerState = "power off"
	Rebooting     TargetPowerState = "rebooting"
	SoftPowerOff  TargetPowerState = "soft power off"
	SoftRebooting TargetPowerState = "soft rebooting"
)
type PowerStateOptsBuilder interface {
	ToPowerStateMap() (map[string]interface{}, error)
}
type PowerStateOpts struct {
	Target  TargetPowerState `json:"target" required:"true"`
	Timeout int              `json:"timeout,omitempty"`
}
func (opts PowerStateOpts) ToPowerStateMap() (map[string]interface{}, error) {
	body, err := gophercloud.BuildRequestBody(opts, "")
	if err != nil {
		return nil, err
	}
	return body, nil
}