Skip to content

Commit

Permalink
Make example in README runnable. (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething authored Nov 7, 2022
1 parent 3e80668 commit f3e63a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ To support all of DigitalOcean's HTTP APIs, a generated library is available whi
Find below a working example for GET a ssh_key ([per this http request](https://docs.digitalocean.com/reference/api/api-reference/#operation/sshKeys_list)) and printing the ID associated with the ssh key. If you'd like to try out this quick example, you can follow [these instructions](https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/) to add ssh keys to your DO account.

```python
import os
from pydo import Client

client = Client(token=$DIGITALOCEAN_TOKEN)
client = Client(token=os.getenv("$DIGITALOCEAN_TOKEN"))

ssh_keys_resp = client.ssh_keys.list()
for k in ssh_keys_resp["ssh_keys"]:
Expand Down

0 comments on commit f3e63a6

Please sign in to comment.