Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missng docstrings in resources module #366

Merged
merged 5 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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