Create a Meraki REST API wrapper for the admin ressource. See the online documentation for more information.
- Source:
Example
const apiKey = 'secret meraki api key'
const version = 'v0'
const target = 'n12'
const basePath = `/${target}/${version}/organizations`
const rateLimiter = {
enabled: true
}
const adminEndpoints = require('./lib/rest/admins')({ 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 for the admin ressource |
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 admin ressource
- Type
- Object
Methods
(static) createAdmin(apiKeyopt, targetopt, scopeopt, orgId, email, name, orgAcess, tags) → {Promise}
- Source:
Create a new dashboard administrator.
Example
Example response
{
"id":"212406",
"name":"Miles Meraki",
"email":"miles@meraki.com",
"orgAccess":"none",
"tags":[
{
"tag":"west",
"access":"read-only"
}
],
"networks":[]
}
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 |
orgId |
string | The organization id |
|
email |
string | The email of the dashboard administrator. This attribute can not be updated |
|
name |
string | The name of the dashboard administrator |
|
orgAcess |
string | The privilege of the dashboard administrator on the organization (full, read-only, none) |
|
tags |
Array | The list of tags that the dashboard administrator has privileges on |
Returns:
A promise holding the newly created dashboard administrator
- Type
- Promise
(static) deleteAdmin(apiKeyopt, targetopt, scopeopt, orgId, adminId) → {Promise}
- Source:
Revoke all access for a dashboard administrator within this organization.
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 |
orgId |
string | The organization id |
|
adminId |
string | The if of the dashboard administrator to delete |
Returns:
A promise with no data
- Type
- Promise
(static) listAdmins(apiKeyopt, targetopt, scopeopt, orgId) → {Promise}
- Source:
List the dashboard administrators in this organization.
Example
Example response
[
{
"id":"1",
"name":"Miles Meraki",
"email":"miles@meraki.com",
"orgAccess":"none",
"tags":[
{
"tag":"west",
"access":"read-only"
}
],
"networks":[
{
"id":"N_249",
"access":"full"
}
]
}
]
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 |
orgId |
string | The organization id for which to list the admins |
Returns:
A promise holding the dashboard administrators in this organization
- Type
- Promise
(static) updateAdmin(apiKeyopt, targetopt, scopeopt, orgId, adminId, email, name, orgAcess, tags) → {Promise}
- Source:
Update an administrator.
Example
Example response
{
"id":"212406",
"name":"Miles Meraki",
"email":"miles@meraki.com",
"orgAccess":"read-only",
"tags":[
{
"tag":"west",
"access":"read-only"
}
],
"networks":[]
}
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 |
orgId |
string | The organization id |
|
adminId |
string | The id of the dashboard administrator |
|
email |
string | The email of the dashboard administrator. This attribute can not be updated |
|
name |
string | The name of the dashboard administrator |
|
orgAcess |
string | The privilege of the dashboard administrator on the organization (full, read-only, none) |
|
tags |
Array | The list of tags that the dashboard administrator has privileges on |
Returns:
A promise holding the updated dashboard administrator
- Type
- Promise