Class: ChefBackup::DataMap
- Inherits:
-
Object
- Object
- ChefBackup::DataMap
- Defined in:
- lib/chef_backup/data_map.rb
Overview
DataMap class to store data about the data we're backing up
Class Attribute Summary collapse
Instance Attribute Summary collapse
-
#backup_time ⇒ Object
Returns the value of attribute backup_time.
-
#configs ⇒ Object
Returns the value of attribute configs.
-
#ha ⇒ Object
Returns the value of attribute ha.
-
#services ⇒ Object
Returns the value of attribute services.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
-
#topology ⇒ Object
Returns the value of attribute topology.
-
#versions ⇒ Object
Returns the value of attribute versions.
Instance Method Summary collapse
- #add_config(config, path) ⇒ Object
- #add_ha_info(k, v) ⇒ Object
- #add_service(service, data_dir) ⇒ Object
- #add_version(project_name, data) ⇒ Object
-
#initialize {|_self| ... } ⇒ DataMap
constructor
A new instance of DataMap.
- #manifest ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ DataMap
Returns a new instance of DataMap.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/chef_backup/data_map.rb', line 16 def initialize @services = {} @configs = {} @versions = {} @ha = {} yield self if block_given? @backup_time ||= Time.now.iso8601 @strategy ||= "none" @toplogy ||= "idontknow" end |
Class Attribute Details
.data_map ⇒ Object
7 8 9 |
# File 'lib/chef_backup/data_map.rb', line 7 def data_map @data_map ||= new end |
Instance Attribute Details
#backup_time ⇒ Object
Returns the value of attribute backup_time.
14 15 16 |
# File 'lib/chef_backup/data_map.rb', line 14 def backup_time @backup_time end |
#configs ⇒ Object
Returns the value of attribute configs.
14 15 16 |
# File 'lib/chef_backup/data_map.rb', line 14 def configs @configs end |
#ha ⇒ Object
Returns the value of attribute ha.
14 15 16 |
# File 'lib/chef_backup/data_map.rb', line 14 def ha @ha end |
#services ⇒ Object
Returns the value of attribute services.
14 15 16 |
# File 'lib/chef_backup/data_map.rb', line 14 def services @services end |
#strategy ⇒ Object
Returns the value of attribute strategy.
14 15 16 |
# File 'lib/chef_backup/data_map.rb', line 14 def strategy @strategy end |
#topology ⇒ Object
Returns the value of attribute topology.
14 15 16 |
# File 'lib/chef_backup/data_map.rb', line 14 def topology @topology end |
#versions ⇒ Object
Returns the value of attribute versions.
14 15 16 |
# File 'lib/chef_backup/data_map.rb', line 14 def versions @versions end |
Instance Method Details
#add_config(config, path) ⇒ Object
33 34 35 36 |
# File 'lib/chef_backup/data_map.rb', line 33 def add_config(config, path) @configs[config] ||= {} @configs[config]["data_dir"] = path end |
#add_ha_info(k, v) ⇒ Object
42 43 44 |
# File 'lib/chef_backup/data_map.rb', line 42 def add_ha_info(k, v) @ha[k] = v end |
#add_service(service, data_dir) ⇒ Object
28 29 30 31 |
# File 'lib/chef_backup/data_map.rb', line 28 def add_service(service, data_dir) @services[service] ||= {} @services[service]["data_dir"] = data_dir end |
#add_version(project_name, data) ⇒ Object
38 39 40 |
# File 'lib/chef_backup/data_map.rb', line 38 def add_version(project_name, data) @versions[project_name] = data end |
#manifest ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/chef_backup/data_map.rb', line 46 def manifest { "strategy" => strategy, "backup_time" => backup_time, "topology" => topology, "ha" => ha, "services" => services, "configs" => configs, "versions" => versions, } end |