Class: Cloudscale::Preops::RedisPreop
- Inherits:
-
PluginPreop
- Object
- Preop
- PluginPreop
- Cloudscale::Preops::RedisPreop
- Includes:
- Singleton
- Defined in:
- lib/cloudscale/plugins/redis/preops/redis_preop.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#options ⇒ Object
Returns the value of attribute options.
Attributes inherited from PluginPreop
Attributes inherited from Preop
Instance Method Summary collapse
-
#initialize ⇒ RedisPreop
constructor
A new instance of RedisPreop.
- #is_enabled ⇒ Object
- #register ⇒ Object
Methods inherited from PluginPreop
Methods inherited from Preop
#init, #init_charts, #init_menus
Constructor Details
#initialize ⇒ RedisPreop
Returns a new instance of RedisPreop.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/cloudscale/plugins/redis/preops/redis_preop.rb', line 39 def initialize self.init begin timeout = Redis::Client::DEFAULTS[:timeout] reconnect_attempts = Redis::Client::DEFAULTS[:reconnect_attempts] rescue timeout = 30 reconnect_attempts = 5 end = { :"redis-host" => { :argument => "--redis-host", :description => "Host for your Redis Instance (e.g. host.instance.com)", :required => true, :value => nil }, :"redis-port" => { :argument => "--redis-port", :description => "Port for your Redis Instance (Standard 5432)", :required => false, :value => 6379 }, :"redis-db" => { :argument => "--redis-db", :description => "Database of your Redis instance", :required => false, :value => nil }, :"redis-username" => { :argument => "--redis-username", :description => "Username for your Redis instance", :required => false, :value => nil }, :"redis-password" => { :argument => "--redis-password", :description => "Password for your Redis instance", :required => false, :value => nil }, :"redis-timeout" => { :argument => "--redis-timeout", :description => "Timeout for your Redis instance", :required => false, :value => timeout }, :"redis-reconnect-attempts" => { :argument => "--redis-reconnect-attempts", :description => "Reconnect attempts for your Redis instance", :required => false, :value => reconnect_attempts } } end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
20 21 22 |
# File 'lib/cloudscale/plugins/redis/preops/redis_preop.rb', line 20 def connection @connection end |
#options ⇒ Object
Returns the value of attribute options.
20 21 22 |
# File 'lib/cloudscale/plugins/redis/preops/redis_preop.rb', line 20 def end |
Instance Method Details
#is_enabled ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/cloudscale/plugins/redis/preops/redis_preop.rb', line 22 def is_enabled enabled = false if !defined? Redis enabled = false end enabled end |
#register ⇒ Object
32 33 34 35 36 37 |
# File 'lib/cloudscale/plugins/redis/preops/redis_preop.rb', line 32 def register if is_enabled init_charts("#{File.dirname(__FILE__)}/../data/redis_chart.json") ("#{File.dirname(__FILE__)}/../data/redis_menu.json") end end |