Reply

TTL

Techie
Posts: 4
4912     0

Hello

Hope someone can set me off in the right direction...

Without any problems i can change a host TTL from (within WAPI Rest call) inherit to a value in seconds '{"ttl": 28800 ]}' , but i can't find how to change it back to inherit.
When inherit is enabled and i do a query i see the value "0" but when i use "0" value it's 0 seconds. Sure it's no problem to set it to default 8 hours. I tried the "undef" but that is nog accepted by infoblox.

Help ?

Null or Undefined?

Employee
Employee
Posts: 15
4912     0

1.11 XML Format

<X null=”true”/> Field X with value null/None.

 

I don't see the Null format for JSON.  Also, did you try "null" or "undefined"?

 

Good luck,

Brad

Null or Undefined

Techie
Posts: 4
4912     0

Hi Brad,

Thanks, but i tried those, i also tried "undef" but even that is a nogo.
Everytime i get a "The remote server returned an error: (400) Bad Request". only when i define a number it's working as it should be.
Maybe there is another place where i have to set ttl inherit = true ?

Bart

Re: Null or Undefined

Member
Posts: 2
4912     0

I have also run into this problem.  I was wondering if you had figured it out.

Re: Null or Undefined

Member
Posts: 2
4912     0

I finally figured out how to solve this problem.  Pass use_ttl and have it set to False.

Re: Null or Undefined

Member
Posts: 2
4912     0

Hi imperalix,

 

Can you provide the exact syntax to change the ttl of a host record?

 

hostdata = {'ipv4addrs':[{'ipv4addr':dripaddress}],'name':host, 'ttl':ttl, 'use_ttl':'True'}

# Perform the POST operation to create the record, data to be supplied in JSON format
addRecord = session.post(hostaddurl, data=json.dumps(hostdata))

. I am trying as above, getting a 'Bad Request' response

Re: Null or Undefined

Adviser
Posts: 173
4912     0

Hi Thiyagu,

 

You can create a host record with a modified TTL as shown below

 

 

 curl -k -u admin:infoblox  -H 'Content-Type:application/json' -X POST  "https://grid-master/wapi/v2.7/record:host" -d '{"name":"host1.demo.com","ipv4addrs":[{"ipv4addr":"1.1.1.110"}],"use_ttl":true,"ttl":3600}'

Hope this works for you,

Krishna Vasudevan

 

 

 

Re: TTL

Member
Posts: 1
4912     0

Hi,

I am trying to update TTL of an existing host entry.

 

curl -k -u foo:bar -H 'content-type: application/json' -X PUT "https://hostwapi/v2.7/record:host_ipv4addr/ZG5zLmhvc3RfYWRkcmVzcyQuX2RlZmF1bHQudGVzdC5zdHJhdk8ndGVzdHNhaTEyMy4xOTIuMTY4LjUwLjYu:192.168.10.10/test.host.test/default" -d '{"ttl":60}'

 

But, it's throwing an error saying "unknown argument/field: 'ttl'". Could some one help.

Re: TTL

Community Manager
Community Manager
Posts: 197
4912     0

The TTL belongs to the host object, it does not belong to the host address sub-object.

Re: TTL

Member
Posts: 2
4912     0

Wondering if this is related to the above.  I am trying to "reset" ttl on the host object to "undef" after having set it to a valid value via the REST api in version 2.6.1.  The REST api does not accept any value other than a "valid" unsigned integer value.  Any non-integer value results in a validation error from the REST api.  Such as: "Error": "AdmConProtoError: Invalid value for ttl: \"\": Must be integer type".  The REST api does allow the 'use_ttl' field to be reset to 'False', but doing so does NOT remove the 'ttl' value.  It remains set to an unsigned integer value and can be queried.

 

Anyone know of a way to reset the 'ttl' field value to 'empty' after it is set to a valid value?  We have used the PERL API in the past and that API seems to allow this type of operation...

Showing results for 
Search instead for 
Did you mean: 

Recommended for You