Get MQTT broker without listing each network?

Vbardy
Here to help

Get MQTT broker without listing each network?

So far I have only been able to find options for getting the mqtt brokers that require I list each network.  Is there a way to get a list of all of the mqtt brokers currently in production in my org without having to list each network id in the script?

 

Very very new to putting python scripts together.  Any guidance here would be great.

 

Thank you.

 

Rgds,

Vicky

2 Replies 2
Oren
Meraki Employee All-Star Meraki Employee All-Star
Meraki Employee All-Star

Sounds like a classic use-case for a sprinkle of API magic.

You can choose the tool you feel most comfortable with: Python, Ansible, Terraform, or Cisco Workflows (low code/no code automation built into the Dashboard).

 

You will want to start by listing the networks in the organization, then you’ll want to iterate through the list (“for loop” if it’s Python) and make an API call to get the MQTT settings for each network ID).

ChatGPT/copilot can help - they might make mistakes in the process.

PhilipDAth
Kind of a big deal
Kind of a big deal

A rough flow would be:

 

import meraki

...

dashboard = meraki.DashboardAPI(
output_log=False,
print_console=False
)
...

for net in dashboard.organizations.getOrganizationNetworks(orgId):

  response = dashboard.networks.getNetworkMqttBrokers(net['id'])

  print(response)

 

Get notified when there are additional replies to this discussion.