Api to add condition for newrelic code example

Example: Api to add condition for newrelic

curl -X POST 'https://infra-api.newrelic.com/v2/alerts/conditions' -H 'Api-Key:NEW_RELIC_USER_KEY' -i -H 'Content-Type: application/json' -d
'{
   "data":{
      "type":"infra_metric",
      "name":"Disk Space Condition",
      "enabled":true,
      "where_clause":"(hostname LIKE '\''%cassandra%'\'')",
      "policy_id":policy_id,
      "event_type":"StorageSample",
      "select_value":"diskFreePercent",
      "comparison":"below",
      "critical_threshold":{
         "value":10,
         "duration_minutes":1,
         "time_function":"any"
      },
      "warning_threshold":{
         "value":30,
         "duration_minutes":2,
         "time_function":"any"
      }
   }
}'

Tags:

Php Example