users

package
v0.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2015 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

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

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

func List

List returns a pager that allows traversal over a collection of users.

Types

type CommonOpts

type CommonOpts struct {
	// Required. The username to assign to the user. When provided, the username
	// must:
	// - start with an alphabetical (A-Za-z) character
	// - have a minimum length of 1 character
	//
	// The username may contain upper and lowercase characters, as well as any of
	// the following special character: . - @ _
	Username string

	// Required. Email address for the user account.
	Email string

	// Required. Indicates whether the user can authenticate after the user
	// account is created. If no value is specified, the default value is true.
	Enabled os.EnabledState

	// Optional. The password to assign to the user. If provided, the password
	// must:
	// - start with an alphabetical (A-Za-z) character
	// - have a minimum length of 8 characters
	// - contain at least one uppercase character, one lowercase character, and
	//   one numeric character.
	//
	// The password may contain any of the following special characters: . - @ _
	Password string
}

CommonOpts are the options which 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 CreateResult

type CreateResult struct {
	os.CreateResult
}

CreateResult represents the result of a Create operation

func Create

Create is the operation responsible for creating new users.

func (CreateResult) Extract

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

Extract will get the Snapshot object out of the CreateResult object.

type GetResult

type GetResult struct {
	os.GetResult
}

GetResult represents the result of a Get operation

func Get

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

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

func (GetResult) Extract

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

Extract will get the Snapshot object out of the GetResult object.

type ResetAPIKeyResult

type ResetAPIKeyResult struct {
	gophercloud.Result
}

ResetAPIKeyResult represents the server response to the ResetAPIKey method.

func ResetAPIKey

func ResetAPIKey(client *gophercloud.ServiceClient, id string) ResetAPIKeyResult

ResetAPIKey resets the User's API key.

func (ResetAPIKeyResult) Extract

func (r ResetAPIKeyResult) Extract() (*ResetAPIKeyValue, error)

Extract will get the Error or ResetAPIKeyValue object out of the ResetAPIKeyResult object.

type ResetAPIKeyValue

type ResetAPIKeyValue struct {
	// The Username for this API Key reset.
	Username string `mapstructure:"username"`

	// The new API Key for this user.
	APIKey string `mapstructure:"apiKey"`
}

ResetAPIKeyValue represents an API Key that has been reset.

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{}

ToUserUpdateMap formats an UpdateOpts structure into a request body.

type UpdateOptsBuilder

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

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

type UpdateResult

type UpdateResult struct {
	os.UpdateResult
}

UpdateResult represents the result of an Update operation

func Update

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

func (UpdateResult) Extract

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

Extract will get the Snapshot object out of the UpdateResult object.

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

	// Specifies the default region for the user account. This value is inherited
	// from the user administrator when the account is created.
	DefaultRegion string `mapstructure:"RAX-AUTH:defaultRegion"`

	// Identifies the domain that contains the user account. This value is
	// inherited from the user administrator when the account is created.
	DomainID string `mapstructure:"RAX-AUTH:domainId"`

	// The password value that the user needs for authentication. If the Add user
	// request included a password value, this attribute is not included in the
	// response.
	Password string `mapstructure:"OS-KSADM:password"`

	// Indicates whether the user has enabled multi-factor authentication.
	MultiFactorEnabled bool `mapstructure:"RAX-AUTH:multiFactorEnabled"`
}

User represents a user resource that exists on the API.

Jump to

Keyboard shortcuts

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