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
|
||||||||||||||||
alerts |
array | Alert-specific configuration for each type. Only alerts that pertain to the network can be updated. Properties
|
Returns:
A promise holding the updated alert settings
- Type
- Promise