Reply
Accepted Solution

Use API to restart a member service or empty DNS cache

smaubian
Techie
Posts: 2
3898     0

Hi everybody,

 

i'm new to this forum and quite new to Infoblox ;p.

 

I'm looking into the api (Infoblox 8.0.1)  to be able to automatically restart a service on a specific member of my grid. Ultimately i'm looking  for an API to cleaup the cache of a specific view.

 

I looked into the API doc and cannot find any  item to perform this.  Browsing  this site i found some examples using a method "restartservices" that i was not able to locate in the documentation

 

Can anyone tell me which api  can perform the action  as  only item i found was a ServiceRestart::request  which appears to be getter  (when i try to instanciate i'm rejected parameters like member, forced restart,...) ?

Re: Use API to restart a member service or empty DNS cache

[ Edited ]
Adviser
Posts: 132
3899     0

To restart services you need to call the "restartservices" function againt the "grid" object. It's a two-step process: First you do a GET operation to retrieve the object reference for the grid object:

 

curl -k1 -u admin:infoblox 'https://gm.example.com/wapi/v2.5/grid'

 

This will return an object reference like "grid/b25lL2gYdX8jTXIkMA:example-grid". Then you use that object reference in a POST operation to call the restartservices function:

 

curl -k1 -u admin:infoblox -H "Content-Type:application/json" -X POST -d '{"restart_option": "RESTART_IF_NEEDED"}' 'https://gm.example.com/wapi/v2.5/grid/b25lL2gYdX8jTXIkMA:example-grid?_function=restartservices'

 

See the WAPI documentation for the grid object and restartservices function for more info.

 

Frank

Re: Use API to restart a member service or empty DNS cache

[ Edited ]
Adviser
Posts: 132
3899     0

Actually I should have included the exact API call for what you want to do. Given an object reference for the grid object, a call like the following will force a restart of DNS services on a selected member, resulting in the cache being cleared:

 

curl -k1 -u admin:infoblox -H "Content-Type:application/json" -X POST -d '{"restart_option": "FORCE_RESTART", "services": ["DNS"], "members": ["m1.example.com"]}' 'https://gm.example.com/wapi/v2.5/grid/b25lL2gYdX8jTXIkMA:example-grid?_function=restartservices'

Incidentally, the WAPI 2.5 reference guide appears to be incorrect in its description of the "services" option to the "restartservices" function. The documentation says it's a string, but it appears to be a string array instead. Frank

Re: Use API to restart a member service or empty DNS cache

smaubian
Techie
Posts: 2
3899     0

Thanks a lot Frank,

 

i'll have a look again in  the WAPI doc as i was not able to find the restartservices function.

 

your second answser gave me what i need  the "FORCE_RESTART"  and "members"  syntax

 

 

Thanks a lot !

 

 

Stephane

Showing results for 
Search instead for 
Do you mean 

Recommended for You