TrueSight API Documentation
OverviewAccountActionsAdministration
Alarms v1Alarms v2BatchingDashboards
DatasetsEventsExtended Metrics
GroupsHostgroupsMetersMetricsProduct
PluginsRelaysSourcesSource-TagsSynchronize Data
Tenants
Terms

POST/v1/batch

Allows making an arbitrary set of API calls. All calls are made in parallel. The query string parameter ?series can be used to override this behavior and call the API in series stopping at the first error.

Pass an array containing the list of API calls to make, each item in the array is object with the following properties:

method

HTTP method

path

API path

body

API Body

Example request:

curl https://api.truesight.bmc.com/v1/batch?series \
-X POST \
-u <email>:<api-token> \
-H "Content-Type: application/json" \
-d '
[
   {
      "method": "PUT",
      "path": "/v2/alarms/899",
      "body": {
         "typeId": 3,
         "hostgroupId": 200,
         "isDisabled": false,
         "metric": "CPU",
         "name": "Hostgroup 200 CPU",
         "note": "Notify when host AVG CPU is high",
         "notifyClear": true,
         "notifySet": true,
         "perHostNotify": true,
         "timeoutInterval": 259200000,
         "triggerInterval": 60000,
         "triggerPredicate": {
            "agg": "avg",
            "op": "gt",
            "val": 0.8
         }
      }
   },
   {
      "method": "GET",
      "path": "/v1/metrics?enabled=true&custom=true"
   }
]'

The response will be an array the same length as the request with a result for each. If API are run in series then the first call to fail will stop the rest of the calls.

Example reponse:

{
   "result": [
      {
         "result": {
            "success": true
         }
      },
      {
         "result": [
            {
               "name": "MYSQL_READS",
               "type": "DEVICE",
               "defaultAggregate": "AVG",
               "defaultResolutionMS": 1000,
               "description": "The number of MySQL read operations per seconds",
               "displayName": "MySQL Read Operations",
               "displayNameShort": "mysql-reads",
               "unit": "number",
               "isDisabled": false
            }
         ]
      }
   ]
}