Class: Cloudscale::Preops::PostgresPreop
- Inherits:
-
PluginPreop
- Object
- Preop
- PluginPreop
- Cloudscale::Preops::PostgresPreop
- Includes:
- Singleton
- Defined in:
- lib/cloudscale/plugins/postgres/preops/postgres_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 ⇒ PostgresPreop
constructor
A new instance of PostgresPreop.
- #is_enabled ⇒ Object
- #register ⇒ Object
Methods inherited from PluginPreop
Methods inherited from Preop
#init, #init_charts, #init_menus
Constructor Details
#initialize ⇒ PostgresPreop
Returns a new instance of PostgresPreop.
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 |
# File 'lib/cloudscale/plugins/postgres/preops/postgres_preop.rb', line 39 def initialize self.init @options = { :"postgres-host" => { :argument => "--postgres-host", :description => "Host for your Postgres Instance (e.g. host.instance.com)", :required => true, :value => nil }, :"postgres-port" => { :argument => "--postgres-port", :description => "Port for your Postgres Instance (Standard 5432)", :required => false, :value => 5432 }, :"postgres-db" => { :argument => "--postgres-db", :description => "Database of your Postgres instance", :required => true, :value => nil }, :"postgres-username" => { :argument => "--postgres-username", :description => "Username for your Postgres instance", :required => false, :value => nil }, :"postgres-password" => { :argument => "--postgres-password", :description => "Password for your Postgres instance", :required => false, :value => nil } } end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
20 21 22 |
# File 'lib/cloudscale/plugins/postgres/preops/postgres_preop.rb', line 20 def connection @connection end |
#options ⇒ Object
Returns the value of attribute options.
20 21 22 |
# File 'lib/cloudscale/plugins/postgres/preops/postgres_preop.rb', line 20 def @options end |
Instance Method Details
#is_enabled ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/cloudscale/plugins/postgres/preops/postgres_preop.rb', line 22 def is_enabled enabled = false if !defined? PG enabled = false end enabled end |
#register ⇒ Object
32 33 34 35 36 37 |
# File 'lib/cloudscale/plugins/postgres/preops/postgres_preop.rb', line 32 def register if is_enabled init_charts("#{File.dirname(__FILE__)}/../data/postgres_chart.json") ("#{File.dirname(__FILE__)}/../data/postgres_menu.json") end end |