Reply
Highlighted

WAPI 'start_discovery' Function Help

justintaylor9
Techie
Posts: 4
1701     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 = "https://test-admin.name.ufl.edu/wapi/v$ibvers";

my $request = 'grid:Infoblox?_function=start_discovery;network=10.241.175.0/24';
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?

 

Thanks!!!

Re: WAPI 'start_discovery' Function Help

Moderator BRampling
Moderator
Posts: 69
1702     0

You need the full object reference to the grid:

 

 

curl -k1 -u admin:infoblox -H "Content-Type: application/json" -X GET https://10.60.27.4/wapi/v2.7/grid

[
    {
        "_ref": "grid/b25lLmNsdXN0ZXIkMA:Infoblox"
    }
]

So your request in this case would be:

 

 

 

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

 

Re: WAPI 'start_discovery' Function Help

justintaylor9
Techie
Posts: 4
1702     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 
Do you mean 

Recommended for You