Reply
Highlighted

Powershell WAPI Restart Services

kevins550
Techie
Posts: 1
2479     0

Hi,

 

I have written some Powershell functions for working with Infoblox and we have wapi v1.6.  The functions for fixed address, host and reservations all work OK, but I am having problems with the restartservices function.

 

I am using the uri below and I have looked at the definitive list etc, but the commands for the body of the call don't work for my applinaces.  Has something changed that is not in the documentation as I have tried some and all of the options and all I get back is the dreaded 400 error, which I suspect is a badly formated command.

 

https://nn.nn.nn.nn/wapi/v1.6.1/grid/dfgdfgdfgdfgdfg:Infoblox?_function=restartservices

 

An example of the json data is below

$Data = "{`"restart_option`":'RESTART_IF_NEEDED',`"service_option`":'ALL',`"member_order`":'SEQUENTIAL',`"sequential_delay`":10}"

 

All I really need is to restart the DHCP services so I have tried replacing ALL with DHCP, but it throws it in my face.

 

Can anyone adivse on the correct function call, or data components?

 

 

Re: Powershell WAPI Restart Services

Moderator BRampling
Moderator
Posts: 87
2480     0

This command works fine for me but my lab grid is on 8.0:

 

 

curl -k1 -u admin:infoblox -H "Content-Type: applition/json" -X POST https://10.60.27.4/wapi/v1.6/grid/b25lLmNsdXN0ZXIkMA:Infoblox?_function=restartservices -d '{"restart_option":"RESTART_IF_NEEDED","service_option":"ALL","member_order":"SEQUENTIALLY","sequential_delay":10}'

 

Note that in your example 'SEQUENTIAL' needs to be 'SEQUENTIALLY':

 

member_order ( One of: “SEQUENTIALLY”, “SIMULTANEOUSLY” ). This parameter is mandatory. The order
in which Grid members are being restarted. If this field is set to ‘SEQUENTIALLY’, sequential_delay must also be
provided.

 

 

Showing results for 
Search instead for 
Do you mean 

Recommended for You