Class: Kangaroo::Util::Proxy::Superadmin

Inherits:
Kangaroo::Util::Proxy show all
Defined in:
lib/kangaroo/util/proxy/superadmin.rb

Instance Method Summary collapse

Methods inherited from Kangaroo::Util::Proxy

#__initialize__, #call!, new

Instance Method Details

#change_admin_password(new_password) ⇒ Object

Change superadmin password

Parameters:

  • new_password

    new superadmin password

Returns:

  • true



59
60
61
# File 'lib/kangaroo/util/proxy/superadmin.rb', line 59

def change_admin_password new_password
  call! :change_admin_password, new_password
end

#create(db_name, demo, lang, password) ⇒ Integer

Create a new database

Parameters:

  • db_name (String)

    name for new database

  • demo (boolean)

    preload database with demo data

  • lang (String)

    default language for new database

  • password (String)

    set administrator password for new database

Returns:

  • (Integer)

    thread id to check progress



11
12
13
# File 'lib/kangaroo/util/proxy/superadmin.rb', line 11

def create db_name, demo, lang, password
  call! :create, db_name, demo, lang, password
end

#drop(db_name) ⇒ Object

Drop a database by name

Parameters:

  • db_name

    name of database to drop



27
28
29
# File 'lib/kangaroo/util/proxy/superadmin.rb', line 27

def drop db_name
  call! :drop, db_name
end

#dump(db_name) ⇒ Object

Dump/Backup a database by name

Parameters:

  • db_name

    name of database to backup

Returns:

  • database dump



35
36
37
# File 'lib/kangaroo/util/proxy/superadmin.rb', line 35

def dump db_name
  call! :dump, db_name
end

#get_progress(id) ⇒ Object

Check progress on database creation. Pass the id you get from #create as only parameter

Parameters:

  • id

    id from #create

Returns:

  • progress as float between 0.0 and 1.0



20
21
22
# File 'lib/kangaroo/util/proxy/superadmin.rb', line 20

def get_progress id
  call! :get_progress, id
end

#migrate_databases(databases) ⇒ Object

Migrate specified databases

Parameters:

  • databases

    list of databases to migrate



66
67
68
# File 'lib/kangaroo/util/proxy/superadmin.rb', line 66

def migrate_databases databases
  call! :migrate_databases, databases
end

#rename(old_name, new_name) ⇒ Object

Rename a database

Parameters:

  • old_name

    database to rename

  • new_name

    new name for database



51
52
53
# File 'lib/kangaroo/util/proxy/superadmin.rb', line 51

def rename old_name, new_name
  call! :rename, old_name, new_name
end

#restore(db_name, data) ⇒ Object

Load/Restore a database

Parameters:

  • db_name

    name of database to restore to (or create)

  • data

    dump data to load into database



43
44
45
# File 'lib/kangaroo/util/proxy/superadmin.rb', line 43

def restore db_name, data
  call! :restore, db_name, data
end