Getorganizationdevices not filtering by network id

primeria24
Just browsing

Getorganizationdevices not filtering by network id

Hi, 

im Trying to filter devices out of the org based on a network id but the output keeps printing the whole org. i have tried different variations to see if it will filter but i cant get it to work. has anyone else experienced this? i can get the devices of the network when i run it through postman but when i use the meraki python sdk it outputs the whole org instead of devices from the network id. 

 

i have tried:

network_ids = ['**********']  
org_id = "**************"

try:
response = dashboard.organizations.getOrganizationDevices(
org_id,
params={
'networkIds[]': [network_ids],
}
)
print(response)
except ValueError as ve:
print(f"Value Error: {ve}")

 

network_ids = '**********'
org_id = "**************"

try:
response = dashboard.organizations.getOrganizationDevices(
org_id,
params={
'networkIds[]': [network_ids],
}
)
print(response)
except ValueError as ve:
print(f"Value Error: {ve}")

----------------------------------------------------------------------------------------

network_ids = ['**********']
org_id = "**************"

try:
response = dashboard.organizations.getOrganizationDevices(
org_id,network_ids
)
print(response)
except ValueError as ve:
print(f"Value Error: {ve}")

--------------------------------------------------------------------------------------

network_ids = ['**********']
org_id = "**************"

try:
response = dashboard.organizations.getOrganizationDevices(
org_id,
params={
'networkIds': [network_ids],
}
)
print(response)
except ValueError as ve:
print(f"Value Error: {ve}")

-----------------------------------------------------------------------------------------------

network_ids = ['**********']
org_id = "**************"

try:
response = dashboard.organizations.getOrganizationDevices(
org_id,network_id
)
print(response)
except ValueError as ve:
print(f"Value Error: {ve}")

 

 

Any suggestions appreciated.

2 Replies 2
MartinLL
Building a reputation

Try to create the query variable before you pass it in the requests function.

 

Like this for example. 

 

params = {'networkID': '12345'}

 

Then

response = dashboard.organizations.getOrganizationDevices(params=params)

 

MLL
sungod
Kind of a big deal

networkIds is keyword argument, try...

 

response = dashboard.organizations.getOrganizationDevices(
org_id, networkIds=['id1'])

 

Get notified when there are additional replies to this discussion.