-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adding changes for new api #634
base: main
Are you sure you want to change the base?
Conversation
# Create session | ||
session = create_manager_session(...) | ||
# Get information about tenant status | ||
tenant_status = session.api.dashboard.get_tenant_status() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this comments?
Thanks for helping us develop the SDK and add new features. Some example about endpoints: # file: catalystwan/endpoints/monitoring/device_details.py
class MonitoringDeviceDetails(APIEndpoints):
# ...
@get("/dataservice/device/bfd/summary")
def device_bfd_summary(sefl, deviceIP: str) -> JSON:
...
# ...
# file: catalystwan/endpoints/monitoring/status.py
class MonitoringStatus(APIEndpoints):
# ...
@get("/statistics/approute/tunnels/health/loss_percentage")
def approute_trans_summary(self) -> JSON:
...
# ... |
Returns: | ||
List of bfd summary | ||
""" | ||
bfd_summary = self.session.get_data("/dataservice/device/bfd/summary?deviceId={}".format(device_id)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment to @smialy - this is deprecated way of adding new API.
First things is endpoint call -> all endpoints should be placed in endpoints directory.
Please see this PR -> https://github.com/cisco-open/cisco-catalyst-wan-sdk/pull/31/files -> it is very good representation how endpoints should be added. Look also at other endpoints examples - they will show you how to properly pass device id. Also, prefer f'strings
instead of .format
formatting.
Then you can use your endpoints in API, example -> https://github.com/cisco-open/cisco-catalyst-wan-sdk/blob/main/catalystwan/api/config_group_api.py
I know that it might be misleading because there are apis (like admin tech) that use raw endpoints inside - but these are obsolete and will be replaced. All new APIs should follow layered architecture.
Pull Request summary:
Adding new api call support
Description of changes:
Adding new change for below get api call,
Checklist:
Unit Test: 1st api
Unit Test: 2nd api
Unit Test: 3rd api
Unit Test: 4th api