enfcli 3.10.2.pre.alpha → 3.10.3.pre.alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/enfcli/commands/xiam.rb +20 -7
- data/lib/enfcli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c844fc472faecb61f1ec4f1cf04dd9b198fae57df6e63aaac36b29edf2ebdde
|
|
4
|
+
data.tar.gz: db2d9ce8d78b232366fd213dcef0513c8ebc47c9d4ffc2c6f3eaff65fdbe7574
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1881463071fb9054a7e5bd495b8129c023883855d26f0471a5d3735eceaff8706c4c173716fd9419b9348a6e47cd0bffa7d8a57d814d72d89acfa44813ed3303
|
|
7
|
+
data.tar.gz: 52ba4f03d178d6bb39ab13da2b5639889bb712686ed9d22a89a21ae2d3e34e0a93fe362e5470cd9f142030fe31364d6306e51865b17bd9cf9d076d7a1955ba37
|
data/Gemfile.lock
CHANGED
data/lib/enfcli/commands/xiam.rb
CHANGED
|
@@ -100,11 +100,15 @@ module EnfCli
|
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
def display_groups groups
|
|
103
|
-
headings = ['DAA Group', 'Base Name', 'Provisioned', 'Onboarded', 'Domain' ]
|
|
103
|
+
headings = ['DAA Group', 'Base Name', 'Provisioned', 'Onboarded', 'Default Network', 'Domain' ]
|
|
104
|
+
say groups
|
|
104
105
|
rows = groups.map{ |hash|
|
|
105
|
-
[ Base64.decode64(hash[:gid]).unpack("H*")[0],
|
|
106
|
-
hash[:
|
|
107
|
-
|
|
106
|
+
[ Base64.decode64(hash[:gid]).unpack("H*")[0],
|
|
107
|
+
Base64.decode64(hash[:basename]),
|
|
108
|
+
hash[:provisioned_count],
|
|
109
|
+
hash[:onboarded_count],
|
|
110
|
+
hash[:default_network] ? "#{IPAddr::new_ntoh( Base64.decode64(hash[:default_network][:prefix]) )}/#{hash[:default_network][:prefix_length]}" : '<not set>',
|
|
111
|
+
"#{IPAddr::new_ntoh( Base64.decode64(hash[:domain][:prefix]) )}/#{hash[:domain][:prefix_length]}",
|
|
108
112
|
]
|
|
109
113
|
}
|
|
110
114
|
render_table(headings, rows)
|
|
@@ -296,6 +300,7 @@ module EnfCli
|
|
|
296
300
|
desc "add-group-to-network", "Associate a DAA Group with /64 network"
|
|
297
301
|
method_option :'network', :type => :string, :required => true
|
|
298
302
|
method_option *option_gid
|
|
303
|
+
method_option :'set_as_default', :type => :boolean, default: false, desc: "Set the network as the default for this group"
|
|
299
304
|
def add_group_to_network
|
|
300
305
|
try_with_rescue_in_session do
|
|
301
306
|
network = EnfCli::IPV6Cidr.new options[:network]
|
|
@@ -316,10 +321,18 @@ module EnfCli
|
|
|
316
321
|
# url safe encode gid
|
|
317
322
|
enc_gid = Base64.urlsafe_encode64([gid].pack("H*"))
|
|
318
323
|
|
|
319
|
-
|
|
320
|
-
|
|
324
|
+
if options[:set_as_default]
|
|
325
|
+
modified_group = {
|
|
326
|
+
:gid => Base64.strict_encode64([gid].pack("H*")),
|
|
327
|
+
:default_network => ipv6_network
|
|
328
|
+
}
|
|
321
329
|
|
|
322
|
-
|
|
330
|
+
EnfApi::Iam.instance.update_group enc_gid, modified_group
|
|
331
|
+
say "Associated group #{gid} with #{network} as default network", :green
|
|
332
|
+
else
|
|
333
|
+
EnfApi::Iam.instance.add_group_to_network enc_gid, ipv6_network
|
|
334
|
+
say "Associated group #{gid} with #{network}", :green
|
|
335
|
+
end
|
|
323
336
|
end
|
|
324
337
|
end
|
|
325
338
|
|
data/lib/enfcli/version.rb
CHANGED