mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 23:20:27 +00:00
Add API-Endpoint and definition for update_domain
Enables updating/synchronizing domains in background to avoid front end timing out when updating too many domains
This commit is contained in:
parent
f95adf3ea3
commit
1acd246110
@ -509,3 +509,12 @@ def api_get_zones(server_id):
|
|||||||
else:
|
else:
|
||||||
domain_obj_list = Domain.query.all()
|
domain_obj_list = Domain.query.all()
|
||||||
return json.dumps(domain_schema.dump(domain_obj_list)), 200
|
return json.dumps(domain_schema.dump(domain_obj_list)), 200
|
||||||
|
|
||||||
|
#endpoint to snychronize Domains in background
|
||||||
|
@csrf.exempt
|
||||||
|
@api_blueprint.route('/sync_domains', methods=['GET'])
|
||||||
|
@apikey_auth
|
||||||
|
def sync_domains():
|
||||||
|
domain = Domain()
|
||||||
|
domain.update()
|
||||||
|
return 'Finished synchronization in background', 200
|
||||||
|
@ -42,6 +42,20 @@ paths:
|
|||||||
items:
|
items:
|
||||||
$ref: '#/definitions/Server'
|
$ref: '#/definitions/Server'
|
||||||
|
|
||||||
|
'/sync_domains':
|
||||||
|
get:
|
||||||
|
security:
|
||||||
|
- APIKeyHeader: []
|
||||||
|
summary: Sync PDNS with PDNSAdmin
|
||||||
|
operationId: synchronizeDomains
|
||||||
|
tags:
|
||||||
|
- pdnsadmin_zones
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Synchronize PDNS Domains with PDNSAdmin
|
||||||
|
'403':
|
||||||
|
description: Wrong authentication
|
||||||
|
|
||||||
'/servers/{server_id}':
|
'/servers/{server_id}':
|
||||||
get:
|
get:
|
||||||
security:
|
security:
|
||||||
|
Loading…
Reference in New Issue
Block a user