Overview
  • Namespace
  • Class

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CDN
      • Resource
    • CloudMonitoring
      • Collection
      • Exception
      • Resource
    • Common
      • Collection
      • Constants
      • Exceptions
      • Http
        • Message
      • Log
      • Resource
      • Service
    • Compute
      • Constants
      • Exception
      • Resource
    • Database
      • Resource
    • DNS
      • Collection
      • Resource
    • Identity
      • Constants
      • Resource
    • Image
      • Enum
      • Resource
        • JsonPatch
        • Schema
    • LoadBalancer
      • Collection
      • Enum
      • Resource
    • Networking
      • Resource
    • ObjectStore
      • Constants
      • Enum
      • Exception
      • Resource
      • Upload
    • Orchestration
      • Resource
    • Queues
      • Collection
      • Exception
      • Resource
    • Volume
      • Resource

Classes

  • Backup
  • Configuration
  • Database
  • Datastore
  • DatastoreVersion
  • Instance
  • User

Class User

This class represents a User in the Rackspace "Red Dwarf" database-as-a-service product.

OpenCloud\Common\Base
Extended by OpenCloud\Common\Resource\BaseResource
Extended by OpenCloud\Common\Resource\PersistentResource
Extended by OpenCloud\Database\Resource\User
Namespace: OpenCloud\Database\Resource
Located at OpenCloud/Database/Resource/User.php

Methods summary

public
# __construct( OpenCloud\Database\Resource\Instance $instance, mixed $info = null, array $db = array() )

Creates a new database object

Creates a new database object

Unlike other objects (Servers, DataObjects, etc.), passing a database name to the constructor does not pull information from the database. For example, if you pass an ID to the Server() constructor, it will attempt to retrieve the information on that server from the service, and will return an error if it is not found. However, the Cloud Users service does not permit retrieval of information on individual databases (only via Collection), and thus passing in a name via the $info parameter only creates an in-memory object that is not necessarily tied to an actual database.

Parameters

$instance
the parent DbService\Instance of the database
$info

if an array or object, treated as properties to set; if a string, treated as the database name

$db
a list of database names to associate with the User

Throws

UserNameError
if $info is not a string, object, or array

Overrides

OpenCloud\Common\Resource\BaseResource::__construct
public type
# getName( )

Returns name of this user. Because it's so important (i.e. as an identifier), it will throw an error if not set/empty.

Returns name of this user. Because it's so important (i.e. as an identifier), it will throw an error if not set/empty.

Returns

type

Throws

OpenCloud\Common\Exceptions\DatabaseNameError
public string
# primaryKeyField( )

Returns the primary key field for the object

Returns the primary key field for the object

Returns

string
public
# addDatabase( string $dbname )

Adds a new database to the list of databases for the user

Adds a new database to the list of databases for the user

Parameters

$dbname
the database name to be added

Api

public Guzzle\Http\Message\Response
# update( array $params = array() )

Update a resource

Update a resource

Parameters

$params

Returns

Guzzle\Http\Message\Response

Overrides

OpenCloud\Common\Resource\PersistentResource::update
public OpenCloud\HttpResponse
# delete( )

Deletes a database user

Deletes a database user

Returns

OpenCloud\HttpResponse

Throws

UserDeleteError
if HTTP response is not Success

Api

Overrides

OpenCloud\Common\Resource\PersistentResource::delete
public Guzzle\Http\Message\Response
# grantDbAccess( array $databases )

Grant access to a set of one or more databases to a user.

Grant access to a set of one or more databases to a user.

Parameters

$databases

An array of one or more database names that this user will be granted access to. For example, ['foo', 'bar'] or ['baz'] are valid inputs.

Returns

Guzzle\Http\Message\Response

Methods inherited from OpenCloud\Common\Resource\PersistentResource

checkExtension(), create(), createUrl(), id(), name(), refresh(), refreshFromLocationUrl(), region(), status(), waitFor()

Methods inherited from OpenCloud\Common\Resource\BaseResource

findLink(), getClient(), getMetadata(), getParent(), getService(), getUrl(), jsonCollectionElement(), jsonCollectionName(), jsonName(), parseResponse(), resourceName(), setMetadata(), setParent(), setService(), url()

Methods inherited from OpenCloud\Common\Base

__call(), checkJsonError(), generateUuid(), getInstance(), getLogger(), hasLogger(), makeResourceIteratorOptions(), populate(), setLogger(), stripNamespace(), toCamel(), toUnderscores()

Constants summary

Constants inherited from OpenCloud\Common\Base

PATCH_CONTENT_TYPE

Properties summary

public string $name

The user name

The user name

#
public string $password

The user's password

The user's password

#
public array $databases

A list of database names assigned to the user

A list of database names assigned to the user

# array()
API documentation generated by ApiGen