users

package
v0.0.0-...-f8ec1b3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List lists the existing users.

func ListRoles

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

ListRoles lists the existing roles that can be assigned to users.

func ResourceURL

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

Types

type CommonOpts

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     string `json:"name,omitempty"`
	Username string `json:"username,omitempty"`
	// The ID of the tenant to which you want to assign this user.
	TenantID string `json:"tenantId,omitempty"`
	// Indicates whether this user is enabled or not.
	Enabled *bool `json:"enabled,omitempty"`
	// The email address of this user.
	Email string `json:"email,omitempty"`
}

CommonOpts are the parameters that are shared between CreateOpts and UpdateOpts

type CreateOpts

type CreateOpts CommonOpts

CreateOpts represents the options needed when creating new users.

func (CreateOpts) ToUserCreateMap

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

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

type CreateOptsBuilder

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

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

type CreateResult

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

CreateResult represents the result of a Create operation

func Create

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

Create is the operation responsible for creating new users.

func (CreateResult) Extract

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

Extract interprets any commonResult as a User, if possible.

type DeleteResult

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

DeleteResult represents the result of a Delete operation

func Delete

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

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

func (DeleteResult) Extract

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

Extract interprets any commonResult as a User, if possible.

type GetResult

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

GetResult represents the result of a Get operation

func Get

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

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

func (GetResult) Extract

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

Extract interprets any commonResult as a User, if possible.

type Role

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.

func ExtractRoles

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

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

type RolePage

type RolePage struct {
	pagination.SinglePageBase
}

RolePage is a single page of a user Role collection.

func (RolePage) IsEmpty

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

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

type UpdateOpts

type UpdateOpts CommonOpts

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

func (UpdateOpts) ToUserUpdateMap

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

ToUserUpdateMap formats an UpdateOpts structure into a request body.

type UpdateOptsBuilder

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

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

type UpdateResult

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

UpdateResult represents the result of an Update operation

func Update

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

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

func (UpdateResult) Extract

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

Extract interprets any commonResult as a User, if possible.

type User

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 `json:"tenant_id"`
}

User represents a user resource that exists on the API.

func ExtractUsers

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

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

type UserPage

type UserPage struct {
	pagination.SinglePageBase
}

UserPage is a single page of a User collection.

func (UserPage) IsEmpty

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

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

Directories

Path Synopsis
identity_users_v2
identity_users_v2

Jump to

Keyboard shortcuts

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