bim 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bim/action/sync.rb +2 -2
- data/lib/bim/subcommands/sync.rb +4 -3
- data/lib/bim/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9b6eb68a2daa7c9ffa120de5a389c1e9480e6aa
|
4
|
+
data.tar.gz: 22454703346d548e13a79edf42879e9e88717cd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 216f1883eb5acca0cb09b4eaee5dfc151c7639269a31c377dfa53a0103640fddd9265601b5e0fa3930e6d44799a4dcae3a234a54ee636b323e21521d3e322514
|
7
|
+
data.tar.gz: 40e1db06639a8033585b2205ddc0ca5bb32272ccbd3bc946af0bad814915e88db2bdf1b716ef403853ba3ab90b3e1550d7083dff3d6bda33525b804b8e375a9f
|
data/lib/bim/action/sync.rb
CHANGED
@@ -9,11 +9,11 @@ module Bim
|
|
9
9
|
FAILOVER_STATE_PATH = '/mgmt/tm/cm/failoverStatus'.freeze
|
10
10
|
|
11
11
|
class << self
|
12
|
-
def sync!(dest)
|
12
|
+
def sync!(dest, overwrite: false)
|
13
13
|
msg = "you want to sync #{BIGIP_HOST} configuration to #{dest}? [y|n]"
|
14
14
|
return { 'message' => "cancel sync #{BIGIP_HOST} to #{dest}" } unless yes_or_no?(msg)
|
15
15
|
uri = URI.join(Bim::BASE_URL, Bim::Action::Sync::SYNC_PATH)
|
16
|
-
j = { "command": 'run', "utilCmdArgs": "config-sync to-group #{dest}" }
|
16
|
+
j = { "command": 'run', "utilCmdArgs": "config-sync #{'force-full-load-push ' if overwrite}to-group #{dest}" }
|
17
17
|
req = request(uri, Bim::AUTH, 'application/json', 'POST', j.to_json)
|
18
18
|
http(uri).request(req).body
|
19
19
|
end
|
data/lib/bim/subcommands/sync.rb
CHANGED
@@ -5,11 +5,12 @@ module Bim
|
|
5
5
|
default_command :to_group
|
6
6
|
|
7
7
|
desc(
|
8
|
-
'[GROUP_NAME]',
|
9
|
-
'sync device configuration to group.'
|
8
|
+
'[GROUP_NAME] [--overwrite]',
|
9
|
+
'sync device configuration to group. if set overwrite option, sync force-full-load-push mode.'
|
10
10
|
)
|
11
|
+
option :overwrite, :type => :boolean
|
11
12
|
def to_group(group)
|
12
|
-
puts Bim::Action::Sync.sync!(group)
|
13
|
+
puts Bim::Action::Sync.sync!(group, overwrite: options.key?(:overwrite))
|
13
14
|
end
|
14
15
|
|
15
16
|
desc(
|
data/lib/bim/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- littlekbt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|