enfcli 3.9.4.pre.beta → 3.9.5.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36cbebb43449be2cc644fc40b268c530b10512d2f87ea10d835d9b19cd4c93af
4
- data.tar.gz: 6e598259a041d7468bb7ce9451a6a270be6cdca1a4298970b068cd8547dc1378
3
+ metadata.gz: 85e9a5ecc5abe6b44bb23e914ff2b9e5efb53b072034ee19946988de53ddc50b
4
+ data.tar.gz: cedd488ea699962388562e113c67efc85bd02c897e1c6ce003c2026476492c96
5
5
  SHA512:
6
- metadata.gz: 3dd83a6746ddab4e57688d0f5863b3d9d0e1bed8e58dd6a77ed047769116cab65d1e0485ba0c1f0bbf21533d83ff1faef5d5f7d7acb06bba19f43ccebb3640ac
7
- data.tar.gz: e62a8f6f5fe6d5fbab5a286b1c28fdde47325f328e851dc3e6529b3df7be2ed7c21e327b789a3d791c4ab0bea417c68b39bb2c2d92efd34df846581032c6d7be
6
+ metadata.gz: 8c8c2aeae84d7eeac54bddb320e80c816d74e27ef998403e3fff8ca6156dd9ddc8465815cf1e7b4584dfc3b85423d62c7f877dd517cf61b38cfb5c46e237267b
7
+ data.tar.gz: 149ee78c1a031bcc13949e0edcfbe9e10fa2fabb94feb1c01efe17250b3232b90d054dfd5ca5578b590147a537106a0e43d4b4cd7ac11b3b406f48f351344bd5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enfcli (3.9.4.pre.beta)
4
+ enfcli (3.9.5.pre.beta)
5
5
  rest-client (~> 2.0)
6
6
  terminal-table
7
7
  thor (~> 0.20.0)
@@ -24,9 +24,9 @@ GEM
24
24
  http-accept (1.7.0)
25
25
  http-cookie (1.0.3)
26
26
  domain_name (~> 0.5)
27
- mime-types (3.3)
27
+ mime-types (3.2.2)
28
28
  mime-types-data (~> 3.2015)
29
- mime-types-data (3.2019.0904)
29
+ mime-types-data (3.2019.0331)
30
30
  netrc (0.11.0)
31
31
  public_suffix (3.0.3)
32
32
  rake (10.5.0)
@@ -17,9 +17,9 @@ require 'enfthor'
17
17
  require 'enfapi'
18
18
 
19
19
  module EnfCli
20
-
20
+
21
21
  module Cmd
22
-
22
+
23
23
  class Xcr < EnfThor
24
24
  no_commands {
25
25
  def display_endpoints eps
@@ -34,7 +34,7 @@ module EnfCli
34
34
  }
35
35
  render_table(headings, rows, options.file)
36
36
  end
37
-
37
+
38
38
  def display_endpoint_events events
39
39
  headings = ['Time', 'IPV6', 'Source', 'Event', 'Network', 'Remote IP']
40
40
  rows = events.map{ |hash|
@@ -42,7 +42,7 @@ module EnfCli
42
42
  }
43
43
  render_table(headings, rows)
44
44
  end
45
-
45
+
46
46
  def display_domains domains
47
47
  headings = ['Name', 'Network', 'Status']
48
48
  rows = domains.map{ |hash|
@@ -94,7 +94,7 @@ module EnfCli
94
94
  def list_networks
95
95
  try_with_rescue_in_session do
96
96
  domain_id = EnfCli::CTX.instance.session[:domain_id]
97
-
97
+
98
98
  # Call the api
99
99
  data = EnfApi::API.instance.list_domain_nws domain_id
100
100
  networks = data[:data]
@@ -117,7 +117,7 @@ module EnfCli
117
117
  description = ""
118
118
  network_name = options.name.join(" ").gsub(/\A"+(.*?)"+\Z/m, '\1')
119
119
  description = options.description.join(" ").gsub(/\A"+(.*?)"+\Z/m, '\1') if options.description
120
-
120
+
121
121
  # Call the api
122
122
  hash = {
123
123
  :name => network_name,
@@ -131,7 +131,7 @@ module EnfCli
131
131
  say "Provisioned a network!", :green
132
132
  display_networks networks
133
133
  end
134
- end
134
+ end
135
135
 
136
136
  desc "list-enf-networks", "List enf /34 networks"
137
137
  def list_enf_networks
@@ -154,11 +154,11 @@ module EnfCli
154
154
  def list_domains
155
155
  try_with_rescue_in_session do
156
156
  session = EnfCli::CTX.instance.session
157
-
157
+
158
158
  # call api
159
159
  data = {:data => []}
160
160
  case session[:type]
161
- when 'XAPTUM_ADMIN'
161
+ when 'XAPTUM_ADMIN'
162
162
  data = EnfApi::API.instance.list_domains
163
163
 
164
164
  when 'DOMAIN_ADMIN'
@@ -170,13 +170,13 @@ module EnfCli
170
170
  display_domains domains
171
171
  end
172
172
  end
173
-
173
+
174
174
  desc "provision-domain", "Provision a new customer /48 network domain"
175
175
  method_option :name, :type => :string, :required => true
176
176
  method_option :'admin-name', :type => :array, :required => true, :banner => "ADMIN_NAME"
177
177
  method_option :'admin-email', :type => :string, :required => true, :banner => "EMAIL"
178
178
  def provision_domain
179
- try_with_rescue_in_session do
179
+ try_with_rescue_in_session do
180
180
  # Get cli params
181
181
  domain_name = options[:name]
182
182
  admin_name = options[:'admin-name'].join(" ").gsub(/\A"+(.*?)"+\Z/m, '\1')
@@ -187,7 +187,7 @@ module EnfCli
187
187
  :admin_name => admin_name,
188
188
  :admin_email => admin_email,
189
189
  :name => domain_name,
190
- :type => 'CUSTOMER_SOURCE'
190
+ :type => 'CUSTOMER_SOURCE'
191
191
  }
192
192
  data = EnfApi::API.instance.create_domain hash
193
193
 
@@ -204,10 +204,15 @@ module EnfCli
204
204
  try_with_rescue_in_session do
205
205
  # Call the api
206
206
  data = EnfApi::API.instance.get_domain_rate_limits options[:network], options[:filter]
207
-
207
+
208
208
  # Get the limits
209
209
  limits = data[:data][0]
210
210
 
211
+ # if the Api returns only the rate limits object, have to add type explicitly to display
212
+ limits = {
213
+ options[:filter].to_sym => limits
214
+ } if options[:filter]
215
+
211
216
  # Display limits
212
217
  display_limits limits
213
218
  end
@@ -220,10 +225,15 @@ module EnfCli
220
225
  try_with_rescue_in_session do
221
226
  # Call the api
222
227
  data = EnfApi::API.instance.get_network_rate_limits options[:network], options[:filter]
223
-
228
+
224
229
  # Get the limits
225
230
  limits = data[:data][0]
226
231
 
232
+ # if the Api returns only the rate limits object, have to add type explicitly to display
233
+ limits = {
234
+ options[:filter].to_sym => limits
235
+ } if options[:filter]
236
+
227
237
  # Display limits
228
238
  display_limits limits
229
239
  end
@@ -236,14 +246,20 @@ module EnfCli
236
246
  try_with_rescue_in_session do
237
247
  # Call the api
238
248
  data = EnfApi::API.instance.get_ep_rate_limits options[:ipv6], options[:filter]
239
-
249
+
240
250
  # Get the limits
241
251
  limits = data[:data][0]
242
252
 
253
+ # if the Api returns only the rate limits object, have to add type explicitly to display
254
+ limits = {
255
+ options[:filter].to_sym => limits
256
+ } if options[:filter]
257
+
258
+
243
259
  # Display limits
244
260
  display_limits limits
245
261
  end
246
- end
262
+ end
247
263
 
248
264
  desc "activate-domain", "Activate a customer's /48 domain"
249
265
  method_option :network, :type => :string, :required => true
@@ -252,11 +268,11 @@ module EnfCli
252
268
  # Call api
253
269
  data = EnfApi::API.instance.activate_domain options[:network]
254
270
  domains = data[:data]
255
-
271
+
256
272
  # Display the data
257
273
  say "Activated Domain!", :green
258
274
  display_domains domains
259
- end
275
+ end
260
276
  end
261
277
 
262
278
  desc "deactivate-domain", "Deactivate a customer's /48 domain"
@@ -266,13 +282,13 @@ module EnfCli
266
282
  # Call api
267
283
  data = EnfApi::API.instance.deactivate_domain options[:network]
268
284
  domains = data[:data]
269
-
285
+
270
286
  # Display the data
271
287
  say "Deactivated Domain!", :yellow
272
288
  display_domains domains
273
- end
274
- end
275
-
289
+ end
290
+ end
291
+
276
292
  desc "set-domain-rate-limits", "Update a customer /48 domain's endpoint rate limits"
277
293
  method_option :network, :type => :string, :required => true
278
294
  method_option :limit, :type => :string, :enum => ['default', 'max'], :required => true
@@ -299,7 +315,7 @@ module EnfCli
299
315
  display_limits limits_hash
300
316
  end
301
317
  end
302
-
318
+
303
319
  desc "set-network-rate-limits", "Update a customer /64 network's endpoint rate limits"
304
320
  method_option :network, :type => :string, :required => true
305
321
  method_option :limit, :type => :string, :enum => ['default', 'max'], :required => true
@@ -314,7 +330,7 @@ module EnfCli
314
330
  :packets_per_second => options['packets-per-second'],
315
331
  :packets_burst_size => options['packets-burst-size'],
316
332
  :bytes_per_second => options['bytes-per-second'],
317
- :bytes_burst_size => options['bytes-burst-size']
333
+ :bytes_burst_size => options['bytes-burst-size']
318
334
  }
319
335
  data = EnfApi::API.instance.update_network_rate_limits options[:network], options[:limit], hash
320
336
  limits = data[:data][0]
@@ -326,7 +342,7 @@ module EnfCli
326
342
  display_limits limits_hash
327
343
  end
328
344
  end
329
-
345
+
330
346
  desc "reset-network-rate-limits", "Reset customer /64 network's endpoint rate limits to domains rate limits"
331
347
  method_option :network, :type => :string, :required => true
332
348
  method_option :limit, :type => :string, :enum => ['default', 'max'], :required => true
@@ -346,7 +362,7 @@ module EnfCli
346
362
  display_limits limits_hash
347
363
  end
348
364
  end
349
-
365
+
350
366
  desc "set-endpoint-rate-limits", "Update an ipv6 endpoint rate limits"
351
367
  method_option :ipv6, :type => :string, :required => true
352
368
  method_option :limit, :type => :string, :enum => ['current', 'max'], :required => true
@@ -361,7 +377,7 @@ module EnfCli
361
377
  :packets_per_second => options['packets-per-second'],
362
378
  :packets_burst_size => options['packets-burst-size'],
363
379
  :bytes_per_second => options['bytes-per-second'],
364
- :bytes_burst_size => options['bytes-burst-size']
380
+ :bytes_burst_size => options['bytes-burst-size']
365
381
  }
366
382
  data = EnfApi::API.instance.update_ep_rate_limits options[:ipv6], options[:limit], hash
367
383
  limits = data[:data][0]
@@ -373,7 +389,7 @@ module EnfCli
373
389
  display_limits limits_hash
374
390
  end
375
391
  end
376
-
392
+
377
393
  desc "reset-endpoint-rate-limits", "Reset an ipv6 endpoint rate limits to network's rate limits"
378
394
  method_option :ipv6, :type => :string, :required => true
379
395
  method_option :limit, :type => :string, :enum => ['current', 'max'], :required => true
@@ -393,10 +409,10 @@ module EnfCli
393
409
  display_limits limits_hash
394
410
  end
395
411
  end
396
-
412
+
397
413
  desc "list-endpoints", "List all connections in a network"
398
414
  method_option :network, :type => :string, :required => true
399
- method_option :file, :type => :string, :aliases => "-f"
415
+ method_option :file, :type => :string, :aliases => "-f"
400
416
  def list_endpoints
401
417
  try_with_rescue_in_session do
402
418
  # verify domain context is set
@@ -422,7 +438,7 @@ module EnfCli
422
438
 
423
439
  # display data
424
440
  display_endpoint_events events
425
-
441
+
426
442
  end
427
443
  end
428
444
 
@@ -477,7 +493,7 @@ module EnfCli
477
493
  say "Activated Enf Network #{options.network}!", :green
478
494
  end
479
495
  end
480
-
496
+
481
497
  end # class
482
498
  end # module Cmd
483
499
  end # module EnfCli
@@ -14,5 +14,5 @@
14
14
  # limitations under the License.
15
15
  #
16
16
  module EnfCli
17
- VERSION = '3.9.4-beta'
17
+ VERSION = '3.9.5-beta'
18
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enfcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.4.pre.beta
4
+ version: 3.9.5.pre.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Venkatakumar Srinivasan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-19 00:00:00.000000000 Z
11
+ date: 2019-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor