diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-01-28 07:24:07 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-01-28 07:24:07 +0000 |
commit | 9f1858d0f158487baa9022c08bbb2bc44a9a8ecc (patch) | |
tree | d20d190d134f9e1fec4fe08be55de1f5021714ca | |
parent | 0e103024f2842fde40517d4bd167652fd422155f (diff) | |
parent | 0dc8d7c8ba3bc6d061ebc44472b1d1e73cb137e8 (diff) | |
download | python-neutronclient-9f1858d0f158487baa9022c08bbb2bc44a9a8ecc.tar.gz |
Merge "Delete network with id in sample code using API."
-rw-r--r-- | doc/source/index.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/source/index.rst b/doc/source/index.rst index 85ca400..1dd7cae 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -3,13 +3,17 @@ Python bindings to the OpenStack Network API In order to use the python quantum client directly, you must first obtain an auth token and identify which endpoint you wish to speak to. Once you have done so, you can use the API like so:: + >>> import logging >>> from quantumclient.quantum import client + >>> logging.basicConfig(level=logging.DEBUG) >>> quantum = client.Client('2.0', endpoint_url=OS_URL, token=OS_TOKEN) + >>> quantum.format = 'json' >>> network = {'name': 'mynetwork', 'admin_state_up': True} >>> quantum.create_network({'network':network}) >>> networks = quantum.list_networks(name='mynetwork') >>> print networks - >>> quantum.delete_network(name='mynetwork') + >>> network_id = networks['networks'][0]['id'] + >>> quantum.delete_network(network_id) Command-line Tool |