Documentation ¶
Index ¶
- func List(client *gophercloud.ServiceClient) pagination.Pager
- func ListRoles(client *gophercloud.ServiceClient, tenantID, userID string) pagination.Pager
- func MockListUserResponse(t *testing.T)
- func ResourceURL(c *gophercloud.ServiceClient, id string) string
- type CommonOpts
- type CreateOpts
- type CreateOptsBuilder
- type CreateResult
- type DeleteResult
- type EnabledState
- type GetResult
- type Role
- type RolePage
- 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) pagination.Pager
func ListRoles ¶
func ListRoles(client *gophercloud.ServiceClient, tenantID, userID string) pagination.Pager
func MockListUserResponse ¶
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, 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 ¶
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 ¶
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) CreateResult
Create is the operation responsible for creating new users.
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) DeleteResult
Delete is the operation responsible for permanently deleting an API user.
type EnabledState ¶
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 ¶
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) GetResult
Get requests details on a single user, either by ID.
type Role ¶
Role assigns specific responsibilities to users, allowing them to accomplish certain API operations whilst scoped to a service.
func ExtractRoles ¶
func ExtractRoles(page 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.
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 {
// contains filtered or unexported fields
}
UpdateResult represents the result of an Update operation
func Update ¶
func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult
Update is the operation responsible for updating exist users by their UUID.
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"` }
User represents a user resource that exists on the API.
func ExtractUsers ¶
func ExtractUsers(page 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.