module Deployment module Methods module CDB def get_all_config_parameters # merge cdb data $recipe_config.merge @cdb end def get_cdb_parameters(version) Helper.validates_presence_of version, "version parameter is missing" Helper.validates_presence_of $recipe_config['cdb_host'], \ "cdb_host parameter is missing" Helper.validates_presence_of $recipe_config['cdb_context'], \ "cdb_context parameter is missing" cdb = Provider::CDB.new cdb.protocol = 'http' cdb.host = $recipe_config['cdb_host'] cdb.context = $recipe_config['cdb_context'] cdb.env = $recipe_config[:env] cdb.get_parameters(File.join( $recipe_config[:env], \ $recipe_config[:module_name] ), version) end def set_cdb_parameter(key, value) Helper.validates_presence_of $recipe_config['cdb_host'], \ "cdb_host parameter is missing" Helper.validates_presence_of $recipe_config['cdb_context'], \ "cdb_context parameter is missing" cdb = Provider::CDB.new cdb.protocol = 'http' cdb.host = $recipe_config['cdb_host'] cdb.context = $recipe_config['cdb_context'] cdb.env = $recipe_config[:env] cdb.set_parameter(File.join( $recipe_config[:env], \ $recipe_config[:module_name] ), key, value) end def set_cdb_parameter_4_app(module_name, app_name, key, value) Helper.validates_presence_of $recipe_config['cdb_host'], \ "cdb_host parameter is missing" Helper.validates_presence_of $recipe_config['cdb_context'], \ "cdb_context parameter is missing" cdb = Provider::CDB.new cdb.protocol = 'http' cdb.host = $recipe_config['cdb_host'] cdb.context = $recipe_config['cdb_context'] cdb.env = $recipe_config['ENVIRONMENT'] cdb.set_parameter(File.join( module_name, app_name ), key, value) end end end end