Fetch Devices Discovered During a Network Scan

The API enables users to fetch the discovered devices from a particular discovery instance (Network Scan) using the discovery name.

Before you begin

  • The user should have the ACF permission to view the certificate discovery.

Request Structure

Endpoint: /certificate/discovery/devicesList
Type: POST
Sample URL:
https://<IP/HostName/TenantName>:<GWPORT>/avxapi/certificate/discovery/devicesList?gwsource=external

To understand the elements of the sample URL, click here.

Headers
Content-Type: application/json
Table 1. Input Parameters
Name Description
sessionId

Header

(Mandatory) Session ID received after login.

Type: String

userName

Header

(Mandatory) Username for logging in to AppViewX.

Type: String

password

Header

(Mandatory) Password for logging in to AppViewX.

Type: String

content-type

Header

(Mandatory) Payload content-type with application/json value.

Type: String

Constraint: The value must be application/json.

gwsource

Query

(Mandatory) The source from which the request is triggered, e.g., external.

Type: String

PayloadBody Contains all the parameters to be sent in the request body for the post request.

Type: Payload

Payload

Table 2. Payload
Name Description
name (Mandatory) Name of the discovery instance created.

Type: String

searchTextValue (Optional) Query the fetched results based on the provided search value.
sortColumn (Optional) specifies the column on which the sort has to be applied.
sortOrder (Optional) specifies the sort order to be applied.

Constraint: Possible values : 1, -1, asc, desc

maxSize (Optional) specifies the maximum number of results that can be retrieved.

Constraint : Possible values in the range 1 to 100.

Response Structure

Response returns string of type application/json with the following body parameters:

Table 3. Parameters
Name Description
response Contains the response attributes.

Type: A JSON object

search null
totalRecords Total number of records in the specified discoveryInstance.
data Device metadata.

Type: Array of Device Data json

autoSuggest null
executionTime Execution time of the request.
iTotalDisplayRecords Total number of records in the specified discoveryInstance.
message

If matching records are found for the search query - null. If no records are available for the search query - No matching records found.

Type: String

appStatusCode Application specific status code for the response. It is a non-null value for a failure response.

Type: String

Status Codes

HTTP Code appStatusCode Response Message
200 OK null Response contains the device data of the specified discovery instance.
400 Bad Request INVALID_REQUEST Invalid request specified - <reason>.

Remediation: Ensure that the payload/query param is valid and the <reason> is handled.

401 Unauthorized AVX_GW_003

Authentication failed, reason - Invalid Credentials.

Remediation: Ensure that valid username and password is provided as header parameters.

403 Forbidden AVX_GW_005 The user does not have view permission to the Discovery.
404 Not Found MSG_DISC_DISCOVERY_NAME_NOTFOUND Discovery name: <Discovery Name> not available.

Remediation: Check whether the discoveryName provided is valid and is present.

407 Proxy Authentication Required AVX_GW_011 Session validation failed, reason - Session information is missing.

Remediation: Ensure the headers are correctly mentioned with correct authentication information.

500 Internal Server Error MSG_DISC_DISCOVERY_NAME_NULLOREMPTY Discovery name: Null or Empty.

Remediation: Ensure the discoveryName parameter is not empty or null in the payload/query param.

Sample Request/Response

Request Payload
{
   "searchTextValue": "",
   "startIndex": 0,
   "sortColumn": "ip",
   "sortOrder": "asc",
   "name": "Test Discovery",
   "maxSize": 1
}
Response
{
   "response": {
       "search": null,
       "totalRecords": 245,
       "data": [
           {
               "ip": "192.168.145.105",
               "hostname": "pfiu-sdet-f5-n1.lab.appviewx.net",
               "latency": "0.0017s",
               "networkDistance": "3 hops",
               "scanTime": "14.29 seconds",
               "deviceType": "load balancer",
               "discoveryId": "685564cda69dcc148066cfef",
               "batchNumber": 2,
               "port": "443",
               "vendor": "F5, Apache",
               "os": "Linux 4.0 - 4.4",
               "version": "Apache httpd (F5 BIG-IP load balancer)",
               "_id": "192.168.145.105#443#685564cda69dcc148066cfef"
           }
       ],
       "autoSuggest": null,
       "executionTime": 1750675007,
       "iTotalDisplayRecords": 245
   },
   "message": null,
   "appStatusCode": null,
   "tags": {},
   "headers": null
}

References

Understanding the sample URL
  • IP/HostName/TenantName: Replace with the actual IP address, hostname, or tenant name based on the specific configuration in AppViewX.
    • IP: A unique identifier assigned to each device connected to a computer network that uses the Internet Protocol for communication

      The IP address will be included in the endpoint URL for an on-prem deployment.

    • HostName: A human-readable label assigned to a device (host) on a network

      The hostname will be included in the endpoint URL for an on-prem deployment.

    • TenantName: An identifier label for a tenant given to indicate which tenant's data the API request will access/modify

      The tenant name will be included in the endpoint URL for a SaaS deployment.

  • GWPORT: AppViewX gateway port

    A gateway port refers to a network port through which data is sent and received to communicate with a gateway in an on-prem deployment.

    Example: 31443

  • avxapi: Path parameter value (static) that is part of the endpoint's URL
  • Endpoint: Endpoint of the API, for example: execute-hook
  • gwsource: Source or origin of a gateway, for example: external.