1. The client body was not a JSON document, or it could not be parsed, or the root element of the JSON document was not a hash.
2. The client did not send an `Accept:` header, or it was set to `*/*`.
-3. For requests that operate on a zone, the `zone_id` URL part was invalid. To get a valid `zone_id`, list the zones with the `/servers/:server_id/zones` endpoint.
+3. For requests that operate on a zone, the `zone_id` URL part was invalid. To get a valid `zone_id`, list the zones with the `/api/v1/servers/:server_id/zones` endpoint.
-URL: /
-------
+URL: /api/v1
+------------
Allowed methods: `GET`
{
- "server_url": "/servers{/server}",
+ "server_url": "/api/v1/servers{/server}",
"api_features": [],
}
{
"type": "Server",
"id": "localhost",
- "url": "/servers/localhost",
+ "url": "/api/v1/servers/localhost",
"daemon_type": "recursor",
"version": "VERSION",
- "config_url": "/servers/localhost/config{/config_setting}",
- "zones_url": "/servers/localhost/zones{/zone}",
+ "config_url": "/api/v1/servers/localhost/config{/config_setting}",
+ "zones_url": "/api/v1/servers/localhost/zones{/zone}",
}
Note: On a pdns server, the servers collection is read-only, and the only
May be one of `authoritative`, `recursor`.
-URL: /servers
+URL: /api/v1/servers
-------------
Collection access.
* pdnscontrol: `GET`, `PUT`, `POST`, `DELETE`
-URL: /servers/:server\_id
+URL: /api/v1/servers/:server\_id
-------------------------
Returns a single server_resource.
}
-URL: /servers/:server\_id/config
+URL: /api/v1/servers/:server\_id/config
--------------------------------
Collection access.
**TODO**: Not yet implemented.
-URL: /servers/:server\_id/config/:config\_setting\_name
+URL: /api/v1/servers/:server\_id/config/:config\_setting\_name
-------------------------------------------------------
Allowed REST methods: `GET`, `PUT`
"id": "<id>",
"name": "<string>",
"type": "Zone",
- "url": "/servers/:server_id/zones/:id",
+ "url": "/api/v1/servers/:server_id/zones/:id",
"kind": "<kind>",
"serial": <int>,
"notified_serial": <int>,
`nameservers`, `records`.
-URL: /servers/:server\_id/zones
+URL: /api/v1/servers/:server\_id/zones
-------------------------------
Allowed REST methods: `GET`, `POST`
**TODO**: `dnssec`, `nsec3narrow`, `nsec3param`, `presigned` are not yet implemented.
-URL: /servers/:server\_id/zones/:zone\_id
+URL: /api/v1/servers/:server\_id/zones/:zone\_id
-----------------------------------------
Allowed methods: `GET`, `PUT`, `DELETE`, `PATCH`.
Changing `name` renames the zone, as expected.
-URL: /servers/:server\_id/zones/:zone\_id/notify
+URL: /api/v1/servers/:server\_id/zones/:zone\_id/notify
------------------------------------------------
Allowed methods: `PUT`
Clients MUST NOT send a body.
-URL: /servers/:server\_id/zones/:zone\_id/axfr-retrieve
+URL: /api/v1/servers/:server\_id/zones/:zone\_id/axfr-retrieve
-------------------------------------------------------
Allowed methods: `PUT`
**Note**: Added in 3.4.2
-URL: /servers/:server\_id/zones/:zone\_id/export
+URL: /api/v1/servers/:server\_id/zones/:zone\_id/export
-------------------------------------------------------
Allowed methods: `GET`
Not supported for recursors.
-URL: /servers/:server\_id/zones/:zone\_id/check
+URL: /api/v1/servers/:server\_id/zones/:zone\_id/check
-----------------------------------------------
Allowed methods: `GET`
metadata.
-URL: /servers/:server\_id/zones/:zone\_name/metadata
+URL: /api/v1/servers/:server\_id/zones/:zone\_name/metadata
----------------------------------------------------
Collection access.
**TODO**: Not yet implemented.
-URL: /servers/:server\_id/zones/:zone\_name/metadata/:metadata\_kind
+URL: /api/v1/servers/:server\_id/zones/:zone\_name/metadata/:metadata\_kind
--------------------------------------------------------------------
Allowed methods: `GET`, `PUT`, `DELETE`
`ds`: an array with all dses for this key
-URL: /servers/:server\_id/zones/:zone\_name/cryptokeys
+URL: /api/v1/servers/:server\_id/zones/:zone\_name/cryptokeys
------------------------------------------------------
Allowed methods: `GET`, `POST`
numeric id, see
[http://rtfm.powerdns.com/pdnsutil.html](http://rtfm.powerdns.com/pdnsutil.html)
-URL: /servers/:server\_id/zones/:zone\_name/cryptokeys/:cryptokey\_id
+URL: /api/v1/servers/:server\_id/zones/:zone\_name/cryptokeys/:cryptokey\_id
---------------------------------------------------------------------
Allowed methods: `GET`, `PUT`, `DELETE`
Logging & Statistics
====================
-URL: /servers/:server\_id/search-log?q=:search\_term
+URL: /api/v1/servers/:server\_id/search-log?q=:search\_term
----------------------------------------------------
Allowed methods: `GET` (Query)
...
]
-URL: /servers/:server\_id/statistics
+URL: /api/v1/servers/:server\_id/statistics
------------------------------------
Allowed methods: `GET` (Query)
Values are returned as strings.
-URL: /servers/:server\_id/trace
+URL: /api/v1/servers/:server\_id/trace
-------------------------------
**TODO**: Not yet implemented.
}
-URL: /servers/:server\_id/failures
+URL: /api/v1/servers/:server\_id/failures
----------------------------------
**TODO**: Not yet implemented.
**TODO**: should this be stored? (for history)
-URL: /servers/:server\_id/overrides
+URL: /api/v1/servers/:server\_id/overrides
----------------------------------
**TODO**: Not yet implemented.
Allowed Methods: `GET`, `POST`
-URL: /servers/:server\_id/overrides/:override\_id
+URL: /api/v1/servers/:server\_id/overrides/:override\_id
-------------------------------------------------
**TODO**: Not yet implemented.
class Zones(ApiTestCase):
def test_list_zones(self):
- r = self.session.get(self.url("/servers/localhost/zones"))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones"))
self.assert_success_json(r)
domains = r.json()
example_com = [domain for domain in domains if domain['name'] in ('example.com', 'example.com.')]
payload[k] = v
print payload
r = self.session.post(
- self.url("/servers/localhost/zones"),
+ self.url("/api/v1/servers/localhost/zones"),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
}
print payload
r = self.session.post(
- self.url("/servers/localhost/zones"),
+ self.url("/api/v1/servers/localhost/zones"),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assertEquals(r.status_code, 422)
print "payload:", payload
print "data:", data
# Because slave zones don't get a SOA, we need to test that they'll show up in the zone list.
- r = self.session.get(self.url("/servers/localhost/zones"))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones"))
zonelist = r.json()
print "zonelist:", zonelist
self.assertIn(payload['name'], [zone['name'] for zone in zonelist])
# Also test that fetching the zone works.
- r = self.session.get(self.url("/servers/localhost/zones/" + data['id']))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + data['id']))
data = r.json()
print "zone (fetched):", data
for k in ('name', 'masters', 'kind'):
def test_delete_slave_zone(self):
payload, data = self.create_zone(kind='Slave', nameservers=None, masters=['127.0.0.2'])
- r = self.session.delete(self.url("/servers/localhost/zones/" + data['id']))
+ r = self.session.delete(self.url("/api/v1/servers/localhost/zones/" + data['id']))
r.raise_for_status()
def test_retrieve_slave_zone(self):
payload, data = self.create_zone(kind='Slave', nameservers=None, masters=['127.0.0.2'])
print "payload:", payload
print "data:", data
- r = self.session.put(self.url("/servers/localhost/zones/" + data['id'] + "/axfr-retrieve"))
+ r = self.session.put(self.url("/api/v1/servers/localhost/zones/" + data['id'] + "/axfr-retrieve"))
data = r.json()
print "status for axfr-retrieve:", data
self.assertEqual(data['result'], u'Added retrieval request for \'' + payload['name'] +
payload, data = self.create_zone(kind='Master')
print "payload:", payload
print "data:", data
- r = self.session.put(self.url("/servers/localhost/zones/" + data['id'] + "/notify"))
+ r = self.session.put(self.url("/api/v1/servers/localhost/zones/" + data['id'] + "/notify"))
data = r.json()
print "status for notify:", data
self.assertEqual(data['result'], 'Notification queued')
payload, data = self.create_zone(name='foo/bar.'+unique_zone_name())
name = payload['name']
zone_id = (name.replace('/', '=2F')) + '.'
- r = self.session.get(self.url("/servers/localhost/zones/" + zone_id))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + zone_id))
data = r.json()
for k in ('id', 'url', 'name', 'masters', 'kind', 'last_check', 'notified_serial', 'serial', 'dnssec'):
self.assertIn(k, data)
self.assertEquals(data[k], payload[k])
def test_get_zone(self):
- r = self.session.get(self.url("/servers/localhost/zones"))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones"))
domains = r.json()
example_com = [domain for domain in domains if domain['name'] == u'example.com'][0]
- r = self.session.get(self.url("/servers/localhost/zones/" + example_com['id']))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + example_com['id']))
self.assert_success_json(r)
data = r.json()
for k in ('id', 'url', 'name', 'masters', 'kind', 'last_check', 'notified_serial', 'serial'):
payload['kind'] = 'Master'
payload['nameservers'] = []
r = self.session.post(
- self.url("/servers/localhost/zones"),
+ self.url("/api/v1/servers/localhost/zones"),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assertEquals(r.status_code, 422)
payload['kind'] = 'Master'
payload['nameservers'] = []
r = self.session.post(
- self.url("/servers/localhost/zones"),
+ self.url("/api/v1/servers/localhost/zones"),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
payload['kind'] = 'Master'
payload['nameservers'] = []
r = self.session.post(
- self.url("/servers/localhost/zones"),
+ self.url("/api/v1/servers/localhost/zones"),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
name = payload['name']
# export it
r = self.session.get(
- self.url("/servers/localhost/zones/" + name + "/export"),
+ self.url("/api/v1/servers/localhost/zones/" + name + "/export"),
headers={'accept': 'application/json;q=0.9,*/*;q=0.8'}
)
self.assert_success_json(r)
name = payload['name']
# export it
r = self.session.get(
- self.url("/servers/localhost/zones/" + name + "/export"),
+ self.url("/api/v1/servers/localhost/zones/" + name + "/export"),
headers={'accept': '*/*'}
)
data = r.text.strip().split("\n")
'soa_edit': 'EPOCH'
}
r = self.session.put(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
'soa_edit': ''
}
r = self.session.put(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
# verify that (only) the new record is there
- r = self.session.get(self.url("/servers/localhost/zones/" + name))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + name))
rrset['type'] = rrset['type'].upper()
data = r.json()['records']
recs = [rec for rec in data if rec['type'] == rrset['type'] and rec['name'] == rrset['name']]
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
# verify that (only) the new record is there
- r = self.session.get(self.url("/servers/localhost/zones/" + name))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + name))
data = r.json()['records']
recs = [rec for rec in data if rec['type'] == rrset['type'] and rec['name'] == rrset['name']]
self.assertEquals(recs, rrset['records'])
}
payload = {'rrsets': [rrset1, rrset2]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
# verify that all rrsets have been updated
- r = self.session.get(self.url("/servers/localhost/zones/" + name))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + name))
data = r.json()['records']
recs1 = [rec for rec in data if rec['type'] == rrset1['type'] and rec['name'] == rrset1['name']]
self.assertEquals(recs1, rrset1['records'])
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
# verify that the records are gone
- r = self.session.get(self.url("/servers/localhost/zones/" + name))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + name))
data = r.json()['records']
recs = [rec for rec in data if rec['type'] == rrset['type'] and rec['name'] == rrset['name']]
self.assertEquals(recs, [])
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
soa_serial1 = [rec for rec in r.json()['records'] if rec['type'] == 'SOA'][0]['content'].split()[2]
self.assertNotEquals(soa_serial1, '1')
# make sure domain is still in zone list (disabled SOA!)
- r = self.session.get(self.url("/servers/localhost/zones"))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones"))
domains = r.json()
self.assertEquals(len([domain for domain in domains if domain['name'] == name]), 1)
# sleep 1sec to ensure the EPOCH value changes for the next request
rrset['records'][0]['disabled'] = False
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assertEquals(r.status_code, 422)
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assertEquals(r.status_code, 422)
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assertEquals(r.status_code, 422)
]
}
payload = {'rrsets': [rrset]}
- r = self.session.patch(self.url("/servers/localhost/zones/" + name), data=json.dumps(payload),
+ r = self.session.patch(self.url("/api/v1/servers/localhost/zones/" + name), data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assertEquals(r.status_code, 422)
self.assertIn('unknown type', r.json()['error'])
]
}
payload = {'rrsets': [rrset]}
- r = self.session.patch(self.url("/servers/localhost/zones/" + name), data=json.dumps(payload),
+ r = self.session.patch(self.url("/api/v1/servers/localhost/zones/" + name), data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assertEquals(r.status_code, 422)
self.assertIn('Not in expected format', r.json()['error'])
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
print r.content
def test_zone_delete(self):
payload, zone = self.create_zone()
name = payload['name']
- r = self.session.delete(self.url("/servers/localhost/zones/" + name))
+ r = self.session.delete(self.url("/api/v1/servers/localhost/zones/" + name))
self.assertEquals(r.status_code, 204)
self.assertNotIn('Content-Type', r.headers)
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
# make sure the comments have been set, and that the NS
# records are still present
- r = self.session.get(self.url("/servers/localhost/zones/" + name))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + name))
data = r.json()
print data
self.assertNotEquals([r for r in data['records'] if r['type'] == 'NS'], [])
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
# make sure the NS records are still present
- r = self.session.get(self.url("/servers/localhost/zones/" + name))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + name))
data = r.json()
print data
self.assertNotEquals([r for r in data['records'] if r['type'] == 'NS'], [])
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
}
payload2 = {'rrsets': [rrset2]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload2),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
# make sure the comments still exist
- r = self.session.get(self.url("/servers/localhost/zones/" + name))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + name))
data = r.json()
print data
# fix up input data for comparison with assertEquals.
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
- r = self.session.get(self.url("/servers/localhost/zones/" + revzone))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + revzone))
recs = r.json()['records']
print recs
revrec = [rec for rec in recs if rec['type'] == 'PTR']
}
payload = {'rrsets': [rrset]}
r = self.session.patch(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
- r = self.session.get(self.url("/servers/localhost/zones/" + revzone))
+ r = self.session.get(self.url("/api/v1/servers/localhost/zones/" + revzone))
recs = r.json()['records']
print recs
revrec = [rec for rec in recs if rec['type'] == 'PTR']
def test_search_rr_exact_zone(self):
name = unique_zone_name()
self.create_zone(name=name)
- r = self.session.get(self.url("/servers/localhost/search-data?q=" + name))
+ r = self.session.get(self.url("/api/v1/servers/localhost/search-data?q=" + name))
self.assert_success_json(r)
print r.json()
self.assertEquals(r.json(), [{u'object_type': u'zone', u'name': name, u'zone_id': name+'.'}])
def test_search_rr_substring(self):
name = 'search-rr-zone.name'
self.create_zone(name=name)
- r = self.session.get(self.url("/servers/localhost/search-data?q=*rr-zone*"))
+ r = self.session.get(self.url("/api/v1/servers/localhost/search-data?q=*rr-zone*"))
self.assert_success_json(r)
print r.json()
# should return zone, SOA, ns1, ns2
def test_search_rr_case_insensitive(self):
name = 'search-rr-insenszone.name'
self.create_zone(name=name)
- r = self.session.get(self.url("/servers/localhost/search-data?q=*rr-insensZONE*"))
+ r = self.session.get(self.url("/api/v1/servers/localhost/search-data?q=*rr-insensZONE*"))
self.assert_success_json(r)
print r.json()
# should return zone, SOA, ns1, ns2
def setUp(self):
super(AuthRootZone, self).setUp()
# zone name is not unique, so delete the zone before each individual test.
- self.session.delete(self.url("/servers/localhost/zones/=2E"))
+ self.session.delete(self.url("/api/v1/servers/localhost/zones/=2E"))
def test_create_zone(self):
payload, data = self.create_zone(name='', serial=22, soa_edit_api='')
" 10800 3600 604800 3600"
)
# Regression test: verify zone list works
- zonelist = self.session.get(self.url("/servers/localhost/zones")).json()
+ zonelist = self.session.get(self.url("/api/v1/servers/localhost/zones")).json()
print "zonelist:", zonelist
self.assertIn(payload['name'], [zone['name'] for zone in zonelist])
# Also test that fetching the zone works.
print "id:", data['id']
self.assertEquals(data['id'], '=2E')
- data = self.session.get(self.url("/servers/localhost/zones/" + data['id'])).json()
+ data = self.session.get(self.url("/api/v1/servers/localhost/zones/" + data['id'])).json()
print "zone (fetched):", data
for k in ('name', 'kind'):
self.assertIn(k, data)
'soa_edit': 'EPOCH'
}
r = self.session.put(
- self.url("/servers/localhost/zones/" + zone_id),
+ self.url("/api/v1/servers/localhost/zones/" + zone_id),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
'soa_edit': ''
}
r = self.session.put(
- self.url("/servers/localhost/zones/" + zone_id),
+ self.url("/api/v1/servers/localhost/zones/" + zone_id),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
'recursion_desired': rd
}
r = self.session.post(
- self.url("/servers/localhost/zones"),
+ self.url("/api/v1/servers/localhost/zones"),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
'recursion_desired': False
}
r = self.session.put(
- self.url("/servers/localhost/zones/" + name),
+ self.url("/api/v1/servers/localhost/zones/" + name),
data=json.dumps(payload),
headers={'content-type': 'application/json'})
self.assert_success_json(r)
def test_zone_delete(self):
payload, zone = self.create_zone(kind='Native')
name = payload['name']
- r = self.session.delete(self.url("/servers/localhost/zones/" + name))
+ r = self.session.delete(self.url("/api/v1/servers/localhost/zones/" + name))
self.assertEquals(r.status_code, 204)
self.assertNotIn('Content-Type', r.headers)
def test_search_rr_exact_zone(self):
name = unique_zone_name() + '.'
self.create_zone(name=name, kind='Native')
- r = self.session.get(self.url("/servers/localhost/search-data?q=" + name))
+ r = self.session.get(self.url("/api/v1/servers/localhost/search-data?q=" + name))
self.assert_success_json(r)
print r.json()
self.assertEquals(r.json(), [{u'type': u'zone', u'name': name, u'zone_id': name}])
def test_search_rr_substring(self):
name = 'search-rr-zone.name'
self.create_zone(name=name, kind='Native')
- r = self.session.get(self.url("/servers/localhost/search-data?q=rr-zone"))
+ r = self.session.get(self.url("/api/v1/servers/localhost/search-data?q=rr-zone"))
self.assert_success_json(r)
print r.json()
# should return zone, SOA