-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vasant
committed
May 14, 2020
1 parent
aa72b67
commit ed7a3a5
Showing
5 changed files
with
117 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class DVSLag(object): | ||
def __init__(self, cdb): | ||
self.config_db = cdb | ||
|
||
def create_port_channel(self, lag_id, admin_status="up", mtu="1500"): | ||
lag = "PortChannel{}".format(lag_id) | ||
lag_entry = {"admin_status": admin_status, "mtu": mtu} | ||
self.config_db.create_entry("PORTCHANNEL", lag, lag_entry) | ||
|
||
def remove_port_channel(self, lag_id): | ||
lag = "PortChannel{}".format(lag_id) | ||
self.config_db.delete_entry("PORTCHANNEL", lag) | ||
|
||
def create_port_channel_member(self, lag_id, interface): | ||
member = "PortChannel{}|{}".format(lag_id, interface) | ||
member_entry = {"NULL": "NULL"} | ||
self.config_db.create_entry("PORTCHANNEL_MEMBER", member, member_entry) | ||
|
||
def remove_port_channel_member(self, lag_id, interface): | ||
member = "PortChannel{}|{}".format(lag_id, interface) | ||
self.config_db.delete_entry("PORTCHANNEL_MEMBER", member) |
Oops, something went wrong.