Module: Pagoda::Apis::Database

Included in:
Client
Defined in:
lib/pagoda-client/apis/database.rb

Instance Method Summary collapse

Instance Method Details

#database_create(app) ⇒ Object



13
14
15
# File 'lib/pagoda-client/apis/database.rb', line 13

def database_create(app)
  post("/apps/#{app}/databases", {:type => :mysql})
end

#database_destroy(app, database) ⇒ Object



17
18
19
# File 'lib/pagoda-client/apis/database.rb', line 17

def database_destroy(app, database)
  delete("/apps/#{app}/databases/#{database}")
end

#database_exists?(app, database) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
30
31
# File 'lib/pagoda-client/apis/database.rb', line 26

def database_exists?(app, database)
  get("/apps/#{app}/databases/#{database}")
  true
rescue RestClient::ResourceNotFound => e
  false
end

#database_info(app, database) ⇒ Object



9
10
11
# File 'lib/pagoda-client/apis/database.rb', line 9

def database_info(app, database)
  json get("/apps/#{app}/databases/#{database}")
end

#database_list(app) ⇒ Object



5
6
7
# File 'lib/pagoda-client/apis/database.rb', line 5

def database_list(app)
  json get("/apps/#{app}/databases")
end

#database_update(app, database, cpu, ram) ⇒ Object



21
22
23
24
# File 'lib/pagoda-client/apis/database.rb', line 21

def database_update(app, database, cpu, ram)
  # \/ maybe???
  # put("/apps/#{app}/databases/#{database}", { :update => {:cpu => cpu, :ram => ram } } )
end