-
Notifications
You must be signed in to change notification settings - Fork 3
Adding changes for new api #634
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.
closing as it is stalled and development moved to https://github.com/cisco-en-programmability/catalystwan-sdk |
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