servergroups

package
v0.0.0-...-d5be3fe Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package servergroups provides the ability to manage server groups

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List returns a Pager that allows you to iterate over a collection of ServerGroups.

Types

type CreateOpts

type CreateOpts struct {
	// Name is the name of the server group
	Name string `json:"name" required:"true"`
	// Policies are the server group policies
	Policies []string `json:"policies" required:"true"`
}

CreateOpts specifies a Server Group allocation request

func (CreateOpts) ToServerGroupCreateMap

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

ToServerGroupCreateMap constructs a request body from CreateOpts.

type CreateOptsBuilder

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

CreateOptsBuilder describes struct types that can be accepted by the Create call. Notably, the CreateOpts struct in this package does.

type CreateResult

type CreateResult struct {
	ServerGroupResult
}

CreateResult is the response from a Create operation. Call its Extract method to interpret it as a ServerGroup.

func Create

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

Create requests the creation of a new Server Group

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

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

func Delete

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

Delete requests the deletion of a previously allocated ServerGroup.

type GetResult

type GetResult struct {
	ServerGroupResult
}

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

func Get

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

Get returns data about a previously created ServerGroup.

type ServerGroup

type ServerGroup struct {
	// ID is the unique ID of the Server Group.
	ID string `json:"id"`

	// Name is the common name of the server group.
	Name string `json:"name"`

	// Polices are the group policies.
	Policies []string `json:"policies"`

	// Members are the members of the server group.
	Members []string `json:"members"`

	// Metadata includes a list of all user-specified key-value pairs attached to the Server Group.
	Metadata map[string]interface{}
}

A ServerGroup creates a policy for instance placement in the cloud

func ExtractServerGroups

func ExtractServerGroups(r pagination.Page) ([]ServerGroup, error)

ExtractServerGroups interprets a page of results as a slice of ServerGroups.

type ServerGroupPage

type ServerGroupPage struct {
	pagination.SinglePageBase
}

ServerGroupPage stores a single, only page of ServerGroups results from a List call.

func (ServerGroupPage) IsEmpty

func (page ServerGroupPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a ServerGroupsPage is empty.

type ServerGroupResult

type ServerGroupResult struct {
	gophercloud.Result
}

func (ServerGroupResult) Extract

func (r ServerGroupResult) Extract() (*ServerGroup, error)

Extract is a method that attempts to interpret any Server Group resource response as a ServerGroup struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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