shelveunshelve

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 2 Imported by: 11

Documentation

Overview

Package shelveunshelve provides functionality to start and stop servers that have been provisioned by the OpenStack Compute service.

Example to Shelve, Shelve-offload and Unshelve a Server

serverID := "47b6b7b7-568d-40e4-868c-d5c41735532e"

err := shelveunshelve.Shelve(computeClient, serverID).ExtractErr()
if err != nil {
	panic(err)
}

err := shelveunshelve.ShelveOffload(computeClient, serverID).ExtractErr()
if err != nil {
	panic(err)
}

err := shelveunshelve.Unshelve(computeClient, serverID, nil).ExtractErr()
if err != nil {
	panic(err)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShelveOffloadResult

type ShelveOffloadResult struct {
	gophercloud.ErrResult
}

ShelveOffloadResult is the response from a Shelve operation. Call its ExtractErr method to determine if the request succeeded or failed.

func ShelveOffload

func ShelveOffload(client *gophercloud.ServiceClient, id string) (r ShelveOffloadResult)

ShelveOffload is the operation responsible for Shelve-Offload a Compute server.

type ShelveResult

type ShelveResult struct {
	gophercloud.ErrResult
}

ShelveResult is the response from a Shelve operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Shelve

func Shelve(client *gophercloud.ServiceClient, id string) (r ShelveResult)

Shelve is the operation responsible for shelving a Compute server.

type UnshelveOpts

type UnshelveOpts struct {
	// Sets the availability zone to unshelve a server
	// Available only after nova 2.77
	AvailabilityZone string `json:"availability_zone,omitempty"`
}

UnshelveOpts specifies parameters of shelve-offload action.

func (UnshelveOpts) ToUnshelveMap

func (opts UnshelveOpts) ToUnshelveMap() (map[string]interface{}, error)

type UnshelveOptsBuilder

type UnshelveOptsBuilder interface {
	ToUnshelveMap() (map[string]interface{}, error)
}

UnshelveOptsBuilder allows extensions to add additional parameters to the Unshelve request.

type UnshelveResult

type UnshelveResult struct {
	gophercloud.ErrResult
}

UnshelveResult is the response from Stop operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Unshelve

func Unshelve(client *gophercloud.ServiceClient, id string, opts UnshelveOptsBuilder) (r UnshelveResult)

Unshelve is the operation responsible for unshelve a Compute server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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