{"modulePath":"github.com/sample/gophercloud","version":"v0.0.0-20160826205153-07328757774b","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package groups\n\n## Functions\n\n```go\nfunc IDFromName(client *gophercloud.ServiceClient, name string) (string, error)\n```\nIDFromName is a convenience function that returns a security group's ID given its name.\n\n```go\nfunc List(c *gophercloud.ServiceClient, opts ListOpts) pagination.Pager\n```\nList 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.\n\n## Types\n\n```go\ntype CreateOpts struct {\n\t// Required. Human-readable name for the VIP. Does not have to be unique.\n\tName string `json:\"name\" required:\"true\"`\n\t// Required for admins. Indicates the owner of the VIP.\n\tTenantID string `json:\"tenant_id,omitempty\"`\n\t// Optional. Describes the security group.\n\tDescription string `json:\"description,omitempty\"`\n}\n```\nCreateOpts contains all the values needed to create a new security group.\n\n```go\nfunc (opts CreateOpts) ToSecGroupCreateMap() (map[string]interface{}, error)\n```\n\n```go\ntype CreateOptsBuilder interface {\n\tToSecGroupCreateMap() (map[string]interface{}, error)\n}\n```\n\n```go\ntype CreateResult struct {\n\t// contains filtered or unexported fields\n}\n```\nCreateResult represents the result of a create operation.\n\n```go\nfunc Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)\n```\nCreate is an operation which provisions a new security group with default security group rules for the IPv4 and IPv6 ether types.\n\n```go\nfunc (r CreateResult) Extract() (*SecGroup, error)\n```\nExtract is a function that accepts a result and extracts a security group.\n\n```go\ntype DeleteResult struct {\n\tgophercloud.ErrResult\n}\n```\nDeleteResult represents the result of a delete operation.\n\n```go\nfunc Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult)\n```\nDelete will permanently delete a particular security group based on its unique ID.\n\n```go\ntype GetResult struct {\n\t// contains filtered or unexported fields\n}\n```\nGetResult represents the result of a get operation.\n\n```go\nfunc Get(c *gophercloud.ServiceClient, id string) (r GetResult)\n```\nGet retrieves a particular security group based on its unique ID.\n\n```go\nfunc (r GetResult) Extract() (*SecGroup, error)\n```\nExtract is a function that accepts a result and extracts a security group.\n\n```go\ntype ListOpts struct {\n\tID       string `q:\"id\"`\n\tName     string `q:\"name\"`\n\tTenantID string `q:\"tenant_id\"`\n\tLimit    int    `q:\"limit\"`\n\tMarker   string `q:\"marker\"`\n\tSortKey  string `q:\"sort_key\"`\n\tSortDir  string `q:\"sort_dir\"`\n}\n```\nListOpts 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.\n\n```go\ntype SecGroup struct {\n\t// The UUID for the security group.\n\tID string\n\n\t// Human-readable name for the security group. Might not be unique. Cannot be\n\t// named \"default\" as that is automatically created for a tenant.\n\tName string\n\n\t// The security group description.\n\tDescription string\n\n\t// A slice of security group rules that dictate the permitted behaviour for\n\t// traffic entering and leaving the group.\n\tRules []rules.SecGroupRule `json:\"security_group_rules\"`\n\n\t// Owner of the security group. Only admin users can specify a TenantID\n\t// other than their own.\n\tTenantID string `json:\"tenant_id\"`\n}\n```\nSecGroup represents a container for security group rules.\n\n```go\nfunc ExtractGroups(r pagination.Page) ([]SecGroup, error)\n```\nExtractGroups 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.\n\n```go\ntype SecGroupPage struct {\n\tpagination.LinkedPageBase\n}\n```\nSecGroupPage is the page returned by a pager when traversing over a collection of security groups.\n\n```go\nfunc (r SecGroupPage) IsEmpty() (bool, error)\n```\nIsEmpty checks whether a SecGroupPage struct is empty.\n\n```go\nfunc (r SecGroupPage) NextPageURL() (string, error)\n```\nNextPageURL 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.\n\n","path":"github.com/sample/gophercloud/openstack/networking/v2/extensions/security/groups","name":"groups","synopsis":"","isRedistributable":true}
