Module: Networks
- Included in:
- DashboardAPI
- Defined in:
- lib/networks.rb
Overview
Networks section of the Meraki Dashboard API
Instance Method Summary collapse
-
#bind_network_to_template(network_id, options) ⇒ Integer
Bind a single network to a configuration template.
-
#create_network(org_id, options) ⇒ Hash
Create a new Dashboard network.
-
#delete_network(network_id) ⇒ Bool
Delete an existing Dashboard network.
-
#get_auto_vpn_settings(network_id) ⇒ Hash
Get AutoVPN settings for a specific network.
-
#get_ms_access_policies(network_id) ⇒ Array
Get all MS access policies configured for a specific Dashboard network.
-
#get_networks(org_id) ⇒ Array
Returns the list of networks for a given organization.
-
#get_single_network(network_id) ⇒ Hash
Returns the network details for a single network.
-
#traffic_analysis(network_id, options) ⇒ Object
Return traffic analysis data for a network.
-
#unbind_network_to_template(network_id) ⇒ Integer
Unbind a single network from a configuration template.
-
#update_auto_vpn_settings(network_id, options) ⇒ Hash
Update AutoVPN for a specific network.
-
#update_network(network_id, options) ⇒ Hash
Updates a network’s details.
Instance Method Details
#bind_network_to_template(network_id, options) ⇒ Integer
Bind a single network to a configuration template
85 86 87 88 89 90 |
# File 'lib/networks.rb', line 85 def bind_network_to_template(network_id, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) self.make_api_call("/networks/#{network_id}/bind", 'POST', ) end |
#create_network(org_id, options) ⇒ Hash
Create a new Dashboard network
37 38 39 40 41 |
# File 'lib/networks.rb', line 37 def create_network(org_id, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) self.make_api_call("/organizations/#{org_id}/networks", 'POST', ) end |
#delete_network(network_id) ⇒ Bool
Delete an existing Dashboard network
46 47 48 49 |
# File 'lib/networks.rb', line 46 def delete_network(network_id) res = self.make_api_call("/networks/#{network_id}", 'DELETE') return res.code == 204 ? true : false end |
#get_auto_vpn_settings(network_id) ⇒ Hash
Get AutoVPN settings for a specific network
54 55 56 |
# File 'lib/networks.rb', line 54 def get_auto_vpn_settings(network_id) res = self.make_api_call("/networks/#{network_id}/siteToSiteVpn", 'GET') end |
#get_ms_access_policies(network_id) ⇒ Array
Get all MS access policies configured for a specific Dashboard network
75 76 77 78 |
# File 'lib/networks.rb', line 75 def get_ms_access_policies(network_id) res = self.make_api_call("/networks/#{network_id}/accessPolicies", 'GET') return res end |
#get_networks(org_id) ⇒ Array
Returns the list of networks for a given organization
7 8 9 |
# File 'lib/networks.rb', line 7 def get_networks(org_id) self.make_api_call("/organizations/#{org_id}/networks", 'GET') end |
#get_single_network(network_id) ⇒ Hash
Returns the network details for a single network
14 15 16 |
# File 'lib/networks.rb', line 14 def get_single_network(network_id) self.make_api_call("/networks/#{network_id}", 'GET') end |
#traffic_analysis(network_id, options) ⇒ Object
Return traffic analysis data for a network
103 104 105 106 107 |
# File 'lib/networks.rb', line 103 def traffic_analysis(network_id, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) self.make_api_call("/networks/#{network_id}/traffic", 'GET', ) end |
#unbind_network_to_template(network_id) ⇒ Integer
Unbind a single network from a configuration template
95 96 97 |
# File 'lib/networks.rb', line 95 def unbind_network_to_template(network_id) self.make_api_call("/networks/#{network_id}/unbind", 'POST') end |
#update_auto_vpn_settings(network_id, options) ⇒ Hash
Update AutoVPN for a specific network
65 66 67 68 69 70 |
# File 'lib/networks.rb', line 65 def update_auto_vpn_settings(network_id, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) res = self.make_api_call("/networks/#{network_id}/siteToSiteVpn", 'PUT', ) end |
#update_network(network_id, options) ⇒ Hash
Updates a network’s details
24 25 26 27 28 |
# File 'lib/networks.rb', line 24 def update_network(network_id, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) self.make_api_call("/networks/#{network_id}",'PUT', ) end |