dashboard-api 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/doc/Clients.html +32 -5
- data/doc/DashboardAPI.html +26 -15
- data/doc/DashboardAPIVersion.html +41 -3
- data/doc/Devices.html +53 -26
- data/doc/Networks.html +1 -1
- data/doc/Organizations.html +1 -1
- data/doc/SSIDs.html +40 -13
- data/doc/Switchports.html +527 -0
- data/doc/_index.html +6 -1
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +4 -3
- data/doc/index.html +4 -3
- data/doc/method_list.html +24 -0
- data/doc/top-level-namespace.html +2 -2
- data/lib/clients.rb +2 -0
- data/lib/dashboard-api.rb +3 -0
- data/lib/dashboard-api/version.rb +4 -1
- data/lib/devices.rb +3 -1
- data/lib/ssids.rb +2 -0
- data/lib/switchports.rb +33 -0
- metadata +3 -1
data/doc/_index.html
CHANGED
@@ -149,6 +149,11 @@
|
|
149
149
|
|
150
150
|
</li>
|
151
151
|
|
152
|
+
<li>
|
153
|
+
<span class='object_link'><a href="Switchports.html" title="Switchports (module)">Switchports</a></span>
|
154
|
+
|
155
|
+
</li>
|
156
|
+
|
152
157
|
</ul>
|
153
158
|
</ul>
|
154
159
|
|
@@ -161,7 +166,7 @@
|
|
161
166
|
</div>
|
162
167
|
|
163
168
|
<div id="footer">
|
164
|
-
Generated on Tue Nov 15
|
169
|
+
Generated on Tue Nov 15 22:02:44 2016 by
|
165
170
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
166
171
|
0.9.5 (ruby-2.3.0).
|
167
172
|
</div>
|
data/doc/class_list.html
CHANGED
@@ -43,7 +43,7 @@
|
|
43
43
|
|
44
44
|
<ul id="full_list" class="class">
|
45
45
|
<li id="object_" class="odd"><div class="item" style="padding-left:30px"><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></div></li>
|
46
|
-
<li id='object_Clients' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Clients.html" title="Clients (module)">Clients</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_DashboardAPI' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="DashboardAPI.html" title="DashboardAPI (class)">DashboardAPI</a></span> < Object<small class='search_info'>Top Level Namespace</small></div></li><li id='object_DashboardAPIVersion' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="DashboardAPIVersion.html" title="DashboardAPIVersion (module)">DashboardAPIVersion</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_Devices' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Devices.html" title="Devices (module)">Devices</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_Networks' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Networks.html" title="Networks (module)">Networks</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_Organizations' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Organizations.html" title="Organizations (module)">Organizations</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_SSIDs' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="SSIDs.html" title="SSIDs (module)">SSIDs</a></span><small class='search_info'>Top Level Namespace</small></div></li>
|
46
|
+
<li id='object_Clients' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Clients.html" title="Clients (module)">Clients</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_DashboardAPI' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="DashboardAPI.html" title="DashboardAPI (class)">DashboardAPI</a></span> < Object<small class='search_info'>Top Level Namespace</small></div></li><li id='object_DashboardAPIVersion' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="DashboardAPIVersion.html" title="DashboardAPIVersion (module)">DashboardAPIVersion</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_Devices' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Devices.html" title="Devices (module)">Devices</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_Networks' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Networks.html" title="Networks (module)">Networks</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_Organizations' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Organizations.html" title="Organizations (module)">Organizations</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_SSIDs' class='even'><div class='item' style='padding-left:30px'><span class='object_link'><a href="SSIDs.html" title="SSIDs (module)">SSIDs</a></span><small class='search_info'>Top Level Namespace</small></div></li><li id='object_Switchports' class='odd'><div class='item' style='padding-left:30px'><span class='object_link'><a href="Switchports.html" title="Switchports (module)">Switchports</a></span><small class='search_info'>Top Level Namespace</small></div></li>
|
47
47
|
|
48
48
|
</ul>
|
49
49
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -60,13 +60,14 @@
|
|
60
60
|
<iframe id="search_frame" src="file_list.html"></iframe>
|
61
61
|
|
62
62
|
<div id="content"><div id='filecontents'>
|
63
|
-
<h1 id="label-Dashboard+API+v0.
|
63
|
+
<h1 id="label-Dashboard+API+v0.3.0">Dashboard API v0.3.0</h1>
|
64
64
|
|
65
65
|
<p>A ruby implementation of the <a
|
66
66
|
href="https://documentation.meraki.com/zGeneral_Administration/Other_Topics/The_Cisco_Meraki_Dashboard_API">Meraki
|
67
67
|
Dashboard API</a></p>
|
68
68
|
|
69
|
-
<p>Documentation <a
|
69
|
+
<p>Documentation <a
|
70
|
+
href="http://www.rubydoc.info/gems/dashboard-api/0.3.0">here</a></p>
|
70
71
|
|
71
72
|
<h1 id="label-Preface">Preface</h1>
|
72
73
|
|
@@ -200,7 +201,7 @@ set as ENV variables above.</p>
|
|
200
201
|
</div></div>
|
201
202
|
|
202
203
|
<div id="footer">
|
203
|
-
Generated on Tue Nov 15
|
204
|
+
Generated on Tue Nov 15 22:02:45 2016 by
|
204
205
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
205
206
|
0.9.5 (ruby-2.3.0).
|
206
207
|
</div>
|
data/doc/index.html
CHANGED
@@ -60,13 +60,14 @@
|
|
60
60
|
<iframe id="search_frame" src="class_list.html"></iframe>
|
61
61
|
|
62
62
|
<div id="content"><div id='filecontents'>
|
63
|
-
<h1 id="label-Dashboard+API+v0.
|
63
|
+
<h1 id="label-Dashboard+API+v0.3.0">Dashboard API v0.3.0</h1>
|
64
64
|
|
65
65
|
<p>A ruby implementation of the <a
|
66
66
|
href="https://documentation.meraki.com/zGeneral_Administration/Other_Topics/The_Cisco_Meraki_Dashboard_API">Meraki
|
67
67
|
Dashboard API</a></p>
|
68
68
|
|
69
|
-
<p>Documentation <a
|
69
|
+
<p>Documentation <a
|
70
|
+
href="http://www.rubydoc.info/gems/dashboard-api/0.3.0">here</a></p>
|
70
71
|
|
71
72
|
<h1 id="label-Preface">Preface</h1>
|
72
73
|
|
@@ -200,7 +201,7 @@ set as ENV variables above.</p>
|
|
200
201
|
</div></div>
|
201
202
|
|
202
203
|
<div id="footer">
|
203
|
-
Generated on Tue Nov 15
|
204
|
+
Generated on Tue Nov 15 22:02:45 2016 by
|
204
205
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
205
206
|
0.9.5 (ruby-2.3.0).
|
206
207
|
</div>
|
data/doc/method_list.html
CHANGED
@@ -157,6 +157,14 @@
|
|
157
157
|
|
158
158
|
|
159
159
|
<li class="odd ">
|
160
|
+
<div class="item">
|
161
|
+
<span class='object_link'><a href="Switchports.html#get_single_switch_port-instance_method" title="Switchports#get_single_switch_port (method)">#get_single_switch_port</a></span>
|
162
|
+
<small>Switchports</small>
|
163
|
+
</div>
|
164
|
+
</li>
|
165
|
+
|
166
|
+
|
167
|
+
<li class="even ">
|
160
168
|
<div class="item">
|
161
169
|
<span class='object_link'><a href="Organizations.html#get_snmp_status-instance_method" title="Organizations#get_snmp_status (method)">#get_snmp_status</a></span>
|
162
170
|
<small>Organizations</small>
|
@@ -164,6 +172,14 @@
|
|
164
172
|
</li>
|
165
173
|
|
166
174
|
|
175
|
+
<li class="odd ">
|
176
|
+
<div class="item">
|
177
|
+
<span class='object_link'><a href="Switchports.html#get_switch_ports-instance_method" title="Switchports#get_switch_ports (method)">#get_switch_ports</a></span>
|
178
|
+
<small>Switchports</small>
|
179
|
+
</div>
|
180
|
+
</li>
|
181
|
+
|
182
|
+
|
167
183
|
<li class="even ">
|
168
184
|
<div class="item">
|
169
185
|
<span class='object_link'><a href="Organizations.html#get_third_party_peers-instance_method" title="Organizations#get_third_party_peers (method)">#get_third_party_peers</a></span>
|
@@ -252,6 +268,14 @@
|
|
252
268
|
</li>
|
253
269
|
|
254
270
|
|
271
|
+
<li class="odd ">
|
272
|
+
<div class="item">
|
273
|
+
<span class='object_link'><a href="Switchports.html#update_switchport-instance_method" title="Switchports#update_switchport (method)">#update_switchport</a></span>
|
274
|
+
<small>Switchports</small>
|
275
|
+
</div>
|
276
|
+
</li>
|
277
|
+
|
278
|
+
|
255
279
|
|
256
280
|
</ul>
|
257
281
|
</div>
|
@@ -84,7 +84,7 @@
|
|
84
84
|
<p class="children">
|
85
85
|
|
86
86
|
|
87
|
-
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Clients.html" title="Clients (module)">Clients</a></span>, <span class='object_link'><a href="DashboardAPIVersion.html" title="DashboardAPIVersion (module)">DashboardAPIVersion</a></span>, <span class='object_link'><a href="Devices.html" title="Devices (module)">Devices</a></span>, <span class='object_link'><a href="Networks.html" title="Networks (module)">Networks</a></span>, <span class='object_link'><a href="Organizations.html" title="Organizations (module)">Organizations</a></span>, <span class='object_link'><a href="SSIDs.html" title="SSIDs (module)">SSIDs</a></span>
|
87
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Clients.html" title="Clients (module)">Clients</a></span>, <span class='object_link'><a href="DashboardAPIVersion.html" title="DashboardAPIVersion (module)">DashboardAPIVersion</a></span>, <span class='object_link'><a href="Devices.html" title="Devices (module)">Devices</a></span>, <span class='object_link'><a href="Networks.html" title="Networks (module)">Networks</a></span>, <span class='object_link'><a href="Organizations.html" title="Organizations (module)">Organizations</a></span>, <span class='object_link'><a href="SSIDs.html" title="SSIDs (module)">SSIDs</a></span>, <span class='object_link'><a href="Switchports.html" title="Switchports (module)">Switchports</a></span>
|
88
88
|
|
89
89
|
|
90
90
|
|
@@ -104,7 +104,7 @@
|
|
104
104
|
</div>
|
105
105
|
|
106
106
|
<div id="footer">
|
107
|
-
Generated on Tue Nov 15
|
107
|
+
Generated on Tue Nov 15 22:02:45 2016 by
|
108
108
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
109
109
|
0.9.5 (ruby-2.3.0).
|
110
110
|
</div>
|
data/lib/clients.rb
CHANGED
data/lib/dashboard-api.rb
CHANGED
@@ -6,6 +6,8 @@ require 'networks'
|
|
6
6
|
require 'devices'
|
7
7
|
require 'clients'
|
8
8
|
require 'ssids'
|
9
|
+
require 'switchports'
|
10
|
+
|
9
11
|
# Ruby Implementation of the Meraki Dashboard api
|
10
12
|
# @author Joe Letizia
|
11
13
|
class DashboardAPI
|
@@ -16,6 +18,7 @@ class DashboardAPI
|
|
16
18
|
include Clients
|
17
19
|
include Devices
|
18
20
|
include SSIDs
|
21
|
+
include Switchports
|
19
22
|
base_uri "https://dashboard.meraki.com/api/v0"
|
20
23
|
|
21
24
|
attr_reader :key
|
data/lib/devices.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# Devices section of the Meraki Dashboard API
|
2
|
+
# @author Joe Letizia
|
1
3
|
module Devices
|
2
4
|
# List all devices in a given network
|
3
5
|
# @param [String] network_id network that you want to get devices for
|
@@ -47,7 +49,7 @@ module Devices
|
|
47
49
|
|
48
50
|
# Remove a single device from a network
|
49
51
|
# @param [String] network_id dashboard network id to remove device from
|
50
|
-
# @param [String]
|
52
|
+
# @param [String] device_serial meraki serial number for device to remove
|
51
53
|
# @return [Integer] http_code HTTP code for API call
|
52
54
|
def remove_device_from_network(network_id, device_serial)
|
53
55
|
self.make_api_call("/networks/#{network_id}/devices/#{device_serial}/remove", 'POST')
|
data/lib/ssids.rb
CHANGED
data/lib/switchports.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Switchports section of the Meraki Dashboard API
|
2
|
+
# @author Joe Letizia
|
3
|
+
module Switchports
|
4
|
+
# Get configuration for all switchports on a given switch
|
5
|
+
# @param [String] device_serial meraki serial number of the switch
|
6
|
+
# @return [Array] an array of Hashes, each containing the switchports attributes / configuration
|
7
|
+
def get_switch_ports(device_serial)
|
8
|
+
self.make_api_call("/devices/#{device_serial}/switchPorts", 'GET')
|
9
|
+
end
|
10
|
+
|
11
|
+
# Get configuration for a single switch port
|
12
|
+
# @param [String] device_serial meraki serial number of the switch
|
13
|
+
# @param [Integer] port_number port number you want to modify
|
14
|
+
# @return [Hash] hash of the switch ports attributes
|
15
|
+
def get_single_switch_port(device_serial, port_number)
|
16
|
+
raise 'Invalid switchport provided' unless port_number.is_a?(Integer)
|
17
|
+
self.make_api_call("/devices/#{device_serial}/switchPorts/#{port_number}", 'GET')
|
18
|
+
end
|
19
|
+
|
20
|
+
# Update the attributes for a given switchport
|
21
|
+
# @param [String] device_serial meraki serial number of the switch
|
22
|
+
# @param [Integer] port_number port number you want to modify
|
23
|
+
# @param [Hash] options hash of attributes. Keys can include name, tags, enabled, type, vlan, voiceVlan
|
24
|
+
# allowedVlans, poeEnabled, isolationEnabled, rstpEnabled, stpGuard, accessPolicyNumber. For values to these keys, please refer to the official Meraki Dashboard API documentation.
|
25
|
+
# @return [Hash] hash of the update port attributes
|
26
|
+
def update_switchport(device_serial, port_number, options)
|
27
|
+
raise 'Options were not passed as a Hash' if !options.is_a?(Hash)
|
28
|
+
raise 'Invalid switchport provided' unless port_number.is_a?(Integer)
|
29
|
+
options = {:body => options}
|
30
|
+
|
31
|
+
self.make_api_call("/devices/#{device_serial}/switchPorts/#{port_number}", 'PUT', options)
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dashboard-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Letizia
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- doc/Networks.html
|
116
116
|
- doc/Organizations.html
|
117
117
|
- doc/SSIDs.html
|
118
|
+
- doc/Switchports.html
|
118
119
|
- doc/_index.html
|
119
120
|
- doc/class_list.html
|
120
121
|
- doc/css/common.css
|
@@ -136,6 +137,7 @@ files:
|
|
136
137
|
- lib/networks.rb
|
137
138
|
- lib/organizations.rb
|
138
139
|
- lib/ssids.rb
|
140
|
+
- lib/switchports.rb
|
139
141
|
homepage: https://github.com/jletizia/dashboardapi
|
140
142
|
licenses: []
|
141
143
|
metadata: {}
|