gophercloud: github.com/rackspace/gophercloud/rackspace/compute/v2/servers Index | Files

package servers

import "github.com/rackspace/gophercloud/rackspace/compute/v2/servers"

Package servers provides information and interaction with the server API resource for the Rackspace Cloud Servers service.

Index

Package Files

delegate.go doc.go requests.go

func ChangeAdminPassword Uses

func ChangeAdminPassword(client *gophercloud.ServiceClient, id, newPassword string) os.ActionResult

ChangeAdminPassword alters the administrator or root password for a specified server.

func ConfirmResize Uses

func ConfirmResize(client *gophercloud.ServiceClient, id string) os.ActionResult

ConfirmResize confirms a previous resize operation on a server. See Resize() for more details.

func Create Uses

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

Create requests a server to be provisioned to the user in the current tenant.

func Delete Uses

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

Delete requests that a server previously provisioned be removed from your account.

func ExtractAddresses Uses

func ExtractAddresses(page pagination.Page) (map[string][]os.Address, error)

ExtractAddresses interprets the results of a single page from a ListAddresses() call, producing a map of Address slices.

func ExtractNetworkAddresses Uses

func ExtractNetworkAddresses(page pagination.Page) ([]os.Address, error)

ExtractNetworkAddresses interprets the results of a single page from a ListAddressesByNetwork() call, producing a map of Address slices.

func ExtractServers Uses

func ExtractServers(page pagination.Page) ([]os.Server, error)

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

func Get Uses

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

Get requests details on a single server, by ID.

func List Uses

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

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

func ListAddresses Uses

func ListAddresses(client *gophercloud.ServiceClient, id string) pagination.Pager

ListAddresses makes a request against the API to list the servers IP addresses.

func ListAddressesByNetwork Uses

func ListAddressesByNetwork(client *gophercloud.ServiceClient, id, network string) pagination.Pager

ListAddressesByNetwork makes a request against the API to list the servers IP addresses for the given network.

func Metadata Uses

func Metadata(client *gophercloud.ServiceClient, id string) os.GetMetadataResult

Metadata requests all the metadata for the given server ID.

func Reboot Uses

func Reboot(client *gophercloud.ServiceClient, id string, how os.RebootMethod) os.ActionResult

Reboot requests that a given server reboot. Two methods exist for rebooting a server:

os.HardReboot (aka PowerCycle) restarts the server instance by physically cutting power to the machine, or if a VM, terminating it at the hypervisor level. It's done. Caput. Full stop. Then, after a brief wait, power is restored or the VM instance restarted.

os.SoftReboot (aka OSReboot) simply tells the OS to restart under its own procedures. E.g., in Linux, asking it to enter runlevel 6, or executing "sudo shutdown -r now", or by asking Windows to restart the machine.

func Rebuild Uses

func Rebuild(client *gophercloud.ServiceClient, id string, opts os.RebuildOptsBuilder) os.RebuildResult

Rebuild will reprovision the server according to the configuration options provided in the RebuildOpts struct.

func Resize Uses

func Resize(client *gophercloud.ServiceClient, id string, opts os.ResizeOptsBuilder) os.ActionResult

Resize instructs the provider to change the flavor of the server. Note that this implies rebuilding it. Unfortunately, one cannot pass rebuild parameters to the resize function. When the resize completes, the server will be in RESIZE_VERIFY state. While in this state, you can explore the use of the new server's configuration. If you like it, call ConfirmResize() to commit the resize permanently. Otherwise, call RevertResize() to restore the old configuration.

func Update Uses

func Update(client *gophercloud.ServiceClient, id string, opts os.UpdateOptsBuilder) os.UpdateResult

Update requests an existing server to be updated with the supplied options.

func UpdateMetadata Uses

func UpdateMetadata(client *gophercloud.ServiceClient, id string, opts os.UpdateMetadataOptsBuilder) os.UpdateMetadataResult

UpdateMetadata updates (or creates) all the metadata specified by opts for the given server ID. This operation does not affect already-existing metadata that is not specified by opts.

func WaitForStatus Uses

func WaitForStatus(c *gophercloud.ServiceClient, id, status string, secs int) error

WaitForStatus will continually poll a server until it successfully transitions to a specified status. It will do this for at most the number of seconds specified.

type CreateOpts Uses

type CreateOpts struct {
    // Name [required] is the name to assign to the newly launched server.
    Name string

    // ImageRef [optional; required if ImageName is not provided] is the ID or full
    // URL to the image that contains the server's OS and initial state.
    // Also optional if using the boot-from-volume extension.
    ImageRef string

    // ImageName [optional; required if ImageRef is not provided] is the name of the
    // image that contains the server's OS and initial state.
    // Also optional if using the boot-from-volume extension.
    ImageName string

    // FlavorRef [optional; required if FlavorName is not provided] is the ID or
    // full URL to the flavor that describes the server's specs.
    FlavorRef string

    // FlavorName [optional; required if FlavorRef is not provided] is the name of
    // the flavor that describes the server's specs.
    FlavorName string

    // SecurityGroups [optional] lists the names of the security groups to which this server should belong.
    SecurityGroups []string

    // UserData [optional] contains configuration information or scripts to use upon launch.
    // Create will base64-encode it for you.
    UserData []byte

    // AvailabilityZone [optional] in which to launch the server.
    AvailabilityZone string

    // Networks [optional] dictates how this server will be attached to available networks.
    // By default, the server will be attached to all isolated networks for the tenant.
    Networks []os.Network

    // Metadata [optional] contains key-value pairs (up to 255 bytes each) to attach to the server.
    Metadata map[string]string

    // Personality [optional] includes files to inject into the server at launch.
    // Create will base64-encode file contents for you.
    Personality os.Personality

    // ConfigDrive [optional] enables metadata injection through a configuration drive.
    ConfigDrive bool

    // AdminPass [optional] sets the root user password. If not set, a randomly-generated
    // password will be created and returned in the response.
    AdminPass string

    // KeyPair [optional] specifies the name of the SSH KeyPair to be injected into the newly launched
    // server. See the "keypairs" extension in OpenStack compute v2.
    KeyPair string

    // DiskConfig [optional] controls how the created server's disk is partitioned. See the "diskconfig"
    // extension in OpenStack compute v2.
    DiskConfig diskconfig.DiskConfig

    // BlockDevice [optional] will create the server from a volume, which is created from an image,
    // a snapshot, or another volume.
    BlockDevice []bootfromvolume.BlockDevice
}

CreateOpts specifies all of the options that Rackspace accepts in its Create request, including the union of all extensions that Rackspace supports.

func (CreateOpts) ToServerCreateMap Uses

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

ToServerCreateMap constructs a request body using all of the OpenStack extensions that are active on Rackspace.

type RebuildOpts Uses

type RebuildOpts struct {
    // Required. The ID of the image you want your server to be provisioned on
    ImageID string

    // Name to set the server to
    Name string

    // Required. The server's admin password
    AdminPass string

    // AccessIPv4 [optional] provides a new IPv4 address for the instance.
    AccessIPv4 string

    // AccessIPv6 [optional] provides a new IPv6 address for the instance.
    AccessIPv6 string

    // Metadata [optional] contains key-value pairs (up to 255 bytes each) to attach to the server.
    Metadata map[string]string

    // Personality [optional] includes files to inject into the server at launch.
    // Rebuild will base64-encode file contents for you.
    Personality os.Personality

    // DiskConfig [optional] controls how the created server's disk is partitioned. See the "diskconfig"
    // extension in OpenStack compute v2.
    DiskConfig diskconfig.DiskConfig
}

RebuildOpts represents all of the configuration options used in a server rebuild operation that are supported by Rackspace.

func (RebuildOpts) ToServerRebuildMap Uses

func (opts RebuildOpts) ToServerRebuildMap() (map[string]interface{}, error)

ToServerRebuildMap constructs a request body using all of the OpenStack extensions that are active on Rackspace.

Package servers imports 5 packages (graph) and is imported by 123 packages. Updated 2016-07-23. Refresh now. Tools for package owners.