gophercloud: Index | Files

package groups

import ""


Package Files

requests.go results.go urls.go

func ExtractGroups Uses

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.

func IDFromName Uses

func IDFromName(client *gophercloud.ServiceClient, name string) (string, error)

IDFromName is a convenience function that returns a security group's ID given its name.

func List Uses

func List(c *gophercloud.ServiceClient, opts ListOpts) pagination.Pager

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.

type CreateOpts Uses

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

    // Required for admins. Indicates the owner of the VIP.
    TenantID string

    // Optional. Describes the security group.
    Description string

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

type CreateResult Uses

type CreateResult struct {
    // contains filtered or unexported fields

CreateResult represents the result of a create operation.

func Create Uses

func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult

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 Uses

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

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

type DeleteResult Uses

type DeleteResult struct {

DeleteResult represents the result of a delete operation.

func Delete Uses

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

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

type GetResult Uses

type GetResult struct {
    // contains filtered or unexported fields

GetResult represents the result of a get operation.

func Get Uses

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

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

func (GetResult) Extract Uses

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

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

type ListOpts Uses

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 Uses

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.

type SecGroupPage Uses

type SecGroupPage struct {

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

func (SecGroupPage) IsEmpty Uses

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

IsEmpty checks whether a SecGroupPage struct is empty.

func (SecGroupPage) NextPageURL Uses

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.

Package groups imports 5 packages (graph) and is imported by 46 packages. Updated 2016-07-14. Refresh now. Tools for package owners.