Class CloudDB::Instance
In: lib/clouddb/instance.rb
Parent: Object

Methods

Attributes

connection  [R] 
created  [R] 
flavor_id  [R] 
hostname  [R] 
id  [R] 
links  [R] 
name  [R] 
root_enabled  [R] 
status  [R] 
updated  [R] 
volume_size  [R] 
volume_used  [R] 

Public Class methods

Creates a new CloudDB::Instance object representing a database instance.

Public Instance methods

Creates a brand new database and associates it with the current instance. Returns true if successful.

Options:

  :name - Specifies the database name for creating the database. *required*
  :character_set - Set of symbols and encodings. The default character set is utf8.
  :collate - Set of rules for comparing characters in a character set. The default value for collate is
             utf8_general_ci.

Creates brand new databases and associates them with the current instance. Returns true if successful.

Options for each database in the array:

  :name - Specifies the database name for creating the database. *required*
  :character_set - Set of symbols and encodings. The default character set is utf8.
  :collate - Set of rules for comparing characters in a character set. The default value for collate is
             utf8_general_ci.

Creates a brand new user and associates it with the current instance. Returns true if successful.

Options:

  :name - Name of the user for the database(s). *required*
  :password - User password for database access. *required*
  :databases - An array of databases with at least one database. *required*

Creates brand new users and associates them with the current instance. Returns true if successful.

Options for each user in the array:

  :name - Name of the user for the database(s). *required*
  :password - User password for database access. *required*
  :databases - An array of databases with at least one database. *required*
database(name)

Alias for get_database

databases()

Alias for list_databases

Deletes the current instance object. Returns true if successful, raises an exception otherwise.

Enables the root user for the specified database instance and returns the root password.

Example:

  i.enable_root
  => true

Returns a CloudDB::Database object for the given database name.

Returns a CloudDB::User object for the given user name.

Lists the databases associated with this instance

Example:

  i.list_databases

Lists the users associated with the current Instance

Example:

  i.list_users

Updates the information about the current instance object by making an API call.

refresh()

Alias for populate

This operation changes the memory size of the instance, assuming a valid flavorRef is provided. Restarts MySQL in the process.

Options:

  :flavor_ref - reference to a flavor as specified in the response from the List Flavors API call. *required*

This operation supports resizing the attached volume for an instance. It supports only increasing the volume size and does not support decreasing the size. The volume size is in gigabytes (GB) and must be an integer.

Options:

  :size - specifies the volume size in gigabytes (GB). The value specified must be between 1 and 10. *required*

The restart operation will restart only the MySQL Instance. Restarting MySQL will erase any dynamic configuration settings that you have made within MySQL.

Returns true if root user is enabled for the specified database instance or false otherwise.

Example:

  i.root_enabled?
  => true
user(name)

Alias for get_user

users()

Alias for list_users

[Validate]