Module: Networks
- Included in:
- DashboardAPI
- Defined in:
- lib/networks.rb
Overview
Networks section of the Meraki Dashboard API
Instance Method Summary collapse
-
#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.
-
#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
#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) = {:body => } self.make_api_call("/organizations/#{org_id}/networks", 'POST', ) end |
#delete_network(network_id) ⇒ Bool
Delete an existing Dashboard network
46 47 48 49 50 |
# File 'lib/networks.rb', line 46 def delete_network(network_id) res = self.make_api_call("/networks/#{network_id}", 'DELETE') puts res return res.code == 204 ? true : false end |
#get_auto_vpn_settings(network_id) ⇒ Hash
Get AutoVPN settings for a specific network
55 56 57 |
# File 'lib/networks.rb', line 55 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
76 77 78 79 |
# File 'lib/networks.rb', line 76 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 |
#update_auto_vpn_settings(network_id, options) ⇒ Hash
Update AutoVPN for a specific network
66 67 68 69 70 71 |
# File 'lib/networks.rb', line 66 def update_auto_vpn_settings(network_id, ) raise 'Options were not passed as a Hash' if !.is_a?(Hash) = {:body => } 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) = {:body => } self.make_api_call("/networks/#{network_id}",'PUT', ) end |