WAPI 'start_discovery' Function Help

Posts: 4
3167     0

I am using a Perl script which uses curl to make a WAPI call to run a discovery of a subnet. I am using the following syntax:


my $ibhost;
my $testorprod = `hostname -s`;
my $ibvers = '2.2.2';
my $ibuser = 'nsbot';
my $ibpass = '#####';

$ibhost = "$ibvers";

my $request = 'grid:Infoblox?_function=start_discovery;network=';
my $get = "curl -k1 -u $ibuser:$ibpass -X POST $ibhost/$request";

print `$get`;


I get the following output:


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
150   150    0   150    0     0    634      0 --:--:-- --:--:-- --:--:--  1200
{ "Error": "AdmConProtoError: Unknown object type (grid:Infoblox)",
  "code": "Client.Ibap.Proto",
  "text": "Unknown object type (grid:Infoblox)"


Any idea what I am doing wrong?



Re: WAPI 'start_discovery' Function Help

Posts: 87
3167     0

You need the full object reference to the grid:



curl -k1 -u admin:infoblox -H "Content-Type: application/json" -X GET

        "_ref": "grid/b25lLmNsdXN0ZXIkMA:Infoblox"

So your request in this case would be:




my $request = 'grid/b25lLmNsdXN0ZXIkMA:Infoblox?_function=start_discovery;network=';


Re: WAPI 'start_discovery' Function Help

Posts: 4
3167     0

That syntax resulted in:

{ "Error": "AdmConProtoError: required function parameter missing: objects",
  "code": "Client.Ibap.Proto",
  "text": "required function parameter missing: objects"

Showing results for 
Search instead for 
Did you mean: 

Recommended for You