gophercloud: Index | Files

package users

import ""

Package users provides information and interaction with the user API resource in the OpenStack Database service.


Package Files

doc.go requests.go results.go urls.go

func List Uses

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 Uses

type BatchCreateOpts []CreateOpts

BatchCreateOpts allows multiple users to be created at once.

func (BatchCreateOpts) ToUserCreateMap Uses

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

ToUserCreateMap will generate a JSON map.

type CreateOpts Uses

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 (CreateOpts) ToMap Uses

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

ToMap is a convenience function for creating sub-maps for individual users.

type CreateOptsBuilder Uses

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

CreateOptsBuilder is the top-level interface for creating JSON maps.

type CreateResult Uses

type CreateResult struct {

CreateResult represents the result of a create operation.

func Create Uses

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 Uses

type DeleteResult struct {

DeleteResult represents the result of a delete operation.

func Delete Uses

func Delete(client *gophercloud.ServiceClient, instanceID, userName string) DeleteResult

Delete will permanently delete a user from a specified database instance.

type User Uses

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 Uses

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

ExtractUsers will convert a generic pagination struct into a more relevant slice of User structs.

type UserPage Uses

type UserPage struct {

UserPage represents a single page of a paginated user collection.

func (UserPage) IsEmpty Uses

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

IsEmpty checks to see whether the collection is empty.

func (UserPage) NextPageURL Uses

func (page UserPage) NextPageURL() (string, error)

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.