Class: SwarmClusterCliOpe::SyncConfigs::MongoDb

Inherits:
BaseDatabase
  • Object
show all
Defined in:
lib/swarm_cluster_cli_ope/sync_configs/mongo_db.rb

Defined Under Namespace

Classes: EnvConfigs

Instance Attribute Summary

Attributes inherited from Base

#configs, #service

Instance Method Summary collapse

Methods inherited from BaseDatabase

#local, #remote, #resume

Methods inherited from Base

#initialize

Methods included from LoggerConcern

#logger

Constructor Details

This class inherits a constructor from SwarmClusterCliOpe::SyncConfigs::Base

Instance Method Details

#pullTrueClass, FalseClass

Returns:

  • (TrueClass, FalseClass)


6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/swarm_cluster_cli_ope/sync_configs/mongo_db.rb', line 6

def pull
  resume('pull')
  if yes?("Confermare il comando?[y,yes]")

    tmp_file = make_dump(remote, container)

    local_container.copy_in(tmp_file, tmp_file)

    restore(tmp_file, remote, local, local_container)
  end
  true
end

#pushTrueClass, FalseClass

Returns:

  • (TrueClass, FalseClass)


20
21
22
23
24
25
26
27
28
# File 'lib/swarm_cluster_cli_ope/sync_configs/mongo_db.rb', line 20

def push
  resume('PUSH')
  if yes?("ATTENZIONE !!!!!!PUSH!!!!! - Confermare il comando?[y,yes]")
    tmp_file = make_dump(local, local_container)
    container.copy_in(tmp_file, tmp_file)
    restore(tmp_file, local, remote, container)
  end
  true
end