SolarWinds Backup Help

Enumerating Device Statistics in JSON-RPC API

You can get the statistics of devices of your own company and your customers using the EnumerateAccountStatistics method.

A common use of this method is to output a list of storage space used on the cloud per device. You can get this information by using the Columns parameter and using the column US.

Please be aware that there are no methods which can perform complex calculations, however the Totals parameter can do basic calculations using column codes. If you need to do complex calculations, you will have to take the given sizes (in Bytes) and do these manually.

Required parameters

Parameter Description Supported values
query A group of parameters related to the device statistics AccountStatisticsQuery (see below table for child parameters)

AccountStatisticsQuery child parameters

Parameter Description Supported values
PartnerId

The ID of the customer the device is created for (retrieved through the GetPartnerInfo method)

Int
Filter Apply a search parameter using regularExpression String
ExcludedPartners A list of partner ID's to exclude from the search ID set
StartRecordNumber Which device number to start the output from Int (in mebibytes)
RecordsCount How many devices to display Int (in mebibytes)
Columns Which column vectors you wish to display in the response. ColumnVector set
Totals

An array of totals represented as strings, will return totalStatistics.

For Example: ["SUM(US)","COUNT(AT==2"],

This will return totalStatistics with the sum of used storage for the selected partner and filter and also a count of Cloud2Cloud devices

  • SUM
  • COUNT
  • MAX
  • MIN

Sample request

{
    "jsonrpc":"2.0",
    "visa": "33491-50121-1-1512736778-A99E8BAC8AC82XXXXX0000000XXXXXXXXXXXX00000",
    "id":"jsonrpc",
    "method" : "EnumerateAccountStatistics",
    "params" : {
	"query" : {
		"PartnerId" : 123456,
		"Filter": "ANY =~ 'Device*'",
		"SelectionMode": "Merged",
		"StartRecordNumber": 0,
		"RecordsCount": 10,
		"Columns": ["AR","AN", "MN"],
		"Totals" : ["SUM(US)"]
	}
    }			
}

Sample response

{
    "id": "jsonrpc",
    "jsonrpc": "2.0",
    "result": {
	"result": [
	{
	    "AccountId": 654321,
	    "Flags": null,
	    "PartnerId": 123456,
	    "Settings": [
		{"AN": "Device1"},
		{"AR": "DistributorCustomer"},
		{"MN": "ComputerName1"}
		]
	    },
	    {
	    "AccountId": 765432,
	    "Flags": null,
	    "PartnerId": 456789,
	    "Settings": [
		{"AN": "Device2"},
		{"AR": "ResellerCustomer1"},
		{"MN": "ComputerName2"}
		]
	    },
	    {
	    "AccountId": 876543,
	    "Flags": null,
	    "PartnerId": 456789,
	    "Settings": [
		{"AN": "Device3"},
		{"AR": "ResellerCustomer1"},
		{"MN": "ComputerName3"}
		]
	    },
	    {
	    "AccountId": 987654,
	    "Flags": null,
	    "PartnerId": 345678,
	    "Settings": [
		{"AN": "Device4"},
		{"AR": "End-UserCustomer1"},
		{"MN": "ComputerName4"}
		]
	    },
	    {
	    "AccountId": 098765,
	    "Flags": null,
	    "PartnerId": 345678,
	    "Settings": [
		{"AN": "Device5"},
		{"AR": "End-UserCustomer1"},
		{"MN": "ComputerName5"}
		]
	    }
	    ],
	    "totalStatistics": [
		{
		    "SUM(US)": "305359417566"
		}
	    ]
    },
    "visa": "33491-50121-1-1512736778-A99E8BAC8AC82XXXXX0000000XXXXXXXXXXXX00000"
}