VMware Smart Assurance SMARTS: How to add a device to Pending list & invoke Pending discovery via EDAA?
search cancel

VMware Smart Assurance SMARTS: How to add a device to Pending list & invoke Pending discovery via EDAA?

book

Article ID: 345339

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:
This article covers the sample to add a device to Pending List and then invoke the pending discovery on Smarts AMPM domain via EDAA.

Environment

VMware Smart Assurance - SMARTS

Resolution

The AddPending and DiscoverPending requires the following payload data appended to the HTTP POST request :

addPending
<void> addPending <string>nameOrAddr <string>community <string>description <string>snmpSource <string>snmpState <unsigned short>snmpPort <string>accessMode <string>accessAddressFormat <string>seedName <string>nameFormat <string>snmpVersionStr <string>user <string>engineID <string>authProtocol <string>privProtocol <string>authPass <string>privPass <string>context <boolean>encryptedPassword <string>displayName <string>systemType <string>domainName <string>sourceAddress <string>refreshType

discoverPending
<void> discoverPending <string>refreshType

 

Create the XML payload similar to the following:

$data1 = $data1 . "\<\?xml version=\"1.0\" encoding=\"UTF-8\"\?\>\n";
$data1 = $data1 . "\<arguments\> \n \<nameOrAddr\> Enter Device IP/FQDN here \</nameOrAddr\> \n \<community\> Enter Community String Here \</community\> \n \<description\> Enter Description Here \</description\> \n</arguments\>\n";

 

Once the payload is ready, add the payload to the HTTP post. Following is a perl sample of the same :

# Create the request URLs

my $server_endpoint1 = "http://<Tomcat IPAddr>:<Port>/smarts-edaa/msa/<INCHARGE-AM-PM Domain>/instances/ICF_TopologyManager::ICF-TopologyManager/action/addPending";
my $server_endpoint2 = "http://<Tomcat IPAddr>:<Port>/smarts-edaa/msa/<INCHARGE-AM-PM Domain>/instances/ICF_TopologyManager::ICF-TopologyManager/action/discoverPending";

Edit/enter the bold highlighted fields as per environment.

 

# Add request details like the type and the payload data onto the request

my $request1 = HTTP::Request->new(POST => $server_endpoint1);
$request1->header('content-type' => 'application/xml');
$request1->content($data1);

my $request2 = HTTP::Request->new(POST => $server_endpoint2);

 

#Send the request to AddPending and then discover pending

my $response1 = $ua->request($request1);
my $response2 = $ua->request($request2);

 

A curl representation of the above is as follows:

  • Export the XML to a data variable using the following command:
export DATA="<arguments> <nameOrAddr> Enter Device IP/FQDN here </nameOrAddr> <community> Enter Community String Here </community> <description> Enter Description Here </description> </arguments>"

 

  • Create a curl request to invoke addPending. Edit/enter the bold highlighted fields as per environment.
curl  -H "Content-Type: application/xml" -d "$DATA" http://<Tomcat IPAddr>:<Port>/smarts-edaa/msa/<INCHARGE-AM-PM Domain>/instances/ICF_TopologyManager::ICF-TopologyManager/action/addPending

 

  • Create a curl request to initiate discoverPending. Edit/enter the bold highlighted fields as per environment.
curl http://<Tomcat IPAddr>:<Port>/smarts-edaa/msa/<INCHARGE-AM-PM Domain>/instances/ICF_TopologyManager::ICF-TopologyManager/action/discoverPending