Skip to content

Commit

Permalink
Merge pull request #366 from fabric-testbed/315.resources-docstrings
Browse files Browse the repository at this point in the history
Add missng docstrings in resources module
  • Loading branch information
sajith authored Sep 16, 2024
2 parents 5f7a8d6 + 120be03 commit 985e6aa
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Artifact Manager Support (Issue [#358](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/358))
- FabNet user specified subnets (Issue [#361](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/361))
- Print a hint when bastion probe fails (Issue [#363](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/363))
- Missing docstrings in resources module (Issue [#313](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/315))

## [1.7.3] - 08/05/2024
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion docs/source/network_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ network_service

.. autoclass:: fabrictestbed_extensions.fablib.network_service.NetworkService
:members:
:no-index:
:no-index:
:special-members: __str__
5 changes: 4 additions & 1 deletion docs/source/resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ resources

.. autoclass:: fabrictestbed_extensions.fablib.resources.Resources
:members:
:no-index:
:special-members: __str__

.. autoclass:: fabrictestbed_extensions.fablib.resources.Links
:members:
:no-index:
:special-members: __str__

.. autoclass:: fabrictestbed_extensions.fablib.resources.FacilityPorts
:members:
:special-members: __str__
:no-index:
:special-members: __str__
9 changes: 6 additions & 3 deletions fabrictestbed_extensions/fablib/fablib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1728,20 +1728,23 @@ def set_slice_manager(self, slice_manager: FabricManager):
:param slice_manager: the slice manager to set
:type slice_manager: SliceManager
.. deprecated:: 1.7.3 Use `set_manager()` instead.
.. deprecated:: 1.7.3
Use `set_manager()` instead.
"""
self.set_manager(manager=slice_manager)

def get_slice_manager(self) -> FabricManager:
"""
Not intended as API call
Gets the slice manager of this fablib object.
:return: the slice manager on this fablib object
:rtype: SliceManager
.. deprecated:: 1.7.3 Use `get_manager()` instead.
.. deprecated:: 1.7.3
Use `get_manager()` instead.
"""
return self.get_manager()

Expand Down
12 changes: 12 additions & 0 deletions fabrictestbed_extensions/fablib/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@


class Resources:
"""
A class for working with FABRIC resources.
"""

def __init__(
self,
fablib_manager,
Expand Down Expand Up @@ -832,6 +836,10 @@ def validate_requested_ero_path(self, source: str, end: str, hops: List[str]):


class Links(Resources):
"""
A class for working with network links.
"""

link_pretty_names = {
"site_names": "Sites",
"node_id": "Link Name",
Expand Down Expand Up @@ -933,6 +941,10 @@ def list_links(


class FacilityPorts(Resources):
"""
A class for working with FABRIC facility ports.
"""

link_pretty_names = {
"name": "Name",
"site_name": "Site",
Expand Down

0 comments on commit 985e6aa

Please sign in to comment.