diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-09-02 17:07:11 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-09-02 17:07:12 +0000 |
commit | 52d68e5b19e42061506d7234103220132275e3be (patch) | |
tree | 125c6bbeb0d19f352b23c54c2948f741646f9c35 /doc | |
parent | 86d988d56fa29fe4d467874868e5e09ad9a4780d (diff) | |
parent | f7d4dbbff5e8cf3d438979836c3957c8c23a1a04 (diff) | |
download | python-designateclient-52d68e5b19e42061506d7234103220132275e3be.tar.gz |
Merge "V2 CLI Support"
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/bindings.rst | 28 | ||||
-rw-r--r-- | doc/source/index.rst | 1 | ||||
-rw-r--r-- | doc/source/shell-v2.rst | 43 |
3 files changed, 72 insertions, 0 deletions
diff --git a/doc/source/bindings.rst b/doc/source/bindings.rst index e977cb3..6795d04 100644 --- a/doc/source/bindings.rst +++ b/doc/source/bindings.rst @@ -6,6 +6,34 @@ The python-designateclient package comes with python bindings for the Designate API. This can be used to interact with the Designate API from any python program. +Introduction - Bindings v2 +========================== + +To view examples of usage please checkout the *doc/examples* folder, basic usage is: + +.. code-block:: python + + #!/usr/bin/env python + from designateclient.v2 import client + from designateclient import shell + + from keystoneclient.auth.identity import generic + from keystoneclient import session as keystone_session + + auth = generic.Password( + auth_url=shell.env('OS_AUTH_URL'), + username=shell.env('OS_USERNAME'), + password=shell.env('OS_PASSWORD'), + tenant_name=shell.env('OS_TENANT_NAME')) + + session = keystone_session.Session(auth=auth) + + client = client.Client(session=session) + + zone = client.zones.create('i.io.', email='i@i.io') + + rs = client.recordsets.create(zone['id'], 'www', 'A', ['10.0.0.1']) + Introduction ============ diff --git a/doc/source/index.rst b/doc/source/index.rst index 9ed8055..b252f5b 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -19,6 +19,7 @@ Contents bindings shell shell-examples + shell-v2 contributing Indices and tables diff --git a/doc/source/shell-v2.rst b/doc/source/shell-v2.rst new file mode 100644 index 0000000..652ecac --- /dev/null +++ b/doc/source/shell-v2.rst @@ -0,0 +1,43 @@ +============================= +designate v2 cli and examples +============================= + +In order to use the v2 you need *python-openstackclient* available. + +:: + + $ pip install python-openstackclient + + +Using the client +---------------- + +Source credentials first + +:: + + $ source ~/openrc + +Or you can use the ~/.config/openstack/clouds.yaml approach. + +.. note:: + + This required you to pass in --os-cloud <cloudname> after the "openstack" part. + +We can now try to create a primary zone + +.. code-block:: shell-session + + $ openstack zone create --name example.net. --email foo@example.org + +Create a A type recordset with some records in it. + +.. code-block:: shell-session + + $ openstack recordset create example.net --type A --name www --records 10.0.0.1 10.0.0.2 + +Set a PTR record for a Floating IP + +.. code-block:: shell-session + + $ openstack ptr record set RegionOne:5c02c519-4928-4a38-bd10-c748c200912f mail.example.net. |