Skip to content

Commit 6c55eb5

Browse files
feat: ✨ add ecos _peers submodule functions
1 parent 2affd93 commit 6c55eb5

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

pyedgeconnect/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,7 @@ def __init__(
13521352
get_appliance_network_interfaces,
13531353
modify_network_interfaces,
13541354
)
1355+
from .ecos._peers import get_appliance_peers, get_appliance_peers_ec_only
13551356
from .ecos._reboot import request_reboot
13561357
from .ecos._save_changes import save_changes
13571358
from .ecos._sp_portal import register_sp_portal, register_sp_portal_status

pyedgeconnect/ecos/_peers.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# MIT License
2+
# (C) Copyright 2022 Hewlett Packard Enterprise Development LP.
3+
#
4+
# peers : Neighboring EdgeConnect Appliances
5+
6+
7+
def get_appliance_peers(
8+
self,
9+
) -> dict:
10+
"""Get appliance SDWAN peers and related tunnels, including local
11+
breakout passthrough tunnels
12+
13+
.. list-table::
14+
:header-rows: 1
15+
16+
* - Swagger Section
17+
- Method
18+
- Endpoint
19+
* - peers
20+
- GET
21+
- /peers
22+
23+
:return: Returns dictionary of peers and local breakout peers with
24+
list of related tunnels for each \n
25+
* keyword **<peer_name>** (`list[str]`): Peer object, the peer
26+
name will be EdgeConnect hostname for EdgeConnect peer, or
27+
Overlay name in format of ``Overlay_<OVERLAY_NAME>_Primary``
28+
for local breakout \n
29+
* [`str`]: List of tunnel ids connecting to this peer, e.g.
30+
``tunnel_385`` for SDWAN tunnel peer or
31+
``passThrough_320`` for local breakout
32+
:rtype: dict
33+
"""
34+
return self._get("/peers")
35+
36+
37+
def get_appliance_peers_ec_only(
38+
self,
39+
) -> dict:
40+
"""Get appliance SDWAN peers and related tunnels
41+
42+
.. list-table::
43+
:header-rows: 1
44+
45+
* - Swagger Section
46+
- Method
47+
- Endpoint
48+
* - peers
49+
- GET
50+
- /peers/spPeers
51+
52+
:return: Returns dictionary of peers and local breakout peers with
53+
list of related tunnels for each \n
54+
* keyword **<peer_name>** (`list[str]`): Peer object, the peer
55+
name will be EdgeConnect hostname for EdgeConnect peer\n
56+
* [`str`]: List of tunnel ids connecting to this peer, e.g.
57+
``tunnel_385`` for SDWAN tunnel peer
58+
:rtype: dict
59+
"""
60+
return self._get("/peers/spPeers")

0 commit comments

Comments
 (0)