baymodels

package
v0.0.0-...-b267f23 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package baymodels contains functionality for working with Magnum baymodel resources. A baymodel is a template for a bay.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List returns a Pager which allows you to iterate over a collection of baymodels. It accepts a ListOptsBuilder, which allows you to sort the returned collection for greater efficiency.

Types

type BayModel

type BayModel struct {
	// UUID for the baymodel
	ID string `json:"uuid"`

	// Human-readable name for the baymodel. Might not be unique.
	Name string `json:"name"`

	// The type of container orchestration engine used by the bay.
	COE string `json:"coe"`

	// The underlying type of the host nodes, such as lxc or vm
	ServerType string `json:"server_type"`

	// The flavor used by nodes in the bay.
	FlavorID string `json:"flavor_id"`

	// The image used by nodes in the bay.
	ImageID string `json:"image_id"`

	// Specifies if the bay should use TLS certificates.
	TLSDisabled bool `json:"tls_disabled"`

	// The KeyPair used by the bay.
	KeyPairID string `json:"keypair_id"`
}

Represents a template for a Bay

func ExtractBayModels

func ExtractBayModels(r pagination.Page) ([]BayModel, error)

ExtractBayModels accepts a Page struct, specifically a BayModelPage struct, and extracts the elements into a slice of BayModel structs. In other words, a generic collection is mapped into a relevant slice.

type BayModelPage

type BayModelPage struct {
	pagination.LinkedPageBase
}

BayModelPage is the page returned by a pager when traversing over a collection of baymodels.

func (BayModelPage) IsEmpty

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

IsEmpty checks whether a BayModelPage struct is empty.

func (BayModelPage) NextPageURL

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

NextPageURL is invoked when a paginated collection of baymodels has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.

type GetResult

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

GetResult represents the result of a get operation.

func Get

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

Get retrieves a specific baymodel based on its unique ID.

func (GetResult) Extract

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

Extract is a function that accepts a result and extracts a baymodel resource.

type ListOpts

type ListOpts struct {
	Marker  string `q:"marker"`
	Limit   int    `q:"limit"`
	SortKey string `q:"sort_key"`
	SortDir string `q:"sort_dir"`
}

ListOpts allows the sorting of paginated collections through the API. SortKey allows you to sort by a particular baymodel attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.

func (ListOpts) ToBayModelListQuery

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

ToBayModelListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToBayModelListQuery() (string, error)
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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