rbeapi 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/CHANGELOG.md +20 -0
- data/Gemfile +1 -1
- data/README.md +11 -11
- data/Rakefile +19 -0
- data/guide/Makefile +177 -0
- data/guide/_static/arista_logo_11-trans-w.png +0 -0
- data/guide/_static/arista_logo_jpg-11.jpg +0 -0
- data/guide/_static/favicon.ico +0 -0
- data/guide/conf.py +279 -0
- data/guide/cookbook.rst +4 -0
- data/guide/developing.rst +4 -0
- data/guide/faq.rst +4 -0
- data/guide/index.rst +23 -0
- data/guide/installation.rst +4 -0
- data/guide/license.rst +5 -0
- data/guide/overview.rst +20 -0
- data/guide/quickstart.rst +4 -0
- data/guide/release-notes-0.5.0.rst +60 -0
- data/guide/release-notes.rst +6 -0
- data/guide/testing.rst +4 -0
- data/guide/troubleshooting.rst +1 -0
- data/lib/rbeapi/api/aaa.rb +54 -18
- data/lib/rbeapi/api/acl.rb +60 -2
- data/lib/rbeapi/api/bgp.rb +81 -0
- data/lib/rbeapi/api/dns.rb +48 -2
- data/lib/rbeapi/api/interfaces.rb +97 -32
- data/lib/rbeapi/api/ipinterfaces.rb +13 -2
- data/lib/rbeapi/api/logging.rb +11 -2
- data/lib/rbeapi/api/mlag.rb +20 -10
- data/lib/rbeapi/api/ntp.rb +4 -3
- data/lib/rbeapi/api/ospf.rb +102 -10
- data/lib/rbeapi/api/prefixlists.rb +47 -4
- data/lib/rbeapi/api/radius.rb +9 -9
- data/lib/rbeapi/api/routemaps.rb +7 -5
- data/lib/rbeapi/api/snmp.rb +13 -4
- data/lib/rbeapi/api/staticroutes.rb +1 -1
- data/lib/rbeapi/api/stp.rb +39 -14
- data/lib/rbeapi/api/switchports.rb +126 -2
- data/lib/rbeapi/api/system.rb +24 -3
- data/lib/rbeapi/api/tacacs.rb +9 -10
- data/lib/rbeapi/api/users.rb +12 -3
- data/lib/rbeapi/api/varp.rb +40 -8
- data/lib/rbeapi/api/vlans.rb +15 -5
- data/lib/rbeapi/client.rb +19 -11
- data/lib/rbeapi/eapilib.rb +8 -0
- data/lib/rbeapi/utils.rb +10 -0
- data/lib/rbeapi/version.rb +1 -1
- data/spec/fixtures/eapi.conf.yaml +6 -0
- data/spec/fixtures/empty.conf +0 -0
- data/spec/fixtures/env_path.conf +5 -0
- data/spec/fixtures/test.conf +39 -0
- data/spec/fixtures/wildcard.conf +43 -0
- data/spec/system/rbeapi/api/aaa_groups_spec.rb +122 -0
- data/spec/system/rbeapi/api/aaa_spec.rb +90 -0
- data/spec/system/{api_acl_spec.rb → rbeapi/api/acl_spec.rb} +0 -0
- data/spec/system/rbeapi/api/bgp_neighbors_spec.rb +354 -0
- data/spec/system/rbeapi/api/bgp_spec.rb +275 -0
- data/spec/system/rbeapi/api/dns_spec.rb +17 -1
- data/spec/system/rbeapi/api/interfaces_base_spec.rb +46 -5
- data/spec/system/rbeapi/api/interfaces_ethernet_spec.rb +14 -0
- data/spec/system/rbeapi/api/interfaces_portchannel_spec.rb +68 -0
- data/spec/system/rbeapi/api/interfaces_vxlan_spec.rb +0 -1
- data/spec/system/{api_ospf_interfaces_spec.rb → rbeapi/api/ospf_interfaces_spec.rb} +3 -2
- data/spec/system/{api_ospf_spec.rb → rbeapi/api/ospf_spec.rb} +11 -2
- data/spec/system/rbeapi/api/routemaps_spec.rb +3 -4
- data/spec/system/rbeapi/api/snmp_spec.rb +65 -0
- data/spec/system/rbeapi/api/staticroutes_spec.rb +177 -0
- data/spec/system/rbeapi/api/stp_instances_spec.rb +20 -0
- data/spec/system/rbeapi/api/stp_interfaces_spec.rb +7 -0
- data/spec/system/rbeapi/api/switchports_spec.rb +86 -16
- data/spec/system/rbeapi/api/users_spec.rb +324 -0
- data/spec/system/rbeapi/api/varp_interfaces_spec.rb +34 -0
- data/spec/system/rbeapi/api/vrrp_spec.rb +707 -0
- data/spec/system/rbeapi/client_spec.rb +367 -0
- data/spec/unit/rbeapi/api/aaa/aaa_groups_spec.rb +111 -0
- data/spec/unit/rbeapi/api/aaa/aaa_spec.rb +77 -0
- data/spec/unit/rbeapi/api/aaa/fixture_aaa.text +3 -0
- data/spec/unit/rbeapi/api/switchports/default_spec.rb +249 -0
- data/spec/unit/rbeapi/api/switchports/fixture_switchports.text +284 -0
- data/spec/unit/rbeapi/api/users/default_spec.rb +1 -1
- data/spec/unit/rbeapi/client_spec.rb +211 -0
- metadata +65 -10
data/guide/cookbook.rst
ADDED
data/guide/faq.rst
ADDED
data/guide/index.rst
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
.. Rbeapi documentation master file, created by
|
2
|
+
sphinx-quickstart on Fri Jan 8 11:04:02 2016.
|
3
|
+
You can adapt this file completely to your liking, but it should at least
|
4
|
+
contain the root `toctree` directive.
|
5
|
+
|
6
|
+
Welcome to Rbeapi's documentation!
|
7
|
+
==================================
|
8
|
+
|
9
|
+
Contents:
|
10
|
+
|
11
|
+
.. toctree::
|
12
|
+
:maxdepth: 2
|
13
|
+
|
14
|
+
overview
|
15
|
+
quickstart
|
16
|
+
installation
|
17
|
+
cookbook
|
18
|
+
troubleshooting
|
19
|
+
developing
|
20
|
+
testing
|
21
|
+
faq
|
22
|
+
release-notes
|
23
|
+
license
|
data/guide/license.rst
ADDED
data/guide/overview.rst
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Overview
|
2
|
+
========
|
3
|
+
|
4
|
+
.. contents:: :local:
|
5
|
+
|
6
|
+
Introduction
|
7
|
+
------------
|
8
|
+
|
9
|
+
The Ruby Client for eAPI provides a native Ruby implementation for programming Arista EOS network devices using Ruby. The Ruby client provides the ability to build native applications in Ruby that can communicate with EOS either locally via Unix domain sockets (on-box) or remotely over a HTTP/S transport (off-box). It uses a standard INI-style configuration file to specifiy one or more connection profiles.
|
10
|
+
|
11
|
+
The rbeapi implemenation also provides an API layer for building native Ruby objects that allow for configuration and state extraction of EOS nodes. The API layer provides a consistent implementation for working with EOS configuration resources. The implementation of the API layer is highly extensible and can be used as a foundation for building custom data models.
|
12
|
+
|
13
|
+
The libray is freely provided to the open source community for building robust applications using Arista EOS eAPI. Support is provided as best effort through Github iusses.
|
14
|
+
|
15
|
+
Prerequisites
|
16
|
+
-------------
|
17
|
+
|
18
|
+
* Arista EOS 4.12 or later
|
19
|
+
* Arista eAPI enabled for at least one transport (see official EOS Config Guide at arista.com for details)
|
20
|
+
* Ruby 1.9.3 or later
|
@@ -0,0 +1,60 @@
|
|
1
|
+
Release 0.5.0 - January 2016
|
2
|
+
----------------------------
|
3
|
+
|
4
|
+
.. contents:: :local:
|
5
|
+
|
6
|
+
Enhancements
|
7
|
+
^^^^^^^^^^^^
|
8
|
+
|
9
|
+
* Add lacp_mode option when setting port-channel members. (`89 <https://github.com/arista-eosplus/rbeapi/pull/89>`_) [`devrobo <https://github.com/devrobo>`_]
|
10
|
+
.. comment
|
11
|
+
* Add support for trunk groups. (`88 <https://github.com/arista-eosplus/rbeapi/pull/88>`_) [`devrobo <https://github.com/devrobo>`_]
|
12
|
+
.. comment
|
13
|
+
* Unit tests for switchports (`94 <https://github.com/arista-eosplus/rbeapi/pull/94>`_) [`websitescenes <https://github.com/websitescenes>`_]
|
14
|
+
.. comment
|
15
|
+
* Ensure all parse methods are private. (`93 <https://github.com/arista-eosplus/rbeapi/pull/93>`_) [`websitescenes <https://github.com/websitescenes>`_]
|
16
|
+
.. comment
|
17
|
+
* Add tests for timeout values (`92 <https://github.com/arista-eosplus/rbeapi/pull/92>`_) [`websitescenes <https://github.com/websitescenes>`_]
|
18
|
+
.. comment
|
19
|
+
* Relax check on getall entries (`91 <https://github.com/arista-eosplus/rbeapi/pull/91>`_) [`devrobo <https://github.com/devrobo>`_]
|
20
|
+
.. comment
|
21
|
+
* Update framework tests (`90 <https://github.com/arista-eosplus/rbeapi/pull/90>`_) [`websitescenes <https://github.com/websitescenes>`_]
|
22
|
+
.. comment
|
23
|
+
* Add basic framework tests. (`85 <https://github.com/arista-eosplus/rbeapi/pull/85>`_) [`websitescenes <https://github.com/websitescenes>`_]
|
24
|
+
.. comment
|
25
|
+
* Address code coverage gaps (`84 <https://github.com/arista-eosplus/rbeapi/pull/84>`_) [`websitescenes <https://github.com/websitescenes>`_]
|
26
|
+
.. comment
|
27
|
+
|
28
|
+
Fixed
|
29
|
+
^^^^^
|
30
|
+
|
31
|
+
* Copy configuration entry before modifying with connection specific info. (`101 <https://github.com/arista-eosplus/rbeapi/pull/101>`_)
|
32
|
+
.. comment
|
33
|
+
* Add 'terminal' to configure command to work around AAA issue. (`99 <https://github.com/arista-eosplus/rbeapi/pull/99>`_)
|
34
|
+
.. comment
|
35
|
+
* Set enable password for a connection. (`96 <https://github.com/arista-eosplus/rbeapi/pull/96>`_)
|
36
|
+
.. comment
|
37
|
+
* Catch errors and syslog them when parsing eapi conf file. (`95 <https://github.com/arista-eosplus/rbeapi/pull/95>`_)
|
38
|
+
In the event of an unparsable ``eapi.conf`` file, which could occur due to other tools which used a YAML syntax instead of INI, rbeapi will log a warning via syslog, but continue to attempt a default connection to localhost.
|
39
|
+
.. comment
|
40
|
+
* Ensure that nil is returned when getting nonexistent username. (`83 <https://github.com/arista-eosplus/rbeapi/pull/83>`_)
|
41
|
+
.. comment
|
42
|
+
* Failure when eapi.conf is not formatted correctly (`82 <https://github.com/arista-eosplus/rbeapi/issues/82>`_)
|
43
|
+
In the event of an unparsable ``eapi.conf`` file, which could occur due to other tools which used a YAML syntax instead of INI, rbeapi will log a warning via syslog, but continue to attempt a default connection to localhost.
|
44
|
+
* Enable password setting in the .eapi.conf file not honored (`72 <https://github.com/arista-eosplus/rbeapi/issues/72>`_)
|
45
|
+
``enablepwd`` is now properly used, if defined, in the ``eapi.conf``
|
46
|
+
* API interfaces should accept an lacp_mode to configure for port-channel members (`58 <https://github.com/arista-eosplus/rbeapi/issues/58>`_)
|
47
|
+
``set_members()`` now configures LACP mode when adding members to a port-channel
|
48
|
+
|
49
|
+
Known Caveats
|
50
|
+
^^^^^^^^^^^^^
|
51
|
+
|
52
|
+
* Add support for commands with input (`100 <https://github.com/arista-eosplus/rbeapi/issues/100>`_)
|
53
|
+
.. comment
|
54
|
+
* Wildcard connection config gets clobbered (`86 <https://github.com/arista-eosplus/rbeapi/issues/86>`_)
|
55
|
+
.. comment
|
56
|
+
* Need to validate value keyword in set methods when array (`40 <https://github.com/arista-eosplus/rbeapi/issues/40>`_)
|
57
|
+
.. comment
|
58
|
+
* get_connect should raise an error instead of returning nil if no connection is found (`31 <https://github.com/arista-eosplus/rbeapi/issues/31>`_)
|
59
|
+
.. comment
|
60
|
+
|
data/guide/testing.rst
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.. _troubleshooting:
|
data/lib/rbeapi/api/aaa.rb
CHANGED
@@ -35,18 +35,39 @@ require 'rbeapi/api'
|
|
35
35
|
# Rbeapi toplevel namespace
|
36
36
|
module Rbeapi
|
37
37
|
##
|
38
|
-
#
|
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
|
+
##
|
45
|
+
# get returns a hash of all Aaa resources
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
# {
|
49
|
+
# <groups>: {
|
50
|
+
# <name>: {
|
51
|
+
# type: <string>,
|
52
|
+
# servers: <array>
|
53
|
+
# },
|
54
|
+
# <name>: {
|
55
|
+
# type: <string>,
|
56
|
+
# servers: <array>
|
57
|
+
# }
|
58
|
+
# }
|
59
|
+
# }
|
60
|
+
#
|
61
|
+
# @return [Hash<Symbol, Object>] Returns the Aaa resources as a
|
62
|
+
# Hash. If no Aaa resources are found, an empty hash is returned.
|
44
63
|
def get
|
45
64
|
response = {}
|
46
65
|
response[:groups] = groups.getall
|
47
66
|
response
|
48
67
|
end
|
49
68
|
|
69
|
+
##
|
70
|
+
# Returns an object node for working with AaaGroups class.
|
50
71
|
def groups
|
51
72
|
return @groups if @groups
|
52
73
|
@groups = AaaGroups.new node
|
@@ -55,20 +76,20 @@ module Rbeapi
|
|
55
76
|
end
|
56
77
|
|
57
78
|
##
|
58
|
-
# The AaaGroups class manages the server groups on
|
79
|
+
# The AaaGroups class manages the server groups on an EOS node.
|
59
80
|
class AaaGroups < Entity
|
60
81
|
DEFAULT_RADIUS_AUTH_PORT = 1812
|
61
82
|
DEFAULT_RADIUS_ACCT_PORT = 1813
|
62
83
|
|
63
|
-
# Regular
|
64
|
-
# server radius configuration block
|
84
|
+
# Regular expression that parses the radius servers from the aaa group
|
85
|
+
# server radius configuration block.
|
65
86
|
RADIUS_GROUP_SERVER = /\s{3}server
|
66
87
|
[ ]([^\s]+)
|
67
88
|
[ ]auth-port[ ](\d+)
|
68
89
|
[ ]acct-port[ ](\d+)/x
|
69
90
|
|
70
|
-
# Regular expression that
|
71
|
-
# server tacacs+ configuration block
|
91
|
+
# Regular expression that parses the tacacs servers from the aaa group
|
92
|
+
# server tacacs+ configuration block.
|
72
93
|
TACACS_GROUP_SERVER = /\s{3}server
|
73
94
|
[ ]([^\s]+)
|
74
95
|
(?:[ ]vrf[ ](\w+))?
|
@@ -76,15 +97,15 @@ module Rbeapi
|
|
76
97
|
|
77
98
|
##
|
78
99
|
# get returns the aaa server group resource hash that describes the
|
79
|
-
# current configuration for the specified server group name
|
100
|
+
# current configuration for the specified server group name.
|
80
101
|
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
102
|
+
# @example
|
103
|
+
# {
|
104
|
+
# type: <string>,
|
105
|
+
# servers: <array>
|
106
|
+
# }
|
86
107
|
#
|
87
|
-
# @param [String] :name The server group name to return
|
108
|
+
# @param [String] :name The server group name to return from the nodes
|
88
109
|
# current running configuration. If the name is not configured a nil
|
89
110
|
# object is returned.
|
90
111
|
#
|
@@ -99,6 +120,23 @@ module Rbeapi
|
|
99
120
|
response
|
100
121
|
end
|
101
122
|
|
123
|
+
##
|
124
|
+
# getall returns a aaa server groups hash
|
125
|
+
#
|
126
|
+
# @example
|
127
|
+
# {
|
128
|
+
# <name>: {
|
129
|
+
# type: <string>,
|
130
|
+
# servers: <array>
|
131
|
+
# },
|
132
|
+
# <name>: {
|
133
|
+
# type: <string>,
|
134
|
+
# servers: <array>
|
135
|
+
# }
|
136
|
+
# }
|
137
|
+
#
|
138
|
+
# @return [Hash<Symbol, Object>] returns the resource hashes for
|
139
|
+
# configured aaa groups. If none exist, a nil object is returned
|
102
140
|
def getall
|
103
141
|
cfg = config.scan(/aaa group server (?:radius|tacacs\+) (.+)$/)
|
104
142
|
cfg.each_with_object({}) do |name, hsh|
|
@@ -109,7 +147,7 @@ module Rbeapi
|
|
109
147
|
|
110
148
|
##
|
111
149
|
# parse_type scans the specified configuration block and returns the
|
112
|
-
# 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
|
113
151
|
# expected to always be present in the config.
|
114
152
|
#
|
115
153
|
# @api private
|
@@ -160,7 +198,6 @@ module Rbeapi
|
|
160
198
|
# @param [String] :config The aaa server group block configuration for the
|
161
199
|
# group name to parse
|
162
200
|
#
|
163
|
-
#
|
164
201
|
# @return [Hash<Symbol, Object>] resource hash attribute
|
165
202
|
def parse_radius_server(config)
|
166
203
|
values = config.scan(RADIUS_GROUP_SERVER).map do |(name, auth, acct)|
|
@@ -175,8 +212,8 @@ module Rbeapi
|
|
175
212
|
private :parse_radius_server
|
176
213
|
|
177
214
|
##
|
178
|
-
# parse_tacacs_server scans the
|
179
|
-
# the list of servers
|
215
|
+
# parse_tacacs_server scans the provided configuration block and returns
|
216
|
+
# the list of configured servers. The configuration block is expected to
|
180
217
|
# be a tacacs configuration block. If there are no servers configured
|
181
218
|
# for the group the servers value will return an empty array.
|
182
219
|
#
|
@@ -185,7 +222,6 @@ module Rbeapi
|
|
185
222
|
# @param [String] :config The aaa server group block configuration for the
|
186
223
|
# group name to parse
|
187
224
|
#
|
188
|
-
#
|
189
225
|
# @return [Hash<Symbol, Object>] resource hash attribute
|
190
226
|
def parse_tacacs_server(config)
|
191
227
|
values = config.scan(TACACS_GROUP_SERVER).map do |(name, vrf, port)|
|
data/lib/rbeapi/api/acl.rb
CHANGED
@@ -33,7 +33,7 @@ require 'netaddr'
|
|
33
33
|
require 'rbeapi/api'
|
34
34
|
|
35
35
|
##
|
36
|
-
#
|
36
|
+
# Rbeapi toplevel namespace
|
37
37
|
module Rbeapi
|
38
38
|
##
|
39
39
|
# Api is module namespace for working with the EOS command API
|
@@ -56,10 +56,29 @@ module Rbeapi
|
|
56
56
|
##
|
57
57
|
# get returns the specified ACL from the nodes current configuration.
|
58
58
|
#
|
59
|
+
# @example
|
60
|
+
# {
|
61
|
+
# <seqno>: {
|
62
|
+
# seqno: <integer>,
|
63
|
+
# action: <string>,
|
64
|
+
# srcaddr: <string>,
|
65
|
+
# srcprefixle: <string>,
|
66
|
+
# log: <string>
|
67
|
+
# },
|
68
|
+
# <seqno>: {
|
69
|
+
# seqno: <integer>,
|
70
|
+
# action: <string>,
|
71
|
+
# srcaddr: <string>,
|
72
|
+
# srcprefixle: <string>,
|
73
|
+
# log: <string>
|
74
|
+
# },
|
75
|
+
# ...
|
76
|
+
# }
|
77
|
+
#
|
59
78
|
# @param [String] :name The ACL name.
|
60
79
|
#
|
61
80
|
# @return [nil, Hash<Symbol, Object>] Returns the ACL resource as a
|
62
|
-
# Hash.
|
81
|
+
# Hash. Returns nil if name does not exist.
|
63
82
|
def get(name)
|
64
83
|
config = get_block("ip access-list standard #{name}")
|
65
84
|
return nil unless config
|
@@ -72,6 +91,45 @@ module Rbeapi
|
|
72
91
|
# configuration as a hash. The ACL resource collection hash is
|
73
92
|
# keyed by the ACL name.
|
74
93
|
#
|
94
|
+
# @example
|
95
|
+
# {
|
96
|
+
# <name>: {
|
97
|
+
# <seqno>: {
|
98
|
+
# seqno: <integer>,
|
99
|
+
# action: <string>,
|
100
|
+
# srcaddr: <string>,
|
101
|
+
# srcprefixle: <string>,
|
102
|
+
# log: <string>
|
103
|
+
# },
|
104
|
+
# <seqno>: {
|
105
|
+
# seqno: <integer>,
|
106
|
+
# action: <string>,
|
107
|
+
# srcaddr: <string>,
|
108
|
+
# srcprefixle: <string>,
|
109
|
+
# log: <string>
|
110
|
+
# },
|
111
|
+
# ...
|
112
|
+
# },
|
113
|
+
# <name>: {
|
114
|
+
# <seqno>: {
|
115
|
+
# seqno: <integer>,
|
116
|
+
# action: <string>,
|
117
|
+
# srcaddr: <string>,
|
118
|
+
# srcprefixle: <string>,
|
119
|
+
# log: <string>
|
120
|
+
# },
|
121
|
+
# <seqno>: {
|
122
|
+
# seqno: <integer>,
|
123
|
+
# action: <string>,
|
124
|
+
# srcaddr: <string>,
|
125
|
+
# srcprefixle: <string>,
|
126
|
+
# log: <string>
|
127
|
+
# },
|
128
|
+
# ...
|
129
|
+
# },
|
130
|
+
# ...
|
131
|
+
# }
|
132
|
+
#
|
75
133
|
# @return [nil, Hash<Symbol, Object>] Returns a hash that represents
|
76
134
|
# the entire ACL collection from the nodes running configuration.
|
77
135
|
# If there are no ACLs configured, this method will return an
|
data/lib/rbeapi/api/bgp.rb
CHANGED
@@ -51,6 +51,50 @@ module Rbeapi
|
|
51
51
|
# get returns the BGP routing configuration from the nodes current
|
52
52
|
# configuration.
|
53
53
|
#
|
54
|
+
# @example
|
55
|
+
# {
|
56
|
+
# bgp_as: <string>,
|
57
|
+
# router_id: <string>,
|
58
|
+
# shutdown: <string>,
|
59
|
+
# maximum_paths: <integer>,
|
60
|
+
# maximum_ecmp_paths: <integer>
|
61
|
+
# networks: [
|
62
|
+
# {
|
63
|
+
# prefix: <string>,
|
64
|
+
# masklen: <integer>,
|
65
|
+
# route_map: <string>
|
66
|
+
# },
|
67
|
+
# {
|
68
|
+
# prefix: <string>,
|
69
|
+
# masklen: <integer>,
|
70
|
+
# route_map: <string>
|
71
|
+
# }
|
72
|
+
# ],
|
73
|
+
# neighbors: {
|
74
|
+
# name: {
|
75
|
+
# peer_group: <string>,
|
76
|
+
# remote_as: <string>,
|
77
|
+
# send_community: <boolean>,
|
78
|
+
# shutdown: <boolean>,
|
79
|
+
# description: <string>,
|
80
|
+
# next_hop_selp: <boolean>,
|
81
|
+
# route_map_in: <string>,
|
82
|
+
# route_map_out: <string>
|
83
|
+
# },
|
84
|
+
# name: {
|
85
|
+
# peer_group: <string>,
|
86
|
+
# remote_as: <string>,
|
87
|
+
# send_community: <boolean>,
|
88
|
+
# shutdown: <boolean>,
|
89
|
+
# description: <string>,
|
90
|
+
# next_hop_selp: <boolean>,
|
91
|
+
# route_map_in: <string>,
|
92
|
+
# route_map_out: <string>
|
93
|
+
# },
|
94
|
+
# ...
|
95
|
+
# }
|
96
|
+
# }
|
97
|
+
#
|
54
98
|
# @return [nil, Hash<Symbol, Object>] Returns the BGP resource as a
|
55
99
|
# Hash.
|
56
100
|
def get
|
@@ -397,6 +441,18 @@ module Rbeapi
|
|
397
441
|
# get returns a single BGP neighbor entry from the nodes current
|
398
442
|
# configuration.
|
399
443
|
#
|
444
|
+
# @example
|
445
|
+
# {
|
446
|
+
# peer_group: <string>,
|
447
|
+
# remote_as: <string>,
|
448
|
+
# send_community: <string>,
|
449
|
+
# shutdown: <boolean>,
|
450
|
+
# description: <integer>
|
451
|
+
# next_hop_self: <boolean>
|
452
|
+
# route_map_in: <string>
|
453
|
+
# route_map_out: <string>
|
454
|
+
# }
|
455
|
+
#
|
400
456
|
# @param [String] :name The name of the BGP neighbor to manage.
|
401
457
|
# This value can be either an IPv4 address or string (in the
|
402
458
|
# case of managing a peer group).
|
@@ -422,6 +478,31 @@ module Rbeapi
|
|
422
478
|
# getall returns the collection of all neighbor entries for the
|
423
479
|
# BGP router instance.
|
424
480
|
#
|
481
|
+
# @example
|
482
|
+
# {
|
483
|
+
# <name>: {
|
484
|
+
# peer_group: <string>,
|
485
|
+
# remote_as: <string>,
|
486
|
+
# send_community: <string>,
|
487
|
+
# shutdown: <boolean>,
|
488
|
+
# description: <integer>
|
489
|
+
# next_hop_self: <boolean>
|
490
|
+
# route_map_in: <string>
|
491
|
+
# route_map_out: <string>
|
492
|
+
# },
|
493
|
+
# <name>: {
|
494
|
+
# peer_group: <string>,
|
495
|
+
# remote_as: <string>,
|
496
|
+
# send_community: <string>,
|
497
|
+
# shutdown: <boolean>,
|
498
|
+
# description: <integer>
|
499
|
+
# next_hop_self: <boolean>
|
500
|
+
# route_map_in: <string>
|
501
|
+
# route_map_out: <string>
|
502
|
+
# },
|
503
|
+
# ...
|
504
|
+
# }
|
505
|
+
#
|
425
506
|
# @return [nil, Hash<Symbol, Object>] Returns a hash that
|
426
507
|
# represents the entire BGP neighbor collection from the nodes
|
427
508
|
# running configuration. If there a BGP router is not configured
|