Documentation
¶
Index ¶
- func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type GetResult
- type ListOpts
- type ListOptsBuilder
- type Option
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
- type User
- type UserPage
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 Users to which the current token has access.
Types ¶
type CreateOpts ¶
type CreateOpts struct {
// Name is the name of the new user.
Name string `json:"name" required:"true"`
// DefaultProjectID is the ID of the default project of the user.
DefaultProjectID string `json:"default_project_id,omitempty"`
// Description is a description of the user.
Description string `json:"description,omitempty"`
// DomainID is the ID of the domain the user belongs to.
DomainID string `json:"domain_id,omitempty"`
// Enabled sets the user status to enabled or disabled.
Enabled *bool `json:"enabled,omitempty"`
// Extra is free-form extra key/value pairs to describe the user.
Extra map[string]interface{} `json:"-"`
// Options are defined options in the API to enable certain features.
Options map[Option]interface{} `json:"options,omitempty"`
// Password is the password of the new user.
Password string `json:"password,omitempty"`
}
CreateOpts implements CreateOptsBuilder
func (CreateOpts) ToUserCreateMap ¶
func (opts CreateOpts) ToUserCreateMap() (map[string]interface{}, error)
ToUserCreateMap formats a CreateOpts into a create request.
type CreateOptsBuilder ¶
CreateOptsBuilder allows extensions to add additional parameters to the Create request.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult temporarily contains the response from the Create call.
func Create ¶
func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult)
Create creates a new User.
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
DeleteResult temporarily contains the response from the Delete call.
func Delete ¶
func Delete(client *gophercloud.ServiceClient, userID string) (r DeleteResult)
Delete deletes a user.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult temporarily contains the response from the Get call.
func Get ¶
func Get(client *gophercloud.ServiceClient, id string) (r GetResult)
Get retrieves details on a single user, by ID.
type ListOpts ¶
type ListOpts struct {
// DomainID filters the response by a domain ID.
DomainID string `q:"domain_id"`
// Enabled filters the response by enabled users.
Enabled *bool `q:"enabled"`
// IdpID filters the response by an Identity Provider ID.
IdPID string `q:"idp_id"`
// Name filters the response by username.
Name string `q:"name"`
// PasswordExpiresAt filters the response based on expiring passwords.
PasswordExpiresAt string `q:"password_expires_at"`
// ProtocolID filters the response by protocol ID.
ProtocolID string `q:"protocol_id"`
// UniqueID filters the response by unique ID.
UniqueID string `q:"unique_id"`
}
ListOpts allows you to query the List method.
func (ListOpts) ToUserListQuery ¶
ToUserListQuery formats a ListOpts into a query string.
type ListOptsBuilder ¶
ListOptsBuilder allows extensions to add additional parameters to the List request
type Option ¶
type Option string
Option is a specific option defined at the API to enable features on a user account.
const ( IgnoreChangePasswordUponFirstUse Option = "ignore_change_password_upon_first_use" IgnorePasswordExpiry Option = "ignore_password_expiry" IgnoreLockoutFailureAttempts Option = "ignore_lockout_failure_attempts" MultiFactorAuthRules Option = "multi_factor_auth_rules" MultiFactorAuthEnabled Option = "multi_factor_auth_enabled" )
type UpdateOpts ¶
type UpdateOpts struct {
// Name is the name of the new user.
Name string `json:"name,omitempty"`
// DefaultProjectID is the ID of the default project of the user.
DefaultProjectID string `json:"default_project_id,omitempty"`
// Description is a description of the user.
Description string `json:"description,omitempty"`
// DomainID is the ID of the domain the user belongs to.
DomainID string `json:"domain_id,omitempty"`
// Enabled sets the user status to enabled or disabled.
Enabled *bool `json:"enabled,omitempty"`
// Extra is free-form extra key/value pairs to describe the user.
Extra map[string]interface{} `json:"-"`
// Options are defined options in the API to enable certain features.
Options map[Option]interface{} `json:"options,omitempty"`
// Password is the password of the new user.
Password string `json:"password,omitempty"`
}
UpdateOpts implements UpdateOptsBuilder
func (UpdateOpts) ToUserUpdateMap ¶
func (opts UpdateOpts) ToUserUpdateMap() (map[string]interface{}, error)
ToUserUpdateMap formats a UpdateOpts into an update request.
type UpdateOptsBuilder ¶
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult temporarily contains the response from the Update call.
func Update ¶
func Update(client *gophercloud.ServiceClient, userID string, opts UpdateOptsBuilder) (r UpdateResult)
Update updates an existing User.
type User ¶
type User struct {
// DefaultProjectID is the ID of the default project of the user.
DefaultProjectID string `json:"default_project_id"`
// Description is the description of the user.
Description string `json:"description"`
// DomainID is the domain ID the user belongs to.
DomainID string `json:"domain_id"`
// Enabled is whether or not the user is enabled.
Enabled bool `json:"enabled"`
// Extra is a collection of miscellaneous key/values.
Extra map[string]interface{} `json:"-"`
// ID is the unique ID of the user.
ID string `json:"id"`
// Links contains referencing links to the user.
Links map[string]interface{} `json:"links"`
// Name is the name of the user.
Name string `json:"name"`
// Options are a set of defined options of the user.
Options map[string]interface{} `json:"options"`
// PasswordExpiresAt is the timestamp when the user's password expires.
PasswordExpiresAt time.Time `json:"-"`
}
User is a base unit of ownership.
func ExtractUsers ¶
func ExtractUsers(r pagination.Page) ([]User, error)
ExtractUsers returns a slice of Users contained in a single page of results.
func (*User) UnmarshalJSON ¶
type UserPage ¶
type UserPage struct {
pagination.LinkedPageBase
}
UserPage is a single page of User results.
func (UserPage) NextPageURL ¶
NextPageURL extracts the "next" link from the links section of the result.