meraki/rest/alerts

Create a Meraki REST API wrapper for the alert settings ressource. See the online documentation for more information.

Source:
Example
const apiKey = 'secret meraki api key'
const organizationId = 'meraki organization id'
const version = 'v0'
const target = 'n12'
const basePath = `/${target}/${version}/alertSettings`
const rateLimiter = {
 enabled: true
}
const alertSettingsEndpoints = require('./lib/rest/alerts')({ apiKey, target, basePath, baseUrl, rateLimiter, logger })
Parameters:
Name Type Attributes Default Description
apiKey string <optional>
''

The Meraki api key

target string <optional>
'api'

The Meraki target

basePath string <optional>
'/'

The Meraki base path for the ressource

baseUrl string <optional>
'https://api.meraki.com'

The Meraki base url for the ressource

rateLimiter string

The rate limiter (bottleneck) configuration

Returns:

The initialized Meraki REST API wrapper for the alert settings ressource

Type
Object

Methods

(static) getAlertSettings(apiKeyopt, targetopt, scopeopt, networkId) → {Promise}

Source:

Return the alert settings for this network.

Example

Example response

{
  "defaultDestinations": {
    "emails": [
      "miles@meraki.com"
    ],
    "allAdmins": true,
    "snmp": true,
    "httpServerIds": ["asdfasfasdfasfasdfasdfasf"]
  },
  "alerts": [
    {
      "type": "gatewayDown",
      "enabled": true,
      "alertDestinations": {
        "emails": [
          "miles@meraki.com"
        ],
        "allAdmins": false,
        "snmp": false
      },
      "filters": {
        "timeout": 60
      }
    }
  ]
}
Parameters:
Name Type Attributes Description
apiKey string <optional>

Optional custom apiKey for this request (if not set will take the inital apiKey)

target string <optional>

Optional custom target for this request (if not set will take the inital target)

scope string <optional>

Optional custom scope for rate limiter

networkId string

The id of the network

Returns:

A promise holding the alert settings of this network

Type
Promise

(static) updateAlertSettings(apiKeyopt, targetopt, scopeopt, networkId, defaultDestinations, alerts) → {Promise}

Source:

Update alert settings for this network.

Examples

Example request data

curl -L -H 'X-Cisco-Meraki-API-Key: <key>' -H 'Content-Type: application/json' -X PUT --data-binary '{"defaultDestinations":{"emails":["miles@meraki.com"],"allAdmins":true,"snmp":true},"alerts":[{"type":"gatewayDown","enabled":true,"alertDestinations":{"emails":["miles@meraki.com"],"allAdmins":false,"snmp":false},"filters":{"timeout":60}}]}' 'https://api.meraki.com/api/v0/networks/[networkId]/alertSettings'

Example response

{
  "defaultDestinations": {
    "emails": [
      "miles@meraki.com"
    ],
    "allAdmins": true,
    "snmp": true
    "httpServerIds": ["asdfasfasdfasfasdfasdfasf"]
  },
  "alerts": [
    {
      "type": "gatewayDown",
      "enabled": true,
      "alertDestinations": {
        "emails": [
          "miles@meraki.com"
        ],
        "allAdmins": false,
        "snmp": false
      },
      "filters": {
        "timeout": 60
      }
    }
  ]
}
Parameters:
Name Type Attributes Description
apiKey string <optional>

Optional custom apiKey for this request (if not set will take the inital apiKey)

target string <optional>

Optional custom target for this request (if not set will take the inital target)

scope string <optional>

Optional custom scope for rate limiter

networkId string

The id of the network

defaultDestinations object

The network_wide destinations for all alerts on the network.

Properties
Name Type Description
emails array

A list of emails that will recieve the alert(s).

allAdmins boolean

If true, then all network admins will receive emails.

snmp boolean

If true, then an SNMP trap will be sent if there is an SNMP trap server configured for this network.

httpServerIds array

A list of http server ids to which the alerts will be sent.

alerts array

Alert-specific configuration for each type. Only alerts that pertain to the network can be updated.

Properties
Name Type Description
type string

The type of alert

enabled boolean

A boolean depicting if the alert is turned on or off

alertDestinations object

A hash of destinations for this specific alert. Keys include: emails: A list of emails that will recieve information about the alert, allAdmins: If true, then all network admins will receive emails, and snmp: If true, then an SNMP trap will be sent if there is an SNMP trap server configured for this network.

filters object

A hash of specific configuration data for the alert. Only filters specific to the alert will be updated.

Returns:

A promise holding the updated alert settings

Type
Promise