import "github.com/rackspace/gophercloud/openstack/db/v1/users"
Package users provides information and interaction with the user API resource in the OpenStack Database service.
doc.go requests.go results.go urls.go
func List(client *gophercloud.ServiceClient, instanceID string) pagination.Pager
List will list all the users associated with a specified database instance, along with their associated databases. This operation will not return any system users or administrators for a database.
type BatchCreateOpts []CreateOpts
BatchCreateOpts allows multiple users to be created at once.
func (opts BatchCreateOpts) ToUserCreateMap() (map[string]interface{}, error)
ToUserCreateMap will generate a JSON map.
type CreateOpts struct { // [REQUIRED] Specifies a name for the user. Valid names can be composed // of the following characters: letters (either case); numbers; these // characters '@', '?', '#', ' ' but NEVER beginning a name string; '_' is // permitted anywhere. Prohibited characters that are forbidden include: // single quotes, double quotes, back quotes, semicolons, commas, backslashes, // and forward slashes. Spaces at the front or end of a user name are also // not permitted. Name string // [REQUIRED] Specifies a password for the user. Password string // [OPTIONAL] An array of databases that this user will connect to. The // "name" field is the only requirement for each option. Databases db.BatchCreateOpts // [OPTIONAL] Specifies the host from which a user is allowed to connect to // the database. Possible values are a string containing an IPv4 address or // "%" to allow connecting from any host. Optional; the default is "%". Host string }
CreateOpts is the struct responsible for configuring a new user; often in the context of an instance.
func (opts CreateOpts) ToMap() (map[string]interface{}, error)
ToMap is a convenience function for creating sub-maps for individual users.
CreateOptsBuilder is the top-level interface for creating JSON maps.
type CreateResult struct { gophercloud.ErrResult }
CreateResult represents the result of a create operation.
func Create(client *gophercloud.ServiceClient, instanceID string, opts CreateOptsBuilder) CreateResult
Create asynchronously provisions a new user for the specified database instance based on the configuration defined in CreateOpts. If databases are assigned for a particular user, the user will be granted all privileges for those specified databases. "root" is a reserved name and cannot be used.
type DeleteResult struct { gophercloud.ErrResult }
DeleteResult represents the result of a delete operation.
func Delete(client *gophercloud.ServiceClient, instanceID, userName string) DeleteResult
Delete will permanently delete a user from a specified database instance.
type User struct { // The user name Name string // The user password Password string // The databases associated with this user Databases []db.Database }
User represents a database user
func ExtractUsers(page pagination.Page) ([]User, error)
ExtractUsers will convert a generic pagination struct into a more relevant slice of User structs.
type UserPage struct { pagination.LinkedPageBase }
UserPage represents a single page of a paginated user collection.
IsEmpty checks to see whether the collection is empty.
NextPageURL will retrieve the next page URL.
Package users imports 5 packages (graph) and is imported by 11 packages. Updated 2018-07-02. Refresh now. Tools for package owners.