Skip to content

Commit

Permalink
DOCS-1323: Document robotclient api key (#2193)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyleilani authored Nov 10, 2023
1 parent 1fffb92 commit b5df858
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
29 changes: 29 additions & 0 deletions docs/program/apis/robot.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,4 +555,33 @@ For more information, see the [Typescript SDK Docs](https://ts.viam.dev/classes/
{{% /tab %}}
{{< /tabs >}}

### WithAPIKey

Create a client to interact with your robot using an API key as credentials.

{{< tabs >}}
{{% tab name="Python" %}}

**Parameters:**

- `api_key` [(str)](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str): [An API key](/manage/cli/#authenticate) with access to the robot.

- `api_key_id` [(str)](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str): Your API key ID.
Must be a valid UUID.

**Returns:**

- [(RobotClient.Options)](https://python.viam.dev/autoapi/viam/robot/client/index.html#viam.robot.client.RobotClient): A gRPC client for interacting with your robot.

- [(List[viam.proto.common.ResourceName])](https://python.viam.dev/autoapi/viam/proto/common/index.html#viam.proto.common.ResourceName): List of all known resource names. A property of a [RobotClient](https://python.viam.dev/autoapi/viam/robot/client/index.html)

```python
api_key = "your_api_key"
api_key_id = "valid_uuid"
robot_client = RobotClient.with_api_key(api_key, api_key_id)
```

{{% /tab %}}
{{< /tabs >}}

For the full list of robot API methods, see the [Viam Python SDK documentation](https://python.viam.dev/autoapi/viam/robot/client/index.html#viam.robot.client.RobotClient) or the [RDK (the Viam Go SDK) documentation](https://pkg.go.dev/go.viam.com/rdk/robot/client#RobotClient).
17 changes: 9 additions & 8 deletions static/include/services/apis/robot.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Method Name | Description
----------- | -----------
[`DiscoverComponents`](/program/apis/robot/#discovercomponents) | Get a list of discovered component configurations.
[`FrameSystemConfig`](/program/apis/robot/#framesystemconfig) | Get the configuration of a robot's frame system.
[`Status`](/program/apis/robot/#status) | Get the status of each of the resources on the robot.
[`Close`](/program/apis/robot/#close) | Close the connections and stop periodic tasks across the robot.
[`StopAll`](/program/apis/robot/#stopall) | Cancel all operations for the robot and stop its movement.
[`ResourceNames`](/program/apis/robot/#resourcenames) | Get a list of all the robot's resources.
| Method Name | Description |
| --------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [`DiscoverComponents`](/program/apis/robot/#discovercomponents) | Get a list of discovered component configurations. |
| [`FrameSystemConfig`](/program/apis/robot/#framesystemconfig) | Get the configuration of a robot's frame system. |
| [`Status`](/program/apis/robot/#status) | Get the status of each of the resources on the robot. |
| [`Close`](/program/apis/robot/#close) | Close the connections and stop periodic tasks across the robot. |
| [`StopAll`](/program/apis/robot/#stopall) | Cancel all operations for the robot and stop its movement. |
| [`ResourceNames`](/program/apis/robot/#resourcenames) | Get a list of all the robot's resources. |
| [`WithAPIKey`](/program/apis/robot/#withapikey) | Create a client to interact with your robot using an API key as credentials. |

0 comments on commit b5df858

Please sign in to comment.