Skip to content

Commit 8a8dac5

Browse files
committed
updated README
1 parent 1997971 commit 8a8dac5

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,29 @@ import kowabunga
4444

4545
## Usage
4646

47-
Creating an API client can be done by:
47+
Creating an API client and listing all Kompute instances can be done by:
4848

4949
```python
50+
51+
import kowabunga
52+
from kowabunga.rest import ApiException
53+
from pprint import pprint
54+
55+
cfg = kowabunga.Configuration(
56+
host = "https://your_kowabunga_kahuna_server/api/v1"
57+
)
58+
59+
cfg.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
60+
61+
with kowabunga.ApiClient(cfg) as client:
62+
kompute = kowabunga.KomputeApi(client)
63+
64+
try:
65+
for k in kompute.list_komputes():
66+
pprint(kompute.read_kompute(k))
67+
except ApiException as e:
68+
print("Exception when calling KomputeApi->list_komputes: %s\n" % e)
69+
5070
```
5171

5272
where **uri** is *https://your\_kowabunga\_kahuna\_server* and **token** is the associated API key.

0 commit comments

Comments
 (0)