class Elasticsnap::Snapshot

Attributes

cluster_name[RW]
mount[RW]
quorum_nodes[RW]
security_group[RW]
ssh_user[RW]
url[RW]
wait_timeout[RW]

Public Class Methods

new(security_group: nil, url: nil, mount: nil, quorum_nodes: nil, wait_timeout: 30, cluster_name: nil, ssh_user: nil) click to toggle source
# 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

Public Instance Methods

call() click to toggle source
# 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!() click to toggle source
# 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) click to toggle source
# File lib/elasticsnap/snapshot.rb, line 44
def freeze_es(&block)
  FreezeElasticsearch.new(url: url).freeze(&block)
end
freeze_fs(&block) click to toggle source
# 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!() click to toggle source
# 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