API is not accepting NTP dns server address
search cancel

API is not accepting NTP dns server address

book

Article ID: 220665

calendar_today

Updated On:

Products

Security Analytics

Issue/Introduction

When trying to set the NTP server address via an API call using a hostname on Security Analytics, you see an error: "API_FAILURE_CODE."  If you try using the IP address, it works successfully.

 

Resolution

In order to use a hostname in the API call, you must use the following syntax:

post_ntp = (first_api.callAPI('POST','/settings/ntp', {
    'enable': True,
    'servers': [{
        'ntp_address': 'dns_of_ntp_server',
        'ntp_encrypt': "0"
     }]
}))