Sha256: 9a0658f38df80d0672ffeec04b67078ca664d631f9f565b4c42240ed77b3d513
Contents?: true
Size: 1.05 KB
Versions: 10
Compression:
Stored size: 1.05 KB
Contents
require 'acquia/cloud/entity' module Acquia class Cloud class Database < Entity def initialize(cloud, site, database) @cloud = cloud @site = site @data = database @url = "/sites/#{@site}/dbs/#{@data['name']}" end def name data['name'] end def on_environment(environment) DatabaseEnvironment.new(@cloud, @site, environment, {'name' => name}).refresh end def copy(from, to) from = standardise_env(from) to = standardise_env(to) task = @cloud.api.post("/sites/#{@site}/dbs/#{name}/db-copy/#{from}/#{to}") Task.new @cloud, @site, task end def backup_on(environment) task = @cloud.api.post("/sites/#{@site}/envs/#{environment}/dbs/#{name}/backups") Task.new @cloud, @site, task end private def standardise_env(env) case (env) when Environment env.name when String env else env.to_s end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems