-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from inexio/dev_pbn
Dev pbn
- Loading branch information
Showing
74 changed files
with
1,815 additions
and
33 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
12 changes: 12 additions & 0 deletions
12
nesi/devices/huawei/huawei_resources/huawei_service_port.py
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
12 changes: 12 additions & 0 deletions
12
nesi/devices/huawei/huawei_resources/huawei_service_vlan.py
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
Empty file.
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,17 @@ | ||
from inspect import isclass | ||
from pkgutil import iter_modules | ||
from pathlib import Path | ||
from importlib import import_module | ||
|
||
# iterate through the modules in the current package | ||
package_dir = Path(__file__).resolve().parent | ||
for (_, module_name, _) in iter_modules([package_dir]): | ||
|
||
# import the module and iterate through its attributes | ||
module = import_module(f"{__name__}.{module_name}") | ||
for attribute_name in dir(module): | ||
attribute = getattr(module, attribute_name) | ||
|
||
if isclass(attribute): | ||
# Add the class to this package's variables | ||
globals()[attribute_name] = attribute |
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 @@ | ||
# This file is part of the NESi software. | ||
# | ||
# Copyright (c) 2020 | ||
# Original Software Design by Ilya Etingof <https://github.com/etingof>. | ||
# | ||
# Software adapted by inexio <https://github.com/inexio>. | ||
# - Janis Groß <https://github.com/unkn0wn-user> | ||
# - Philip Konrath <https://github.com/Connyko65> | ||
# - Alexander Dincher <https://github.com/Dinker1996> | ||
# - Philipp-Noah Groß <https://github.com/pngross> | ||
# | ||
# License: https://github.com/inexio/NESi/LICENSE.rst | ||
|
||
from nesi.devices.softbox.api.schemas.ontport_schemas import * | ||
|
||
|
||
class PBNOntPortSchema(OntPortSchema): | ||
class Meta: | ||
model = OntPort | ||
fields = OntPortSchema.Meta.fields + ('operational_state', 'admin_state', 'flow_control', 'duplex', 'speed', | ||
'storm_control') |
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,20 @@ | ||
# This file is part of the NESi software. | ||
# | ||
# Copyright (c) 2020 | ||
# Original Software Design by Ilya Etingof <https://github.com/etingof>. | ||
# | ||
# Software adapted by inexio <https://github.com/inexio>. | ||
# - Janis Groß <https://github.com/unkn0wn-user> | ||
# - Philip Konrath <https://github.com/Connyko65> | ||
# - Alexander Dincher <https://github.com/Dinker1996> | ||
# - Philipp-Noah Groß <https://github.com/pngross> | ||
# | ||
# License: https://github.com/inexio/NESi/LICENSE.rst | ||
|
||
from nesi.devices.softbox.api.schemas.ont_schemas import * | ||
|
||
|
||
class PBNOntSchema(OntSchema): | ||
class Meta: | ||
model = Ont | ||
fields = OntSchema.Meta.fields + ('mac_address',) |
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,26 @@ | ||
# This file is part of the NESi software. | ||
# | ||
# Copyright (c) 2020 | ||
# Original Software Design by Ilya Etingof <https://github.com/etingof>. | ||
# | ||
# Software adapted by inexio <https://github.com/inexio>. | ||
# - Janis Groß <https://github.com/unkn0wn-user> | ||
# - Philip Konrath <https://github.com/Connyko65> | ||
# - Alexander Dincher <https://github.com/Dinker1996> | ||
# - Philipp-Noah Groß <https://github.com/pngross> | ||
# | ||
# License: https://github.com/inexio/NESi/LICENSE.rst | ||
|
||
from nesi.devices.softbox.api.schemas.port_schemas import * | ||
|
||
|
||
class PBNPortSchema(PortSchema): | ||
class Meta: | ||
model = Port | ||
fields = PortSchema.Meta.fields + ('spanning_tree_guard_root', 'switchport_trunk_vlan_allowed', | ||
'switchport_mode_trunk', 'switchport_pvid', 'no_lldp_transmit', 'pbn_speed', | ||
'switchport_block_multicast', 'switchport_rate_limit_egress', | ||
'switchport_rate_limit_ingress', 'no_pdp_enable', 'no_snmp_trap_link_status', | ||
'exclamation_mark', 'switchport_protected') | ||
|
||
channels = ma.Nested(CpesSchema.CpeSchema, many=True) |
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,20 @@ | ||
# This file is part of the NESi software. | ||
# | ||
# Copyright (c) 2020 | ||
# Original Software Design by Ilya Etingof <https://github.com/etingof>. | ||
# | ||
# Software adapted by inexio <https://github.com/inexio>. | ||
# - Janis Groß <https://github.com/unkn0wn-user> | ||
# - Philip Konrath <https://github.com/Connyko65> | ||
# - Alexander Dincher <https://github.com/Dinker1996> | ||
# - Philipp-Noah Groß <https://github.com/pngross> | ||
# | ||
# License: https://github.com/inexio/NESi/LICENSE.rst | ||
|
||
from nesi.devices.softbox.api.schemas.user_schemas import * | ||
|
||
|
||
class PBNUserSchema(UserSchema): | ||
class Meta: | ||
model = User | ||
fields = UserSchema.Meta.fields + ('level', 'profile') |
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,20 @@ | ||
# This file is part of the NESi software. | ||
# | ||
# Copyright (c) 2020 | ||
# Original Software Design by Ilya Etingof <https://github.com/etingof>. | ||
# | ||
# Software adapted by inexio <https://github.com/inexio>. | ||
# - Janis Groß <https://github.com/unkn0wn-user> | ||
# - Philip Konrath <https://github.com/Connyko65> | ||
# - Alexander Dincher <https://github.com/Dinker1996> | ||
# - Philipp-Noah Groß <https://github.com/pngross> | ||
# | ||
# License: https://github.com/inexio/NESi/LICENSE.rst | ||
|
||
from nesi.devices.softbox.api.schemas.vlan_schemas import * | ||
|
||
|
||
class PBNVlanSchema(VlanSchema): | ||
class Meta: | ||
model = Vlan | ||
fields = VlanSchema.Meta.fields + ('type', 'mac_address') |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
__all__ = [] | ||
__all__ = ["pbn_subrack", "pbn_card", "pbn_port", "pbn_user", "pbn_vlan", "pbn_service_port", | ||
"pbn_service_vlan", "pbn_ont", "pbn_ont_port"] | ||
|
Oops, something went wrong.