Title: inconsistency API on get, update and create · Issue #42 · wavefrontHQ/python-client · GitHub
Open Graph Title: inconsistency API on get, update and create · Issue #42 · wavefrontHQ/python-client
X Title: inconsistency API on get, update and create · Issue #42 · wavefrontHQ/python-client
Description: 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...
Open Graph Description: 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_ ...
X Description: 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...
Opengraph URL: https://github.com/wavefrontHQ/python-client/issues/42
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"inconsistency API on get, update and create","articleBody":"please point me to the right documentation if I understand it incorrectly. \r\nit seems some inconsistency on get_, update_ and create_ API \r\nI am using \"dashboard\" as example \r\n\r\napi/dashboard_api.py::get_ and update_ requires a parameter id.\r\n\r\n```\r\ndef get_dashboard(self, id, **kwargs)\r\n```\r\n\r\nbut for dashboard. it requires both id and url be unique \r\nwavefront_api_client/models/dashboard.py\r\n\r\n```\r\n@id.setter\r\n def id(self, id):\r\n \"\"\"Sets the id of this Dashboard.\r\n Unique identifier, also URL slug, of the dashboard # noqa: E501\r\n :param id: The id of this Dashboard. # noqa: E501\r\n :type: str\r\n \"\"\"\r\n if id is None:\r\n raise ValueError(\"Invalid value for `id`, must not be `None`\") # noqa: E501\r\n\r\n self._id = id\r\n\r\n@property\r\n def url(self):\r\n \"\"\"Gets the url of this Dashboard. # noqa: E501\r\n Unique identifier, also URL slug, of the dashboard # noqa: E501\r\n :return: The url of this Dashboard. # noqa: E501\r\n :rtype: str\r\n \"\"\"\r\n return self._url\r\n```\r\n\r\nthat creates a problem. when I need to create a new dashboard. How do I verify I am able to create the dashboard? \r\n\r\nexample:\r\ncurrently I already have a dashboard on wavefront called: dashboard1 it has \r\n\r\n- id:dashboard1\r\n- url: dashboard1\r\n\r\nand user defined a new text file dashboard2.txt. in dashboard2.txt defines\r\n- id: dashboard2\r\n- url: dashboard1\r\n\r\nwhen I try to create new dashboard2, I can find \"id\" from dashboard2.txt, and check it via \r\n```\r\napi_instance.get_dashboard(id)\r\n```\r\nsince dashboard2 has id \"dashboard2\", I will get 404 back from get_dashboard, then I assuming it's safe to create new dashboard2 by calling \r\n```\r\napi_instance.create_dashboard(body=content_of(dashboard2.txt))\r\n```\r\nbut this will result in error\r\n\u003e {\"status\":{\"result\":\"ERROR\",\"message\":\"Unable to create the dashboard. Perhaps a dashboard already exists at id dashboard1\",\"code\":400}}\r\n\r\nit'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. \r\n\r\nI 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. \r\n\r\nif 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)","author":{"url":"https://github.com/ruivapps","@type":"Person","name":"ruivapps"},"datePublished":"2018-07-26T20:37:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/42/python-client/issues/42"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e522f9c2-7ce0-dbc1-6971-493b22632325 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 93FE:B29C0:143BA81:1969343:697EDC1A |
| html-safe-nonce | 2d9e4d2f745f0447670d49950e0a4c3033eb2b0c27eaaf33fbf40e6ca4142a6c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0ZFOkIyOUMwOjE0M0JBODE6MTk2OTM0Mzo2OTdFREMxQSIsInZpc2l0b3JfaWQiOiIyNTM3ODA3MTYzNzc5MTExOTYyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6310581b3033567a1c759456802148e7ac38c9f187c5faf518645be2d429b1ab |
| hovercard-subject-tag | issue:344996421 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/wavefrontHQ/python-client/42/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2ac03ffef8680c15f6a5ae791a291762e1c9d45b14948818b4dca0d942c650ad/wavefrontHQ/python-client/issues/42 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2ac03ffef8680c15f6a5ae791a291762e1c9d45b14948818b4dca0d942c650ad/wavefrontHQ/python-client/issues/42 |
| og:image:alt | 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_ ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ruivapps |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/wavefrontHQ/python-client git https://github.com/wavefrontHQ/python-client.git |
| octolytics-dimension-user_id | 13057332 |
| octolytics-dimension-user_login | wavefrontHQ |
| octolytics-dimension-repository_id | 57399853 |
| octolytics-dimension-repository_nwo | wavefrontHQ/python-client |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 57399853 |
| octolytics-dimension-repository_network_root_nwo | wavefrontHQ/python-client |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width