Create a Meraki REST API wrapper for the VLAN 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}/networks`
const rateLimiter = {
enabled: true
}
const vlanEndpoints = require('./lib/rest/vlans')({ apiKey, target, basePath, baseUrl, port, 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 VLAN 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 VLAN ressource
- Type
- Object
Methods
(static) createNetworkVLAN(apiKeyopt, targetopt, scopeopt, networkId, id, name, subnet, applianceIp) → {Promise}
- Source:
Add a VLAN.
Examples
Example request data
{
"id": "10",
"name": "VOIP",
"applianceIp": "192.168.10.1",
"subnet": "192.168.10.0/24"
}
Example response
{
"id": "10",
"networkId": "N_1234",
"name": "VOIP",
"applianceIp": "192.168.10.1",
"subnet": "192.168.10.0/24"
}
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 for which to list the VLANs |
|
id |
string | The VLAN ID of the new VLAN (must be between 1 and 4094) |
|
name |
string | The name of the VLAN |
|
subnet |
string | The subnet of the VLAN |
|
applianceIp |
string | The local IP of the appliance on the VLAN |
Returns:
A promise holding the newly created VLAN
- Type
- Promise
(static) deleteNetworkVLAN(apiKeyopt, targetopt, scopeopt, networkId, vlanId) → {Promise}
- Source:
Delete a VLAN from a network.
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 for which to list the VLANs |
|
vlanId |
string | The id of the VLAN to delete |
Returns:
A promise with no data
- Type
- Promise
(static) listNetworkVLANs(apiKeyopt, targetopt, scopeopt, networkId) → {Promise}
- Source:
List the VLANs for this network.
Example
Example response
[
{
"id": "10",
"networkId": "N_1234",
"name": "VOIP",
"applianceIp": "192.168.10.1",
"subnet": "192.168.10.0/24"
}
]
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 for which to list the VLANs |
Returns:
A promise holding the VLANs of this network
- Type
- Promise
(static) showNetworkVLAN(apiKeyopt, targetopt, scopeopt, networkId, vlanId) → {Promise}
- Source:
Return a VLAN.
Example
Example response
{
"id": "10",
"networkId": "N_1234",
"name": "VOIP",
"applianceIp": "192.168.10.1",
"subnet": "192.168.10.0/24"
}
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 for which to list the VLANs |
|
vlanId |
string | The id of the VLAN for which to show the details |
Returns:
A promise holding the details of this VLAN
- Type
- Promise
(static) updateNetworkVLAN(apiKeyopt, targetopt, scopeopt, networkId, vlanId, name, subnet, applianceIp, fixedIpAssignments, reservedIpRanges, vpnNatSubnet, dnsNameservers) → {Promise}
- Source:
Update a VLAN.
Examples
Example request data
{
"name": "VOIP",
"applianceIp": "192.168.10.1",
"subnet": "192.168.10.0/24",
"fixedIpAssignments": {
"13:37:de:ad:be:ef": {
"ip": "192.168.10.5",
"name": "fixed"
}
},
"reservedIpRanges": [{
"start": "192.168.10.20",
"end": "192.168.10.30",
"comment": "reserved"
}],
"dnsNameservers": "google_dns"
}
Example response
{
"id": "10",
"networkId": "N_1234",
"name": "VOIP",
"applianceIp": "192.168.10.1",
"subnet": "192.168.10.0/24"
}
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 for which to list the VLANs |
|
vlanId |
string | The id of the VLAN to update |
|
name |
string | The name of the VLAN |
|
subnet |
string | The subnet of the VLAN |
|
applianceIp |
string | The local IP of the appliance on the VLAN |
|
fixedIpAssignments |
Object | The DHCP fixed IP assignments on the VLAN |
|
reservedIpRanges |
Array | The DHCP reserved IP ranges on the VLAN |
|
vpnNatSubnet |
string | The translated VPN subnet if VPN and VPN subnet translation are enabled on the VLAN |
|
dnsNameservers |
string | The DNS nameservers used for DHCP responses, either |
Returns:
A promise holding the updated VLAN
- Type
- Promise