Module: SSIDs

Included in:
DashboardAPI
Defined in:
lib/ssids.rb

Overview

SSIDs section of the Meraki Dashboard API

Author:

  • Joe Letizia

Instance Method Summary collapse

Instance Method Details

#get_single_ssid(network_id, ssid_number) ⇒ Hash

Get the attributes for a single SSID

Parameters:

  • network_id (String)

    network id where the SSID you want to list is

  • ssid_number (Integer)

    the SSID number you want to change. Range is from 0-14

Returns:

  • (Hash)

    the attributes for the requested SSID



15
16
17
18
# File 'lib/ssids.rb', line 15

def get_single_ssid(network_id, ssid_number)
  raise "Please provide a valid SSID number" unless (ssid_number.is_a?(Integer) && ssid_number <= 14)
  self.make_api_call("/networks/#{network_id}/ssids/#{ssid_number}", 'GET')
end

#list_ssids_in_network(network_id) ⇒ Array

Get a list of the SSIDs and their attributes for a network

Parameters:

  • network_id (String)

    network id where the SSIDs you exists are

Returns:

  • (Array)

    an array of Hashes containing the SSID attributes



7
8
9
# File 'lib/ssids.rb', line 7

def list_ssids_in_network(network_id)
  self.make_api_call("/networks/#{network_id}/ssids", 'GET')
end

#update_single_ssid(network_id, ssid_number, options) ⇒ Hash

Update the attributes for a single SSID

Parameters:

  • network_id (String)

    network id where the SSID you want to change is

  • ssid_number (Integer)

    the SSID number you want to change. Range is from 0-14

  • options (Hash)

    hash containing the attributes to update. Can include name, enabled, authMode, encryptionMode and psk

Returns:

  • (Hash)

    the updated attributes for the SSID



25
26
27
28
29
30
31
# File 'lib/ssids.rb', line 25

def update_single_ssid(network_id, ssid_number, options)
  raise 'Options were not passed as a Hash' if !options.is_a?(Hash)
  raise "Please provide a valid SSID number" unless (ssid_number.is_a?(Integer) && ssid_number <= 14)
  

  self.make_api_call("/networks/#{network_id}/ssids/#{ssid_number}", 'PUT', options)
end