Page tree

Our goal is to make it as easy as possible for you to integrate Lumeta with other applications in your security stack. Toward this end, we've made the Lumeta Zone Data API  and Lumeta WADL available here on this Support site. Using these resources and the guidelines on this page, you should be able to write API calls that return the precise network data you require.  We understand, however, that at times it can be difficult to write a perfect API call. Should you have trouble, contact your solutions architect for assistance.  If at all possible, provide a precise description of the data you want to access (or post).

About Lumeta APIs

  • API queries to Lumeta are not language-specific; you can use them with Perl, Java, Ruby or any other programming language.
  • Lumeta API calls currently support both JSON and XML return formats. Examples in this section were written in Java.
  • API calls to Lumeta must be received by Lumeta over the standard, secure HTTPS port 443.

Query Variables

Every query has the following intrinsic variables:

  • query.pagesize - The number of records to return in each request
  • query.offset - Record at which to start
  • query.page - Calculates query.offset by setting it to query.page * query.pagesize
  • fmt - Can be used instead of the Accept HTTP Header to specify the desired return type of the query.  Add a semicolon and the word "pretty" after the format, to produce indented results.

Query Options  

The rules for building queries are as follows:

  • To add a filter to the query, a url parameter of "filter.<filter name>" can be added to the request.
  • To add a detail return to the query, a url parameter of "detail.<detail name>" can be added to the request.
  • To add a sort option, a url parameter of "sort.<sort name>" can be added to the request.

Basic Curl

The basic syntax of curl is as follows:

curl -s -k -u username:password https://<server>/api/rest/
OR
curl -s -k "https://<username>:<password>@<server>/api/rest"

For example, to run fetch device profiles in json format for all devices with a device type of Router, you would need to call ZoneData.getDevices with the zone.id filter set to 2, and the profile.deviceType filter set to Router and the format set to json.

The URL for that query would look like this:

/api/rest/zonedata/devices?fmt=json\;pretty&detail.SnmpAlias&filter.zone.name=Zone1

To make that call from the Unix command line using curl, enter this:  

curl -s -k -u <username>:<password> "https://<server>/api/rest/zonedata/devices?fmt=json.pretty&filter.zone.id=2&detail.Protocol&query.pagesize=20&filter.profile.deviceType=Router "

To find out which SNMP strings worked in a discovery scenario, enter this at the Unix command-line prompt:

curl -s -k -u <username>:<password> "https://<server>/api/rest/zonedata/devices?fmt=json;pretty&detail.SnmpAlias&filter.zone.name=LumetaInside"

For example: curl -s -k -u <username>:<password> "https://kenesi/api/rest/zonedata/devices?fmt=json;pretty&detail.SnmpAlias&filter.zone.name=LumetaInside"

Your output will look like this: { "@class" : "apiresponse", "status" : "SUCCESS", "method" : "ZoneData.getDevices", "version" : "2.1.3888", "total" : 520, "results" : [ { "@class" : "device", "id" : 505, "ip" : "10.2.0.2", "mac" : "00:0e:d7:1b:11:00", "active" : true, "firstObserved" : 1407436623000, "lastObserved" : 1408452667000, "snmpAliases" : [ "public" ] },

To get certificate data out of the Lumeta API, enter this at the Unix command-line prompt: 

curl -s -k -u <username>:<password> "https://kenesi/api/res/zonedata/devices?fmt=json;pretty&detail.Certificate&filter.address.ip=172.18.1.242" 

Your output will look like this:


"@class" : "apiresponse", 
"status" : "SUCCESS", 
"method" : "ZoneData.getDevices", 
"version" : "2.1.3888", 
"total" : 1, 
"results" : [ { 
"@class" : "device", 
"id" : 433, 
"ip" : "172.18.1.242", 
"mac" : "f4:ce:46:86:b1:34", 
"active" : true, 
"firstObserved" : 1407424822000, 
"lastObserved" : 1408116477000, 
"certificates" : [ { 
"startDate" : 1407879134000, 
"endDate" : 1723239134000, 
"version" : 3, 
"serial" : "00E09A52ADE12FBFD8", 
"issuer" : "EMAILADDRESS=support@lumeta.com, CN=172.18.1.242, OU=Production, O=Lumeta Corporation, L=Somerset, ST=New Jersey, C=US", 
"subject" : "EMAILADDRESS=support@lumeta.com, CN=172.18.1.242, OU=Production, O=Lumeta Corporation, L=Somerset, ST=New Jersey, C=US", 
"certificateType" : "SHA1withRSA", 
"signatureType" : "RSA(1024)" 
}, { 
"startDate" : 1407786824000, 
"endDate" : 1723146824000, 
"version" : 3, 
"serial" : "00BF9B5074FE40F727", 
"issuer" : "EMAILADDRESS=support@lumeta.com, CN=172.18.1.242, OU=Production, O=Lumeta Corporation, L=Somerset, ST=New Jersey, C=US", 
"subject" : "EMAILADDRESS=support@lumeta.com, CN=172.18.1.242, OU=Production, O=Lumeta Corporation, L=Somerset, ST=New Jersey, C=US", 
"certificateType" : "SHA1withRSA", 
"signatureType" : "RSA(1024)" 
}, { 
"startDate" : 1406217810000, 
"endDate" : 1721577810000, 
"version" : 3, 
"serial" : "00D9A1908B4378F992", 
"issuer" : "EMAILADDRESS=support@lumeta.com, CN=172.18.1.242, OU=Production, O=Lumeta Corporation, L=Somerset, ST=New Jersey, C=US", 
"subject" : "EMAILADDRESS=support@lumeta.com, CN=172.18.1.242, OU=Production, O=Lumeta Corporation, L=Somerset, ST=New Jersey, C=US", 
"certificateType" : "SHA1withRSA", 
"signatureType" : "RSA(1024)" 
} ] 
} ]




  • No labels