DNS Configuration on Server:
Design Pattern1 :accept:
Python Script : dns_configuration.py
Inputs for the scripts :
A)Server to be configured(IP address ,username and password)
B)Location of the configuration file
C)Copy the file to the server using sftp module
D)Running the required steps using either of the below module:
os,paramiko or subprocess
Design Pattern2 using api:
User dsr-secure64 dns api configuring the servers
List of few api's which can be useful for the purpose:
https://github.com/dsr-secure64/nfv-dns-rest-api/blob/master/master_api.raml
https://github.com/dsr-secure64/nfv-dns-rest-api/blob/master/RAML/command_and_control-v1.raml
**/config:**
get:
is: [restContextAuthorized, producesFile]
description: Returns the `nsd.conf` file in BIN format.
put:
is: [restContextAuthorized, consumesFile]
description: Places/replaces the `nsd.conf` file on the server. The name of the file being "PUT" must be `nsd.conf`.
responses:
200:
body:
application/json:
schema: response
example: |
{
"code": 200,
"message": "ok",
"payload": {
"file": "nsd.conf",
"directory": "/usr/local/s64/authdnsadmin"
}
}
**/reconfig**:
post:
is: [restContextAuthorized]
description: |
Reload AuthDNS with a fresh read of the `nsd.conf` configuration file.
responses:
200:
body:
application/json:
schema: response
example: |
{
"code": 200,
"message": "ok",
"payload": {
"authdns_reconfig": [
"reconfig start, read /usr/local/etc/s64auth/s64authdns.conf",
"ok"
]
}
}
Using the above raml file need to api usingpython
Modules in Python for Raml parsing:
Flask-RAML
raml-python
RAMSES