-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
88 lines (72 loc) · 2.93 KB
/
test.js
File metadata and controls
88 lines (72 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
var merakiapi = require('./merakiapi.js');
//Change below values to actual apikey and orgid.
// If using Webstorm then you can add apikey and orgid to the environment variables.
// example:
// apikey = '35635643643563634634'
// orgid = 12345'
apikey = process.env.apikey || '[REPLACE WITH APIKEY]';
orgid = process.env.orgid || '[REPLACE WITH ORGID]';
//The below function will return your orgid.
// merakiapi.getOrg(apikey, (data) => {
// for(i=0;i < data.length; i++){
// console.log(data[i])
// }
// //console.log(data);
// });
//
// //Example below gets the Meraki network by the name, 'Home' and then calls the inner function, 'getNetworkDevices'.
// //The network id is passed through the response object.
// merakiapi.getNetworkByName(apikey,orgid,'Home', (response) => {
// merakiapi.getNetworkDevices(apikey,response, (data) => {
// console.log(data);
// });
// });
//Example below gets the Meraki network by the name, 'Home' and then calls the inner function, 'addVlan'
//the format of addVlan is apikey, networkid, vlanid, vlanname, mxid, subnet
// merakiapi.getNetworkByName(apikey,orgid,'Home', (response) => {
// merakiapi.addVlan(apikey,response, '6', 'TestVlan2','192.168.13.1','192.168.13.0/24',(data) => {
// console.log(data);
// });
// });
// Get Network List Example
// merakiapi.getNetworkList(apikey,orgid,(response) => {
// console.log(response);
// });
// merakiapi.addNetwork(apikey,orgid, 'testnet2', 'wireless', 'test', 'America/New_York', (response) => {
// console.log(response);
// });
// Meraki getAdmins example:
// merakiapi.getAdmins(apikey,orgid, (response) => {console.log(response); });
//Add Admin example below:
// if you need to associate with tags or networks then you must format those fields as a list in brackets
// example: merakiapi.addAdmin(apikey, orgid, 'test@test.net', 'test user','full',['tag'],['full'],['network'],['full'], (response) => {}
//merakiapi.addAdmin(apikey, orgid, 'test@test.net', 'test user','full','','','','', (response) => {
// console.log(response);
//});
//query Template Example
// merakiapi.getTemplates(apikey, orgid, (response) => {
// console.log(response);
// });
// Delete Template Example
// merakiapi.delTemplate(apikey, orgid,'N_xxxxxxxxxxxxxx',(response) => {
// console.log(response);
// });
//Get VLANS Example
// merakiapi.getNetworkByName(apikey,orgid,'Home', (netid) => {
// merakiapi.getVlans(apikey, netid, (response) => {
// console.log(response);
// });
// });
//Update VLAN Example
// merakiapi.updateVlan(apikey,'L_xxxxxxxxxxxx' ,'6', 'TestVlan2','192.168.15.1','192.168.15.0/24', (response) =>
// {
// console.log(response);
// });
//Delete VLAN example
// merakiapi.delVlan(apikey, 'L_xxxxxxxxxxxx','6', (response) => {
// console.log(response);
// });
// Delete admin Example
// merakiapi.delAdmin(apikey, orgid, 'xxxxxxxxxxxxxxxx', (response) => {
// console.log(response);
// });