Class: Elasticsnap::Snapshot
- Inherits:
-
Object
- Object
- Elasticsnap::Snapshot
- Defined in:
- lib/elasticsnap/snapshot.rb
Instance Attribute Summary collapse
-
#cluster_name ⇒ Object
Returns the value of attribute cluster_name.
-
#mount ⇒ Object
Returns the value of attribute mount.
-
#quorum_nodes ⇒ Object
Returns the value of attribute quorum_nodes.
-
#security_group ⇒ Object
Returns the value of attribute security_group.
-
#ssh_user ⇒ Object
Returns the value of attribute ssh_user.
-
#url ⇒ Object
Returns the value of attribute url.
-
#wait_timeout ⇒ Object
Returns the value of attribute wait_timeout.
Instance Method Summary collapse
- #call ⇒ Object
- #ebs_snapshot! ⇒ Object
- #freeze_es(&block) ⇒ Object
- #freeze_fs(&block) ⇒ Object
-
#initialize(security_group: nil, url: nil, mount: nil, quorum_nodes: nil, wait_timeout: 30, cluster_name: nil, ssh_user: nil) ⇒ Snapshot
constructor
A new instance of Snapshot.
- #verify_es_cluster_status! ⇒ Object
Constructor Details
#initialize(security_group: nil, url: nil, mount: nil, quorum_nodes: nil, wait_timeout: 30, cluster_name: nil, ssh_user: nil) ⇒ Snapshot
Returns a new instance of Snapshot.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/elasticsnap/snapshot.rb', line 16 def initialize(security_group: nil, url: nil, mount: nil, quorum_nodes: nil, wait_timeout: 30, cluster_name: nil, ssh_user: nil) raise ArgumentError, "security_group required" if security_group.nil? raise ArgumentError, "url required" if url.nil? raise ArgumentError, "mount required" if mount.nil? raise ArgumentError, "quorum_nodes required" if quorum_nodes.nil? @security_group = security_group @url = url @mount = mount @quorum_nodes = quorum_nodes @wait_timeout = wait_timeout @cluster_name = cluster_name @ssh_user = ssh_user end |
Instance Attribute Details
#cluster_name ⇒ Object
Returns the value of attribute cluster_name.
13 14 15 |
# File 'lib/elasticsnap/snapshot.rb', line 13 def cluster_name @cluster_name end |
#mount ⇒ Object
Returns the value of attribute mount.
10 11 12 |
# File 'lib/elasticsnap/snapshot.rb', line 10 def mount @mount end |
#quorum_nodes ⇒ Object
Returns the value of attribute quorum_nodes.
11 12 13 |
# File 'lib/elasticsnap/snapshot.rb', line 11 def quorum_nodes @quorum_nodes end |
#security_group ⇒ Object
Returns the value of attribute security_group.
8 9 10 |
# File 'lib/elasticsnap/snapshot.rb', line 8 def security_group @security_group end |
#ssh_user ⇒ Object
Returns the value of attribute ssh_user.
14 15 16 |
# File 'lib/elasticsnap/snapshot.rb', line 14 def ssh_user @ssh_user end |
#url ⇒ Object
Returns the value of attribute url.
9 10 11 |
# File 'lib/elasticsnap/snapshot.rb', line 9 def url @url end |
#wait_timeout ⇒ Object
Returns the value of attribute wait_timeout.
12 13 14 |
# File 'lib/elasticsnap/snapshot.rb', line 12 def wait_timeout @wait_timeout end |
Instance Method Details
#call ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/elasticsnap/snapshot.rb', line 31 def call verify_es_cluster_status! freeze_es do freeze_fs do ebs_snapshot! end end end |
#ebs_snapshot! ⇒ Object
52 53 54 |
# File 'lib/elasticsnap/snapshot.rb', line 52 def ebs_snapshot! EbsSnapshot.new(security_group: security_group, cluster_name: cluster_name).snapshot end |
#freeze_es(&block) ⇒ Object
44 45 46 |
# File 'lib/elasticsnap/snapshot.rb', line 44 def freeze_es(&block) FreezeElasticsearch.new(url: url).freeze(&block) end |
#freeze_fs(&block) ⇒ Object
48 49 50 |
# File 'lib/elasticsnap/snapshot.rb', line 48 def freeze_fs(&block) FreezeFs.new(mount: mount, security_group: security_group, ssh_user: ssh_user).freeze(&block) end |
#verify_es_cluster_status! ⇒ Object
40 41 42 |
# File 'lib/elasticsnap/snapshot.rb', line 40 def verify_es_cluster_status! VerifyEsClusterStatus.new(url: url, quorum_nodes: quorum_nodes, wait_timeout: wait_timeout).verify! end |