rbeapi 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/CHANGELOG.md +4 -0
  2. data/Gemfile +1 -1
  3. data/README.md +17 -12
  4. data/guide/.gitignore +2 -0
  5. data/guide/api.rst +5894 -0
  6. data/guide/conf.py +5 -5
  7. data/guide/contributing.rst +6 -0
  8. data/guide/getting-started.rst +134 -0
  9. data/guide/index.rst +3 -5
  10. data/guide/installation.rst +56 -1
  11. data/guide/license.rst +13 -2
  12. data/guide/overview.rst +2 -5
  13. data/guide/testing.rst +5 -1
  14. data/guide/upgrading.rst +10 -0
  15. data/lib/rbeapi/api.rb +37 -36
  16. data/lib/rbeapi/api/aaa.rb +90 -90
  17. data/lib/rbeapi/api/acl.rb +70 -53
  18. data/lib/rbeapi/api/bgp.rb +186 -163
  19. data/lib/rbeapi/api/dns.rb +51 -45
  20. data/lib/rbeapi/api/interfaces.rb +344 -328
  21. data/lib/rbeapi/api/ipinterfaces.rb +92 -92
  22. data/lib/rbeapi/api/logging.rb +32 -32
  23. data/lib/rbeapi/api/mlag.rb +97 -97
  24. data/lib/rbeapi/api/ntp.rb +39 -39
  25. data/lib/rbeapi/api/ospf.rb +58 -58
  26. data/lib/rbeapi/api/prefixlists.rb +22 -22
  27. data/lib/rbeapi/api/radius.rb +77 -49
  28. data/lib/rbeapi/api/routemaps.rb +110 -64
  29. data/lib/rbeapi/api/snmp.rb +104 -100
  30. data/lib/rbeapi/api/staticroutes.rb +27 -20
  31. data/lib/rbeapi/api/stp.rb +100 -84
  32. data/lib/rbeapi/api/switchports.rb +98 -77
  33. data/lib/rbeapi/api/system.rb +93 -25
  34. data/lib/rbeapi/api/tacacs.rb +54 -35
  35. data/lib/rbeapi/api/users.rb +68 -68
  36. data/lib/rbeapi/api/varp.rb +56 -47
  37. data/lib/rbeapi/api/vlans.rb +86 -86
  38. data/lib/rbeapi/api/vrrp.rb +210 -173
  39. data/lib/rbeapi/client.rb +142 -108
  40. data/lib/rbeapi/eapilib.rb +73 -62
  41. data/lib/rbeapi/utils.rb +8 -8
  42. data/lib/rbeapi/version.rb +2 -2
  43. data/spec/fixtures/test.conf +3 -3
  44. data/spec/system/rbeapi/api/system_spec.rb +46 -2
  45. data/spec/system/rbeapi/api/vlans_spec.rb +5 -2
  46. data/spec/system/rbeapi/client_spec.rb +4 -4
  47. data/spec/unit/rbeapi/api/system/default_spec.rb +40 -4
  48. data/spec/unit/rbeapi/api/system/fixture_system.text +14 -0
  49. data/spec/unit/rbeapi/api/vlans/default_spec.rb +1 -1
  50. data/spec/unit/rbeapi/api/vlans/fixture_vlans.text +2 -0
  51. data/spec/unit/rbeapi/client_spec.rb +1 -0
  52. metadata +9 -9
  53. data/guide/cookbook.rst +0 -4
  54. data/guide/developing.rst +0 -4
  55. data/guide/faq.rst +0 -4
  56. data/guide/quickstart.rst +0 -4
  57. data/guide/troubleshooting.rst +0 -1
@@ -32,17 +32,17 @@
32
32
  require 'rbeapi/api'
33
33
 
34
34
  ##
35
- # Rbeapi toplevel namespace
35
+ # Rbeapi toplevel namespace.
36
36
  module Rbeapi
37
37
  ##
38
- # Api is module namespace for working with the EOS command API
38
+ # Api is module namespace for working with the EOS command API.
39
39
  module Api
40
40
  ##
41
41
  # The Aaa class manages Authorization, Authentication and Accounting (AAA)
42
42
  # on an EOS node.
43
43
  class Aaa < Entity
44
44
  ##
45
- # get returns a hash of all Aaa resources
45
+ # get returns a hash of all Aaa resources.
46
46
  #
47
47
  # @example
48
48
  # {
@@ -105,12 +105,12 @@ module Rbeapi
105
105
  # servers: <array>
106
106
  # }
107
107
  #
108
- # @param [String] :name The server group name to return from the nodes
109
- # current running configuration. If the name is not configured a nil
108
+ # @param name [String] The server group name to return from the nodes
109
+ # current running configuration. If the name is not configured a nil
110
110
  # object is returned.
111
111
  #
112
- # @return [nil, Hash<Symbol, Object>] returns the resource hash for the
113
- # specified name. If the name does not exist, a nil object is returned
112
+ # @return [nil, Hash<Symbol, Object>] Returns the resource hash for the
113
+ # specified name. If the name does not exist, a nil object is returned.
114
114
  def get(name)
115
115
  block = get_block("aaa group server ([^\s]+) #{name}")
116
116
  return nil unless block
@@ -121,22 +121,22 @@ module Rbeapi
121
121
  end
122
122
 
123
123
  ##
124
- # getall returns a aaa server groups hash
124
+ # getall returns a aaa server groups hash.
125
125
  #
126
126
  # @example
127
- # {
128
- # <name>: {
129
- # type: <string>,
130
- # servers: <array>
131
- # },
132
- # <name>: {
133
- # type: <string>,
134
- # servers: <array>
127
+ # {
128
+ # <name>: {
129
+ # type: <string>,
130
+ # servers: <array>
131
+ # },
132
+ # <name>: {
133
+ # type: <string>,
134
+ # servers: <array>
135
+ # }
135
136
  # }
136
- # }
137
137
  #
138
- # @return [Hash<Symbol, Object>] returns the resource hashes for
139
- # configured aaa groups. If none exist, a nil object is returned
138
+ # @return [Hash<Symbol, Object>] Returns the resource hashes for
139
+ # configured aaa groups. If none exist, a nil object is returned.
140
140
  def getall
141
141
  cfg = config.scan(/aaa group server (?:radius|tacacs\+) (.+)$/)
142
142
  cfg.each_with_object({}) do |name, hsh|
@@ -147,15 +147,15 @@ module Rbeapi
147
147
 
148
148
  ##
149
149
  # parse_type scans the specified configuration block and returns the
150
- # server group type as either 'tacacs' or 'radius'. The type value is
150
+ # server group type as either 'tacacs' or 'radius'. The type value is
151
151
  # expected to always be present in the config.
152
152
  #
153
153
  # @api private
154
154
  #
155
- # @param [String] :config The aaa server group block configuration for the
156
- # group name to parse
155
+ # @param config [String] The aaa server group block configuration for the
156
+ # group name to parse.
157
157
  #
158
- # @return [Hash<Symbol, Object>] resource hash attribute
158
+ # @return [Hash<Symbol, Object>] Resource hash attribute.
159
159
  def parse_type(config)
160
160
  value = config.scan(/aaa group server ([^\s]+)/).first
161
161
  { type: value.first }
@@ -164,7 +164,7 @@ module Rbeapi
164
164
 
165
165
  ##
166
166
  # parse_servers scans the specified configuraiton block and returns the
167
- # list of servers configured for the group. If there are no servers
167
+ # list of servers configured for the group. If there are no servers
168
168
  # configured for the group the servers value will return an empty array.
169
169
  #
170
170
  # @api private
@@ -172,13 +172,13 @@ module Rbeapi
172
172
  # @see parse_radius_server
173
173
  # @see parse_tacacs_server
174
174
  #
175
- # @param [String] :config The aaa server group block configuration for the
176
- # group name to parse
175
+ # @param config [String] The aaa server group block configuration for the
176
+ # group name to parse.
177
177
  #
178
- # @param [String] :type The aaa server block type. Valid values are
178
+ # @param type [String] The aaa server block type. Valid values are
179
179
  # either radius or tacacs+.
180
180
  #
181
- # @return [Hash<Symbol, Object>] resource hash attribute
181
+ # @return [Hash<Symbol, Object>] Resource hash attribute
182
182
  def parse_servers(config, type)
183
183
  case type
184
184
  when 'radius' then parse_radius_server(config)
@@ -189,13 +189,13 @@ module Rbeapi
189
189
 
190
190
  ##
191
191
  # parse_radius_server scans the provide configuration block and returns
192
- # the list of servers configured. The configuration block is expected to
193
- # be a radius configuration block. If there are no servers configured
192
+ # the list of servers configured. The configuration block is expected to
193
+ # be a radius configuration block. If there are no servers configured
194
194
  # for the group the servers value will return an empty array.
195
195
  #
196
196
  # @api private
197
197
  #
198
- # @param [String] :config The aaa server group block configuration for the
198
+ # @param config [String] The aaa server group block configuration for the
199
199
  # group name to parse
200
200
  #
201
201
  # @return [Hash<Symbol, Object>] resource hash attribute
@@ -213,16 +213,16 @@ module Rbeapi
213
213
 
214
214
  ##
215
215
  # parse_tacacs_server scans the provided configuration block and returns
216
- # the list of configured servers. The configuration block is expected to
217
- # be a tacacs configuration block. If there are no servers configured
216
+ # the list of configured servers. The configuration block is expected to
217
+ # be a tacacs configuration block. If there are no servers configured
218
218
  # for the group the servers value will return an empty array.
219
219
  #
220
220
  # @api private
221
221
  #
222
- # @param [String] :config The aaa server group block configuration for the
223
- # group name to parse
222
+ # @param config [String] The aaa server group block configuration for the
223
+ # group name to parse.
224
224
  #
225
- # @return [Hash<Symbol, Object>] resource hash attribute
225
+ # @return [Hash<Symbol, Object>] Resource hash attribute.
226
226
  def parse_tacacs_server(config)
227
227
  values = config.scan(TACACS_GROUP_SERVER).map do |(name, vrf, port)|
228
228
  {
@@ -237,17 +237,17 @@ module Rbeapi
237
237
 
238
238
  ##
239
239
  # find_type is a utility method to find the type of aaa server group for
240
- # the specified name. This method will scan the current running
240
+ # the specified name. This method will scan the current running
241
241
  # configuration on the node and return the server group type as either
242
- # 'radius' or 'tacacs+'. If the server group is not configured, then nil
242
+ # 'radius' or 'tacacs+'. If the server group is not configured, then nil
243
243
  # will be returned.
244
244
  #
245
245
  # @api private
246
246
  #
247
- # @param [String] :name The aaa server group name to find in the config
248
- # and return the type value for
247
+ # @param name [String] The aaa server group name to find in the config
248
+ # and return the type value for.
249
249
  #
250
- # @return [nil, String] returns either the type name as 'radius' or
250
+ # @return [nil, String] Returns either the type name as 'radius' or
251
251
  # 'tacacs+' or nil if the server group is not configured.
252
252
  def find_type(name)
253
253
  mdata = /aaa group server ([^\s]+) #{name}/.match(config)
@@ -258,19 +258,19 @@ module Rbeapi
258
258
  ##
259
259
  # create adds a new aaa group server to the nodes current configuration.
260
260
  # If the specified name and type are already created then this method
261
- # will return successfully. If the name is configured but the type is
261
+ # will return successfully. If the name is configured but the type is
262
262
  # different, this method will not return successfully (returns false).
263
263
  #
264
- # @eos_version 4.13.7M
264
+ # @since eos_version 4.13.7M
265
265
  #
266
- # @commands
266
+ # ===Commands
267
267
  # aaa group server <type> <name>
268
268
  #
269
- # @param [String] :name The name of the aaa group server to create in the
269
+ # @param name [String] The name of the aaa group server to create in the
270
270
  # nodes running configuration
271
271
  #
272
- # @param [String] :type The type of aaa group server to create in the
273
- # nodes running configuration. Valid values include 'radius' or
272
+ # @param type [String] The type of aaa group server to create in the
273
+ # nodes running configuration. Valid values include 'radius' or
274
274
  # 'tacacs+'
275
275
  #
276
276
  # @return [Boolean] returns true if the commands complete successfully
@@ -280,19 +280,19 @@ module Rbeapi
280
280
 
281
281
  ##
282
282
  # delete removes a current aaa server group from the nodes current
283
- # configuration. This method will automatically determine the server
284
- # group type based on the name. If the name is not configured in the
283
+ # configuration. This method will automatically determine the server
284
+ # group type based on the name. If the name is not configured in the
285
285
  # nodes current configuration, this method will return successfully.
286
286
  #
287
- # @eos_version 4.13.7M
287
+ # @since eos_version 4.13.7M
288
288
  #
289
- # @commands
289
+ # ===Commands
290
290
  # no aaa group server [radius | tacacs+] <name>
291
291
  #
292
- # @param [String] :name The name of the aaa group server to create in the
293
- # nodes running configuration
292
+ # @param name [String] The name of the aaa group server to create in the
293
+ # nodes running configuration.
294
294
  #
295
- # @return [Boolean] returns true if the commands complete successfully
295
+ # @return [Boolean] Returns true if the commands complete successfully.
296
296
  def delete(name)
297
297
  type = find_type(name)
298
298
  return true unless type
@@ -301,22 +301,20 @@ module Rbeapi
301
301
 
302
302
  ##
303
303
  # set_servers configures the set of servers for a specified aaa server
304
- # group. This is an atomic operation that first removes all current
305
- # servers and then adds the new servers back. If any of the servers
304
+ # group. This is an atomic operation that first removes all current
305
+ # servers and then adds the new servers back. If any of the servers
306
306
  # failes to be removed or added, this method will return unsuccessfully.
307
307
  #
308
308
  # @see remove_server
309
309
  # @see add_server
310
310
  #
311
- # @param [String] :name The name of the aaa group server to add the new
311
+ # @param name [String] The name of the aaa group server to add the new
312
312
  # server configuration to.
313
313
  #
314
- # @param [String] :server The IP address or host name of the server to
314
+ # @param servers [String] The IP address or host name of the server to
315
315
  # add to the configuration
316
316
  #
317
- # @param [Hash] :opts Optional configuration parameters
318
- #
319
- # @return [Boolean] returns true if the commands complete successfully
317
+ # @return [Boolean] Returns true if the commands complete successfully
320
318
  def set_servers(name, servers)
321
319
  current = get(name)
322
320
  current[:servers].each do |srv|
@@ -330,22 +328,22 @@ module Rbeapi
330
328
  end
331
329
 
332
330
  ##
333
- # add_server adds a new server to the specified aaa server group. If
331
+ # add_server adds a new server to the specified aaa server group. If
334
332
  # the server is already configured in the list of servers, this method
335
333
  # will still return successfully.
336
334
  #
337
335
  # @see add_radius_server
338
336
  # @see add_tacacs_server
339
337
  #
340
- # @param [String] :name The name of the aaa group server to add the new
338
+ # @param name [String] The name of the aaa group server to add the new
341
339
  # server configuration to.
342
340
  #
343
- # @param [String] :server The IP address or host name of the server to
344
- # add to the configuration
341
+ # @param server [String] The IP address or host name of the server to
342
+ # add to the configuration.
345
343
  #
346
- # @param [Hash] :opts Optional configuration parameters
344
+ # @param opts [Hash] Optional configuration parameters.
347
345
  #
348
- # @return [Boolean] returns true if the commands complete successfully
346
+ # @return [Boolean] Returns true if the commands complete successfully.
349
347
  def add_server(name, server, opts = {})
350
348
  type = find_type(name)
351
349
  return false unless type
@@ -359,24 +357,24 @@ module Rbeapi
359
357
  ##
360
358
  # add_radius_server adds a new radius server to the nodes current
361
359
  # configuration. If the server already exists in the specified group
362
- # name this method will still return successfully
360
+ # name this method will still return successfully.
363
361
  #
364
- # @eos_version 4.13.7M
362
+ # @since eos_version 4.13.7M
365
363
  #
366
- # @commmands
364
+ # commmands
367
365
  # aaa group server radius <name>
368
366
  # server <server> [acct-port <acct_port>] [auth-port <auth_port>]
369
367
  # [vrf <vrf>]
370
368
  #
371
- # @param [String] :name The name of the aaa group server to add the new
369
+ # @param name [String] The name of the aaa group server to add the new
372
370
  # server configuration to.
373
371
  #
374
- # @param [String] :server The IP address or host name of the server to
375
- # add to the configuration
372
+ # @param server [String] The IP address or host name of the server to
373
+ # add to the configuration.
376
374
  #
377
- # @param [Hash] :opts Optional configuration parameters
375
+ # @param opts [Hash] Optional configuration parameters.
378
376
  #
379
- # @return [Boolean] returns true if the commands complete successfully
377
+ # @return [Boolean] Returns true if the commands complete successfully.
380
378
  def add_radius_server(name, server, opts = {})
381
379
  # order of command options matter here!
382
380
  server = "server #{server} "
@@ -388,25 +386,25 @@ module Rbeapi
388
386
 
389
387
  ##
390
388
  # add_tacacs_server adds a new tacacs server to the nodes current
391
- # configuration. If the server already exists in the specified group
392
- # name this method will still return successfully
389
+ # configuration. If the server already exists in the specified group
390
+ # name this method will still return successfully.
393
391
  #
394
- # @eos_version 4.13.7M
392
+ # @since eos_version 4.13.7M
395
393
  #
396
- # @commmands
394
+ # commmands
397
395
  # aaa group server tacacs+ <name>
398
396
  # server <server> [acct-port <acct_port>] [auth-port <auth_port>]
399
397
  # [vrf <vrf>]
400
398
  #
401
- # @param [String] :name The name of the aaa group server to add the new
399
+ # @param name [String] The name of the aaa group server to add the new
402
400
  # server configuration to.
403
401
  #
404
- # @param [String] :server The IP address or host name of the server to
405
- # add to the configuration
402
+ # @param server [String] The IP address or host name of the server to
403
+ # add to the configuration.
406
404
  #
407
- # @param [Hash] :opts Optional configuration parameters
405
+ # @param opts [Hash] Optional configuration parameters.
408
406
  #
409
- # @return [Boolean] returns true if the commands complete successfully
407
+ # @return [Boolean] Returns true if the commands complete successfully.
410
408
  def add_tacacs_server(name, server, opts = {})
411
409
  # order of command options matter here!
412
410
  server = "server #{server} "
@@ -417,20 +415,22 @@ module Rbeapi
417
415
 
418
416
  ##
419
417
  # remove_server deletes an existing server from the specified aaa server
420
- # group. If the specified server is not configured in the specified
418
+ # group. If the specified server is not configured in the specified
421
419
  # server group, this method will still return true.
422
420
  #
423
- # @eos_version 4.13.7M
421
+ # eos_version 4.13.7M
424
422
  #
425
- # @commands
423
+ # ===Commands
426
424
  # aaa group server [radius | tacacs+] <name>
427
425
  # no server <server>
428
426
  #
429
- # @param [String] :name The name of the aaa group server to remove
427
+ # @param name [String] The name of the aaa group server to remove.
430
428
  #
431
- # @param [String] :server The IP address or host name of the server
429
+ # @param server [String] The IP address or host name of the server.
432
430
  #
433
- # @return [Boolean] returns true if the commands complete successfully
431
+ # @param opts [Hash] Optional configuration parameters.
432
+ #
433
+ # @return [Boolean] returns true if the commands complete successfully.
434
434
  def remove_server(name, server, opts = {})
435
435
  type = find_type(name)
436
436
  return false unless type
@@ -33,10 +33,10 @@ require 'netaddr'
33
33
  require 'rbeapi/api'
34
34
 
35
35
  ##
36
- # Rbeapi toplevel namespace
36
+ # Rbeapi toplevel namespace.
37
37
  module Rbeapi
38
38
  ##
39
- # Api is module namespace for working with the EOS command API
39
+ # Api is module namespace for working with the EOS command API.
40
40
  module Api
41
41
  ##
42
42
  # The Acl class manages the set of standard ACLs.
@@ -75,7 +75,7 @@ module Rbeapi
75
75
  # ...
76
76
  # }
77
77
  #
78
- # @param [String] :name The ACL name.
78
+ # @param name [String] The ACL name.
79
79
  #
80
80
  # @return [nil, Hash<Symbol, Object>] Returns the ACL resource as a
81
81
  # Hash. Returns nil if name does not exist.
@@ -144,11 +144,11 @@ module Rbeapi
144
144
 
145
145
  ##
146
146
  # mask_to_prefixlen converts a subnet mask from dotted decimal to
147
- # bit length
147
+ # bit length.
148
148
  #
149
- # @param [String] :mask The dotted decimal subnet mask to convert
149
+ # @param mask [String] The dotted decimal subnet mask to convert.
150
150
  #
151
- # @return [String] The subnet mask as a valid prefix length
151
+ # @return [String] The subnet mask as a valid prefix length.
152
152
  def mask_to_prefixlen(mask)
153
153
  mask = '255.255.255.255' unless mask
154
154
  NetAddr::CIDR.create('0.0.0.0/' + mask).netmask_ext
@@ -160,9 +160,9 @@ module Rbeapi
160
160
  #
161
161
  # @api private
162
162
  #
163
- # @param [String] :config The switch config.
163
+ # @param config [String] The switch config.
164
164
  #
165
- # @return [Hash<Symbol, Object>] resource hash attribute
165
+ # @return [Hash<Symbol, Object>] Returns the resource hash attribute.
166
166
 
167
167
  def parse_entries(config)
168
168
  entries = {}
@@ -187,38 +187,38 @@ module Rbeapi
187
187
 
188
188
  ##
189
189
  # create will create a new ACL resource in the nodes current
190
- # configuration with the specified name. If the create method
190
+ # configuration with the specified name. If the create method
191
191
  # is called and the ACL already exists, this method will still
192
192
  # return true. The ACL will not have any entries. Use add_entry
193
193
  # to add entries to the ACL.
194
194
  #
195
- # @eos_version 4.13.7M
195
+ # @since eos_version 4.13.7M
196
196
  #
197
- # @commands
197
+ # ===Commands
198
198
  # ip access-list standard <name>
199
199
  #
200
- # @param [String] :name The ACL name to create on the node. Must
200
+ # @param name [String] The ACL name to create on the node. Must
201
201
  # begin with an alphabetic character. Cannot contain spaces or
202
202
  # quotation marks.
203
203
  #
204
- # @return [Boolean] returns true if the command completed successfully
204
+ # @return [Boolean] Returns true if the command completed successfully.
205
205
  def create(name)
206
206
  configure("ip access-list standard #{name}")
207
207
  end
208
208
 
209
209
  ##
210
210
  # delete will delete an existing ACL resource from the nodes current
211
- # running configuration. If the delete method is called and the ACL
211
+ # running configuration. If the delete method is called and the ACL
212
212
  # does not exist, this method will succeed.
213
213
  #
214
- # @eos_version 4.13.7M
214
+ # @since eos_version 4.13.7M
215
215
  #
216
- # @commands
216
+ # ===Commands
217
217
  # no ip access-list standard <name>
218
218
  #
219
- # @param [String] :name The ACL name to delete on the node.
219
+ # @param name [String] The ACL name to delete on the node.
220
220
  #
221
- # @return [Boolean] returns true if the command completed successfully
221
+ # @return [Boolean] Returns true if the command completed successfully.
222
222
  def delete(name)
223
223
  configure("no ip access-list standard #{name}")
224
224
  end
@@ -228,15 +228,15 @@ module Rbeapi
228
228
  # command has the same effect as deleting the ACL from the nodes
229
229
  # running configuration.
230
230
  #
231
- # @eos_version 4.13.7M
231
+ # @since eos_version 4.13.7M
232
232
  #
233
- # @commands
233
+ # ===Commands
234
234
  # default no ip access-list standard <name>
235
235
  #
236
- # @param [String] :name The ACL name to set to the default value
236
+ # @param name [String] The ACL name to set to the default value
237
237
  # on the node.
238
238
  #
239
- # @return [Boolean] returns true if the command complete successfully
239
+ # @return [Boolean] Returns true if the command complete successfully
240
240
  def default(name)
241
241
  configure("default ip access-list standard #{name}")
242
242
  end
@@ -246,17 +246,22 @@ module Rbeapi
246
246
  #
247
247
  # @api private
248
248
  #
249
- # @param [Hash] :opts the options for the entry
250
- # @option :opts [String] :seqno The sequence number of the entry in
249
+ # @param entry [Hash] the options for the entry.
250
+ #
251
+ # @option entry seqno [String] The sequence number of the entry in
251
252
  # the ACL to add. Default is nil, will be assigned.
252
- # @option :opts [String] :action The action triggered by the ACL. Valid
253
- # values are 'permit', 'deny', or 'remark'
254
- # @option :opts [String] :addr The IP address to permit or deny.
255
- # @option :opts [String] :prefixlen The prefixlen for the IP address.
256
- # @option :opts [Boolean] :log Triggers an informational log message
253
+ #
254
+ # @option entry action [String] The action triggered by the ACL. Valid
255
+ # values are 'permit', 'deny', or 'remark'.
256
+ #
257
+ # @option entry addr [String] The IP address to permit or deny.
258
+ #
259
+ # @option entry prefixlen [String] The prefixlen for the IP address.
260
+ #
261
+ # @option entry log [Boolean] Triggers an informational log message
257
262
  # to the console about the matching packet.
258
263
  #
259
- # @return [String] returns commands to create an entry
264
+ # @return [String] Returns commands to create an entry.
260
265
  def build_entry(entry)
261
266
  cmds = "#{entry[:seqno]} " if entry[:seqno]
262
267
  cmds << "#{entry[:action]} #{entry[:srcaddr]}/#{entry[:srcprefixlen]}"
@@ -269,20 +274,26 @@ module Rbeapi
269
274
  # update_entry will update an entry, identified by the seqno
270
275
  # in the ACL specified by name, with the passed in parameters.
271
276
  #
272
- # @eos_version 4.13.7M
277
+ # @since eos_version 4.13.7M
273
278
  #
274
- # @param [String] :name The ACL name to update on the node.
275
- # @param [Hash] :opts the options for the entry
276
- # @option :opts [String] :seqno The sequence number of the entry in
279
+ # @param name [String] The ACL name to update on the node.
280
+ #
281
+ # @param entry [Hash] the options for the entry.
282
+ #
283
+ # @option entry seqno [String] The sequence number of the entry in
277
284
  # the ACL to update.
278
- # @option :opts [String] :action The action triggered by the ACL. Valid
279
- # values are 'permit', 'deny', or 'remark'
280
- # @option :opts [String] :addr The IP address to permit or deny.
281
- # @option :opts [String] :prefixlen The prefixlen for the IP address.
282
- # @option :opts [Boolean] :log Triggers an informational log message
285
+ #
286
+ # @option entry action [String] The action triggered by the ACL. Valid
287
+ # values are 'permit', 'deny', or 'remark'.
288
+ #
289
+ # @option entry addr [String] The IP address to permit or deny.
290
+ #
291
+ # @option entry prefixlen [String] The prefixlen for the IP address.
292
+ #
293
+ # @option entry log [Boolean] Triggers an informational log message
283
294
  # to the console about the matching packet.
284
295
  #
285
- # @return [Boolean] returns true if the command complete successfully
296
+ # @return [Boolean] Returns true if the command complete successfully.
286
297
  def update_entry(name, entry)
287
298
  cmds = ["ip access-list standard #{name}"]
288
299
  cmds << "no #{entry[:seqno]}"
@@ -295,18 +306,23 @@ module Rbeapi
295
306
  # add_entry will add an entry to the specified ACL with the
296
307
  # passed in parameters.
297
308
  #
298
- # @eos_version 4.13.7M
309
+ # @since eos_version 4.13.7M
310
+ #
311
+ # @param name [String] The ACL name to add an entry to on the node.
312
+ #
313
+ # @param entry [Hash] the options for the entry.
299
314
  #
300
- # @param [String] :name The ACL name to add an entry to on the node.
301
- # @param [Hash] :opts the options for the entry
302
- # @option :opts [String] :action The action triggered by the ACL. Valid
303
- # values are 'permit', 'deny', or 'remark'
304
- # @option :opts [String] :addr The IP address to permit or deny.
305
- # @option :opts [String] :prefixlen The prefixlen for the IP address.
306
- # @option :opts [Boolean] :log Triggers an informational log message
315
+ # @option entry action [String] The action triggered by the ACL. Valid
316
+ # values are 'permit', 'deny', or 'remark'.
317
+ #
318
+ # @option entry addr [String] The IP address to permit or deny.
319
+ #
320
+ # @option entry prefixlen [String] The prefixlen for the IP address.
321
+ #
322
+ # @option entry log [Boolean] Triggers an informational log message
307
323
  # to the console about the matching packet.
308
324
  #
309
- # @return [Boolean] returns true if the command complete successfully
325
+ # @return [Boolean] Returns true if the command complete successfully.
310
326
  def add_entry(name, entry)
311
327
  cmds = ["ip access-list standard #{name}"]
312
328
  cmds << build_entry(entry)
@@ -318,13 +334,14 @@ module Rbeapi
318
334
  # remove_entry will remove the entry specified by the seqno for
319
335
  # the ACL specified by name.
320
336
  #
321
- # @eos_version 4.13.7M
337
+ # @since eos_version 4.13.7M
338
+ #
339
+ # @param name [String] The ACL name to update on the node.
322
340
  #
323
- # @param [String] :name The ACL name to update on the node.
324
- # @param [String] :seqno The sequence number of the entry in
341
+ # @param seqno [String] The sequence number of the entry in
325
342
  # the ACL to remove.
326
343
  #
327
- # @return [Boolean] returns true if the command complete successfully
344
+ # @return [Boolean] Returns true if the command complete successfully.
328
345
  def remove_entry(name, seqno)
329
346
  cmds = ["ip access-list standard #{name}", "no #{seqno}", 'exit']
330
347
  configure(cmds)