-
Notifications
You must be signed in to change notification settings - Fork 47
DOCS-2795: QA query sensor data sdk #3362
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
DOCS-2795: QA query sensor data sdk #3362
Conversation
sguequierre
commented
Aug 28, 2024
- add bson requirement
- add more steps/explicit instructions for scripts
- add viam organizations list instructions for org id
To access your machines using the Python SDK, you must use an API key: | ||
|
||
```sh {class="command-line" data-prompt="$"} | ||
viam organizations api-key create --org-id <org-id> --name my-api-key | ||
viam organizations api-key create --org-id=<org-id> --name=my-api-key | ||
``` | ||
|
||
This command uses the Viam CLI. | ||
You can use [`viam organizations list`](/cli/#organizations) to retrieve your organization's 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.
Because we can now get API keys from the organization settings page, we could change this. Then there's no need to install the CLI anymore. Fewer clicks away from this page
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? IMO its a bit simpler than the manual instructions for retrieving api key and organization ids and that would require them to click around in the app anyways. I will change if you think 100%
asyncio.run(main()) | ||
``` | ||
|
||
Make sure to replace the value in line 29 with your correct sensor name, line 35 with your organization ID which you can get by running `viam organizations list`, and line 37 with your location ID which you can get by running `viam locations list`. |
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.
This probably isn't visible enough. I think make the <location-id>
all caps <LOCATION-ID>
and add a
# TODO: Replace <LOCATION-ID> with your location ID
above it (same or org id).
And then move this explainer above the code snippet into a note. That way it'll definitely be seen.
You could also pull the strings into variable before the query is called. That might also make it more visible. And you could even add error proofing:
LOCATION_ID = ""
ORG_ID = ""
if not LOCATION_ID or not ORG_ID:
print("Please specify your location ID and organization ID and rerun this script")
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.
you can also change the highlighting on the snippet above to call out those lines
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.
done
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.
Small changes needed
Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/3362 |
I didn't realize the highlighting could stack, guess that works! |
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.
perfect, thanks!