please add documentation and example for python-zunclient API
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zun |
Fix Committed
|
Medium
|
hongbin |
Bug Description
https:/
says:
> It provides a Python API (the zunclient module) and a command-line tool (zun).
I got the command-line tool to work. But I cannot figure out how to use the Python API.
I cannot find documentation of the API or examples of using the API when searching with Google.
Here's an example I tried:
#!/usr/bin/env python
import openstack
conn = openstack.
for network in conn.network.
print network.name
for container in conn.applicatio
print container.name
It gave this error:
Traceback (most recent call last):
File "./test2.py", line 10, in <module>
for container in conn.applicatio
AttributeError: 'BaseProxy' object has no attribute 'containers'
https:/
says:
> application_
> application-
As you can see, I put that proxy name in my code.
The error message says it has no attribute for 'containers'. Should I have used some other name instead? I guessed that name might be correct by following the example of listing networks which I also show above.
What other way can I use the Python API to list containers or do anything at all with the API?
Thanks.
Changed in zun: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
The request for documentation is valid. We will improve the documentation for python-zunclient although I have a question on the example above.
The code you provided is using openstacksdk (not python-zunclient) to consume Zun's API. Do you prefer to use openstacksdk instead? I am not sure if Zun is supported in there but we can work on openstacksdk if this is the preferred way to consume the Zun's service. Looking forward to your remark.