groups

package
v0.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2015 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

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 security groups. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.

Types

type CreateOpts

type CreateOpts struct {
	// Required. Human-readable name for the VIP. Does not have to be unique.
	Name string

	// Optional. Describes the security group.
	Description string
}

CreateOpts contains all the values needed to create a new security group.

type CreateResult

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

CreateResult represents the result of a create operation.

func Create

Create is an operation which provisions a new security group with default security group rules for the IPv4 and IPv6 ether types.

func (CreateResult) Extract

func (r CreateResult) Extract() (*SecGroup, error)

Extract is a function that accepts a result and extracts a security group.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult represents the result of a delete operation.

func Delete

Delete will permanently delete a particular security group based on its unique ID.

type GetResult

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

GetResult represents the result of a get operation.

func Get

Get retrieves a particular security group based on its unique ID.

func (GetResult) Extract

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

Extract is a function that accepts a result and extracts a security group.

type ListOpts

type ListOpts struct {
	ID       string `q:"id"`
	Name     string `q:"name"`
	TenantID string `q:"tenant_id"`
	Limit    int    `q:"limit"`
	Marker   string `q:"marker"`
	SortKey  string `q:"sort_key"`
	SortDir  string `q:"sort_dir"`
}

ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the floating IP attributes you want to see returned. SortKey allows you to sort by a particular network attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.

type SecGroup

type SecGroup struct {
	// The UUID for the security group.
	ID string

	// Human-readable name for the security group. Might not be unique. Cannot be
	// named "default" as that is automatically created for a tenant.
	Name string

	// The security group description.
	Description string

	// A slice of security group rules that dictate the permitted behaviour for
	// traffic entering and leaving the group.
	Rules []rules.SecGroupRule `json:"security_group_rules" mapstructure:"security_group_rules"`

	// Owner of the security group. Only admin users can specify a TenantID
	// other than their own.
	TenantID string `json:"tenant_id" mapstructure:"tenant_id"`
}

SecGroup represents a container for security group rules.

func ExtractGroups

func ExtractGroups(page pagination.Page) ([]SecGroup, error)

ExtractGroups accepts a Page struct, specifically a SecGroupPage struct, and extracts the elements into a slice of SecGroup structs. In other words, a generic collection is mapped into a relevant slice.

type SecGroupPage

type SecGroupPage struct {
	pagination.LinkedPageBase
}

SecGroupPage is the page returned by a pager when traversing over a collection of security groups.

func (SecGroupPage) IsEmpty

func (p SecGroupPage) IsEmpty() (bool, error)

IsEmpty checks whether a SecGroupPage struct is empty.

func (SecGroupPage) NextPageURL

func (p SecGroupPage) NextPageURL() (string, error)

NextPageURL is invoked when a paginated collection of security groups 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.

Jump to

Keyboard shortcuts

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