Documentation ¶
Overview ¶
Package groups manages and retrieves Groups in the OpenStack Identity Service.
Example to List Groups
listOpts := groups.ListOpts{ DomainID: "default", } allPages, err := groups.List(identityClient, listOpts).AllPages() if err != nil { panic(err) } allGroups, err := groups.ExtractGroups(allPages) if err != nil { panic(err) } for _, group := range allGroups { fmt.Printf("%+v\n", group) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
List enumerates the Groups to which the current token has access.
Types ¶
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult is the response from a Get operation. Call its Extract method to interpret it as a Group.
func Get ¶
func Get(client *gophercloud.ServiceClient, id string) (r GetResult)
Get retrieves details on a single group, by ID.
type Group ¶
type Group struct { // Description describes the group purpose. Description string `json:"description"` // DomainID is the domain ID the group belongs to. DomainID string `json:"domain_id"` // ID is the unique ID of the group. ID string `json:"id"` // Extra is a collection of miscellaneous key/values. Extra map[string]interface{} `json:"-"` // Links contains referencing links to the group. Links map[string]interface{} `json:"links"` // Name is the name of the group. Name string `json:"name"` }
Group helps manage related users.
func ExtractGroups ¶
func ExtractGroups(r pagination.Page) ([]Group, error)
ExtractGroups returns a slice of Groups contained in a single page of results.
func (*Group) UnmarshalJSON ¶
type GroupPage ¶
type GroupPage struct {
pagination.LinkedPageBase
}
GroupPage is a single page of Group results.
func (GroupPage) NextPageURL ¶
NextPageURL extracts the "next" link from the links section of the result.
type ListOpts ¶
type ListOpts struct { // DomainID filters the response by a domain ID. DomainID string `q:"domain_id"` // Name filters the response by group name. Name string `q:"name"` }
ListOpts provides options to filter the List results.
func (ListOpts) ToGroupListQuery ¶
ToGroupListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request