Skip to content

Conversation

sguequierre
Copy link
Contributor

  • add bson requirement
  • add more steps/explicit instructions for scripts
  • add viam organizations list instructions for org id

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Aug 28, 2024
Comment on lines 86 to +93
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.
Copy link
Collaborator

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

Copy link
Contributor Author

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`.
Copy link
Collaborator

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")

Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@npentrel npentrel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes needed

sguequierre and others added 2 commits August 29, 2024 10:52
Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com>
@viambot
Copy link
Member

viambot commented Aug 29, 2024

You can view a rendered version of the docs from this PR at https://docs-test.viam.dev/3362

@sguequierre sguequierre requested a review from npentrel August 29, 2024 17:24
@npentrel
Copy link
Collaborator

I didn't realize the highlighting could stack, guess that works!

Copy link
Collaborator

@npentrel npentrel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, thanks!

@npentrel npentrel merged commit da8675b into viamrobotics:main Aug 30, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to build This pull request is marked safe to build from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants