Reply
Highlighted

WAPI start_discovery function to begin Network Discovery?

JKuo
Techie
Posts: 6
1172     0

Hi,

 

I am trying to call the function 'start_dsicovery' under the 'grid' object, as per the documentation, it takes in an input field called 'objects', which should be an array of references as strings.

 

Below is my curl script for proto-typing:

 

 

curl -k -u admin:infoblox -H 'Content-Type:application/json' \
  -X POST 'https://192.168.1.59/wapi/v2.6/grid?_function=start_discovery' \
  -d \
  '{
    "objects":
      [
        "network/ZG5zLm5ldHdvcmskMTkyLjE2OC4xLjAvMjQvMA:192.168.1.0/24/default",
        "network/ZG5zLm5ldHdvcmskMy4wLjAuMC84LzA:3.0.0.0/8/default"
      ]
  }'

 

 

However, I get this error message, even after a few different combinations of the call.

 

 

{ "Error": "AdmConProtoError: Invalid reference: ",
  "code": "Client.Ibap.Proto",
  "text": "Invalid reference: "
}

What is the correct way to invoke a network discovery via WAPI?

Re: WAPI start_discovery function to begin Network Discovery?

TTiscareno Community Manager
Community Manager
Posts: 299
1173     0

It looks like you are associating the function against the Grid object instead of the discoverytask object. If you refer to the Infoblox REST API Guide, you will find details for how to call vDiscovery tasks, including examples using CURL. I believe the same logic will apply for the network_discovery_control function for the discoverytask object as well.

 

https://www.infoblox.com/wp-content/uploads/infoblox-deployment-infoblox-rest-api.pdf

 

curl -k -u admin:Infoblox -H 'content-type: application/json' -X POST "https://127.0.0.1/wapi/v2.7/vdiscoverytask/ZG5zLmNkaXNjb3ZlcnlfdGFzayRBV1MgdkRpc2NvdmVyeQ:AWS%20vDiscovery -d '{"_function=vdiscovery_control&action=START"}'

 

Regards,

Tony

Re: WAPI start_discovery function to begin Network Discovery?

JKuo
Techie
Posts: 6
1173     0

Thanks for the reply Tony, and maybe I am confused myself, but from reading the other threads as well as the WAPI guide, my understanding is this:

 

There are 3 kinds of discovery-related objects, and they control 3 different kinds of discovery operations in NIOS:

1) 'discovery' object: controls Network Insight discovery

2) 'vdiscoverytask' object: controls vDiscovery

3) '???' object: controls network discovery (basically nmap scan)

 

It is the last type of discovery that I am hoping to invoke via WAPI, and the closest thing I found in the documentation is to call the 'grid' object and call its function 'start_discovery'. I tried looking in the 'network' object, but couldn't find anything.

 

If you could point me in the direction to initiate a network-based discovery, that would be much appreciated.

 

-Josh

Re: WAPI start_discovery function to begin Network Discovery?

JKuo
Techie
Posts: 6
1173     0

Answering my own question, it would appear that this feature is not supported by WAPI, and the function I found 'start_discovery' is actually starting the Network Insight discovery.

 

But to add to how to make that type of discovery working (Network Insight member required), it should go like this:

 

1) Update the target network to make sure it has 'enable_discovery' and 'discovery_member' configured.

2) Call 'start_discovery' on the grid reference

 

Sample curl commands

#
# Update network
#
NET_REF="network/ZG5zLm5ldHdvcmskMTkyLjE2OC4xLjAvMjQvMA:192.168.1.0/24/default"
curl -k -u admin:infoblox -H 'Content-Type:application/json' \
 -X PUT 'https://192.168.1.59/wapi/v2.6/'$NET_REF \
 -d \
 '{
    "discovery_member": "ns3.example.com",
    "enable_discovery": true
 }'

#
# Begin discovery
#
GRID_REF="GRID_REF="grid/b25lLmNsdXN0ZXIkMA:Infoblox"
curl -k -u admin:infoblox -H 'Content-Type:application/json' \
  -X POST 'https://192.168.1.59/wapi/v2.6/'$GRID_REF'?_function=start_discovery' \
  -d \
  '{
    "objects":
      [
        { "_ref": "network/ZG5zLm5ldHdvcmskMTkyLjE2OC4xLjAvMjQvMA:192.168.1.0/24/default"}
      ]
  }'
Showing results for 
Search instead for 
Do you mean 

Recommended for You