Create a Meraki REST API wrapper for the raw requests.
- Source:
Example
const apiKey = 'secret meraki api key'
const organizationId = 'meraki organization id'
const version = 'v0'
const target = 'n12'
const basePath = `/${target}/${version}`
const rateLimiter = {
enabled: true
}
const rawEndpoints = require('./lib/rest/raw')({ apiKey, target, basePath, baseUrl, rateLimiter })
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 |
rateLimiter |
string | The rate limiter (bottleneck) configuration |
||
logger |
object |
<optional> |
Logger to use if logging is enabled |
Returns:
The initialized Meraki REST API wrapper for the raw requests
- Type
- Object
Methods
(static) deleteRaw(apiKeyopt, targetopt, scopeopt, path) → {Promise}
- Source:
Call a specific meraki DELETE endpoint
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 |
path |
string | The ressource path to call |
Returns:
A promise holding the meraki api response
- Type
- Promise
(static) getRaw(apiKeyopt, targetopt, scopeopt, path, paramsopt) → {Promise}
- Source:
Call a specific meraki GET endpoint
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 |
path |
string | The ressource path to call |
|
params |
object |
<optional> |
Optional params to pass to the get request |
Returns:
A promise holding the meraki api response
- Type
- Promise
(static) postRaw(apiKeyopt, targetopt, scopeopt, path, data) → {Promise}
- Source:
Call a specific meraki POST endpoint
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 |
path |
string | The ressource path to call |
|
data |
object | The data to pass to the POST request |
Returns:
A promise holding the meraki api response
- Type
- Promise
(static) putRaw(apiKeyopt, targetopt, scopeopt, path, data) → {Promise}
- Source:
Call a specific meraki PUT endpoint
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 |
path |
string | The ressource path to call |
|
data |
object | The data to pass to the PUT request |
Returns:
A promise holding the meraki api response
- Type
- Promise