This API call imports external BIND zone files into DDI Central database . It enables administrators to seamlessly migrate or update zone configurations in bulk using standard BIND file format. It also offers a replace option that provides the flexibility in either overwriting or merging with existing configurations.
Method: POST
https://{appconsole_IP}:{9443}/v1/dns/import_bind/
The following headers must be included in the API request for successful authentication and data submission:
Authorization: DDI Central's OAuth implementation uses the Bearer authentication scheme. Hence, while making API calls, access_token obtained via the OAuth 2.0 Client Credentials Grant must be included in the Authorization header of API requests. This token verifies the client’s identity and ensures appropriate permissions for accessing resources.
The Authorization Header follows the format below:
headers = { "Authorization": "Bearer {bearer_tk}" }
Content-Type: Required in the header to indicate the media type of the resource being sent. It helps the server at the receiving end understand how to process the transmitted request body.
The Content-Type Header follows the format below:
headers ={ "Content-Type": "multipart/form-data" }
7207.true.
* - Mandatory parameter.
Copied
{
import requests
url = "https://10.16.11.249:9443/v1/dns/import_bind/"
payload = {}
files=[
('config',('ddi.com.txt',open('/C:/Users/test/Downloads/ddi.com.txt','rb'),'text/plain'))
]
headers = {
'Authorization': 'Bearer V2l17hXtbECyC2dqOwLGJKEMepP6On'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
}
Copied
{
"Message":"Imported the Zone file successfully."
}