You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
please point me to the right documentation if I understand it incorrectly.
it seems some inconsistency on get_, update_ and create_ API
I am using "dashboard" as example
api/dashboard_api.py::get_ and update_ requires a parameter id.
def get_dashboard(self, id, **kwargs)
but for dashboard. it requires both id and url be unique
wavefront_api_client/models/dashboard.py
@id.setter
def id(self, id):
"""Sets the id of this Dashboard.
Unique identifier, also URL slug, of the dashboard # noqa: E501
:param id: The id of this Dashboard. # noqa: E501
:type: str
"""
if id is None:
raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501
self._id = id
@property
def url(self):
"""Gets the url of this Dashboard. # noqa: E501
Unique identifier, also URL slug, of the dashboard # noqa: E501
:return: The url of this Dashboard. # noqa: E501
:rtype: str
"""
return self._url
that creates a problem. when I need to create a new dashboard. How do I verify I am able to create the dashboard?
example:
currently I already have a dashboard on wavefront called: dashboard1 it has
id:dashboard1
url: dashboard1
and user defined a new text file dashboard2.txt. in dashboard2.txt defines
id: dashboard2
url: dashboard1
when I try to create new dashboard2, I can find "id" from dashboard2.txt, and check it via
api_instance.get_dashboard(id)
since dashboard2 has id "dashboard2", I will get 404 back from get_dashboard, then I assuming it's safe to create new dashboard2 by calling
{"status":{"result":"ERROR","message":"Unable to create the dashboard. Perhaps a dashboard already exists at id dashboard1","code":400}}
it's similar for update_dashboard. if I have 2 dashboard on wavefront already, it has url: dashboard1 and dashboard2, and I am trying to update dashboard1 with url "dashboard2" it will result in similar error.
I understand I can call get_all_dashboard and iterate over to find all id/url or I can just use "try ... except" then try to do string match from error message, but wavefront should provide a better way to allow user to write predictable code. (try...except feels not that predictable). We migrate to wavefront this year (couple month ago) and currently we already have 438 pages of dashboard. (I think it's 25 per page) so iterate over all dashboard doesn't work well either.
if there's already code to empower user to do what I described above, then I would suggest to update documentation so users can easily find the answer. ( I didn't read the source, I was reading trying to only read Python SDK documentation linked from README.md)
The text was updated successfully, but these errors were encountered:
please point me to the right documentation if I understand it incorrectly.
it seems some inconsistency on get_, update_ and create_ API
I am using "dashboard" as example
api/dashboard_api.py::get_ and update_ requires a parameter id.
but for dashboard. it requires both id and url be unique
wavefront_api_client/models/dashboard.py
that creates a problem. when I need to create a new dashboard. How do I verify I am able to create the dashboard?
example:
currently I already have a dashboard on wavefront called: dashboard1 it has
and user defined a new text file dashboard2.txt. in dashboard2.txt defines
when I try to create new dashboard2, I can find "id" from dashboard2.txt, and check it via
since dashboard2 has id "dashboard2", I will get 404 back from get_dashboard, then I assuming it's safe to create new dashboard2 by calling
but this will result in error
it's similar for update_dashboard. if I have 2 dashboard on wavefront already, it has url: dashboard1 and dashboard2, and I am trying to update dashboard1 with url "dashboard2" it will result in similar error.
I understand I can call get_all_dashboard and iterate over to find all id/url or I can just use "try ... except" then try to do string match from error message, but wavefront should provide a better way to allow user to write predictable code. (try...except feels not that predictable). We migrate to wavefront this year (couple month ago) and currently we already have 438 pages of dashboard. (I think it's 25 per page) so iterate over all dashboard doesn't work well either.
if there's already code to empower user to do what I described above, then I would suggest to update documentation so users can easily find the answer. ( I didn't read the source, I was reading trying to only read Python SDK documentation linked from README.md)
The text was updated successfully, but these errors were encountered: