gophercloud: github.com/rackspace/gophercloud/openstack/identity/v2/users Index | Files

package users

import "github.com/rackspace/gophercloud/openstack/identity/v2/users"

Index

Package Files

doc.go requests.go results.go urls.go

func ExtractRoles Uses

func ExtractRoles(page pagination.Page) ([]Role, error)

ExtractRoles returns a slice of Roles contained in a single page of results.

func ExtractUsers Uses

func ExtractUsers(page pagination.Page) ([]User, error)

ExtractUsers returns a slice of Tenants contained in a single page of results.

func List Uses

func List(client *gophercloud.ServiceClient) pagination.Pager

func ListRoles Uses

func ListRoles(client *gophercloud.ServiceClient, tenantID, userID string) pagination.Pager

func ResourceURL Uses

func ResourceURL(c *gophercloud.ServiceClient, id string) string

type CommonOpts Uses

type CommonOpts struct {
    // Either a name or username is required. When provided, the value must be
    // unique or a 409 conflict error will be returned. If you provide a name but
    // omit a username, the latter will be set to the former; and vice versa.
    Name, Username string

    // The ID of the tenant to which you want to assign this user.
    TenantID string

    // Indicates whether this user is enabled or not.
    Enabled EnabledState

    // The email address of this user.
    Email string
}

CommonOpts are the parameters that are shared between CreateOpts and UpdateOpts

type CreateOpts Uses

type CreateOpts CommonOpts

CreateOpts represents the options needed when creating new users.

func (CreateOpts) ToUserCreateMap Uses

func (opts CreateOpts) ToUserCreateMap() (map[string]interface{}, error)

ToUserCreateMap assembles a request body based on the contents of a CreateOpts.

type CreateOptsBuilder Uses

type CreateOptsBuilder interface {
    ToUserCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder describes struct types that can be accepted by the Create call.

type CreateResult Uses

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

CreateResult represents the result of a Create operation

func Create Uses

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult

Create is the operation responsible for creating new users.

func (CreateResult) Extract Uses

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

Extract interprets any commonResult as a User, if possible.

type DeleteResult Uses

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

DeleteResult represents the result of a Delete operation

func Delete Uses

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

Delete is the operation responsible for permanently deleting an API user.

func (DeleteResult) Extract Uses

func (r DeleteResult) Extract() (*User, error)

Extract interprets any commonResult as a User, if possible.

type EnabledState Uses

type EnabledState *bool

EnabledState represents whether the user is enabled or not.

var (
    Enabled  EnabledState = &iTrue
    Disabled EnabledState = &iFalse
)

Useful variables to use when creating or updating users.

type GetResult Uses

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

GetResult represents the result of a Get operation

func Get Uses

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

Get requests details on a single user, either by ID.

func (GetResult) Extract Uses

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

Extract interprets any commonResult as a User, if possible.

type Role Uses

type Role struct {
    // UUID of the role
    ID  string

    // Name of the role
    Name string
}

Role assigns specific responsibilities to users, allowing them to accomplish certain API operations whilst scoped to a service.

type RolePage Uses

type RolePage struct {
    pagination.SinglePageBase
}

RolePage is a single page of a user Role collection.

func (RolePage) IsEmpty Uses

func (page RolePage) IsEmpty() (bool, error)

IsEmpty determines whether or not a page of Tenants contains any results.

type UpdateOpts Uses

type UpdateOpts CommonOpts

UpdateOpts specifies the base attributes that may be updated on an existing server.

func (UpdateOpts) ToUserUpdateMap Uses

func (opts UpdateOpts) ToUserUpdateMap() map[string]interface{}

ToUserUpdateMap formats an UpdateOpts structure into a request body.

type UpdateOptsBuilder Uses

type UpdateOptsBuilder interface {
    ToUserUpdateMap() map[string]interface{}
}

UpdateOptsBuilder allows extensions to add additional attributes to the Update request.

type UpdateResult Uses

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

UpdateResult represents the result of an Update operation

func Update Uses

func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult

Update is the operation responsible for updating exist users by their UUID.

func (UpdateResult) Extract Uses

func (r UpdateResult) Extract() (*User, error)

Extract interprets any commonResult as a User, if possible.

type User Uses

type User struct {
    // The UUID for this user.
    ID  string

    // The human name for this user.
    Name string

    // The username for this user.
    Username string

    // Indicates whether the user is enabled (true) or disabled (false).
    Enabled bool

    // The email address for this user.
    Email string

    // The ID of the tenant to which this user belongs.
    TenantID string `mapstructure:"tenant_id"`
}

User represents a user resource that exists on the API.

type UserPage Uses

type UserPage struct {
    pagination.SinglePageBase
}

UserPage is a single page of a User collection.

func (UserPage) IsEmpty Uses

func (page UserPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a page of Tenants contains any results.

Package users imports 4 packages (graph) and is imported by 2 packages. Updated 2016-07-23. Refresh now. Tools for package owners.