python-tatuclient/doc/examples/zone_list_nameservers.py
Endre Karlson 2a2c85ce21 V2 Bindings
This provides bindings for:

- zones
- recordsets
- tlds
- blacklists
- limits
- nameservers

With associated unit tests.

Change-Id: Ie9b79340bd327b78916fd038633842da3ace881b
2015-05-07 17:23:09 +02:00

30 lines
693 B
Python

import logging
import uuid
from designateclient.v2 import client
from designateclient import shell
from designateclient import utils
from keystoneclient.auth.identity import generic
from keystoneclient import session as keystone_session
logging.basicConfig(level='DEBUG')
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(
'primary-%s.io.' % str(uuid.uuid4()),
'PRIMARY',
'root@x.com')
client.nameservers.list(zone['id'])