Different responses for network and organizations/xx/networks endpoints

Solved
daniel_abbatt
Getting noticed

Different responses for network and organizations/xx/networks endpoints

https://developer.cisco.com/meraki/api-v1/#!get-network

When I make a call to "/networks/nnn" I get the network returned with productTypes that take into account the devices on the network, i.e. with just an MX added, it has the single entry "appliance".

 

{
    "id": "N1234",
    "organizationId": "xxx",
    "name": "Net1",
    "productTypes": [
        "appliance"
    ],
    "timeZone": "Europe/Amsterdam",
    "tags": [],
    "enrollmentString": null,
    "url": "xxx",
    "notes": null,
    "configTemplateId": "CT4567",
    "isBoundToConfigTemplate": true
}

 

 

https://developer.cisco.com/meraki/api-v1/#!get-organization-networks

The same entry in "/organizations/xxx/networks" shows the productTypes for the Configuration Template that the Network is bound to. In this case it's "appliance", "switch", "wireless".

 

 

{
    "id": "N1234",
    "organizationId": "xxx",
    "name": "Net1",
    "productTypes": [
        "appliance",
        "switch",
        "wireless"
    ],
    "timeZone": "Europe/Amsterdam",
    "tags": [],
    "enrollmentString": null,
    "url": "xxx",
    "notes": null,
    "configTemplateId": "CT4567",
    "isBoundToConfigTemplate": true
}

 

 

Which is correct and/or why are they different?

1 Accepted Solution
daniel_abbatt
Getting noticed

I believe I do understand and agree with what you're saying.

That's not the issue I'm having though, can you explain why the same network retrieved via

"/networks/nnn"

comes back with different values to the same network entry in

 "/organizations/xxx/networks".

 

To be clear - this is for a Config Template (appliance, switch, wireless) and Network that were just created and bound and the MX then added to the network.

I understand the Config Template productTypes could be different from the Network productTypes at this point, but I don't understand why the same Network details retrieved from two different endpoints have different contents - this is unintuitive and so if there is a good reason then the documentation should state it, otherwise it's a bug I believe. 

View solution in original post

10 Replies 10
sungod
Kind of a big deal

It's just how the API calls behave.

 

When creating a network, dashboard says...

 

You can create a network with multiple types of Meraki hardware (Combined hardware) or a network for one type of hardware. Additionally you can create a Systems Manager network.

 

Afaik by default networks are 'combined', there's no documentation saying that the API return value includes only productTypes where one (or more) of a type is present.

 

I'd guess the latter return value is a legacy of internal structure from earlier times, as it doesn't include cameras or sensors.

 

PhilipDAth
Kind of a big deal
Kind of a big deal

I don't know for this case, but I have seen this happen when a template is created that was MX only, then some networks are created bound to it, then the template is changed to being a combined template.

 

The original networks remain as showing as MX only till they are also changed to being combined.  Any new networks created and bound are created as combined.

daniel_abbatt
Getting noticed

Thanks for the responses and I understand what you're saying. In this case I am simply querying why the networks endpoint returns a different set of productTypes to the network endpoint. The networks endpoint is returning the config template product types whereas the network endpoint is returning the actual network productType.

I can't see a reason why they would return different results so without documentation to the contrary, I'll just chalk this one up as a bug in the API response.

PhilipDAth
Kind of a big deal
Kind of a big deal

I'm not sure you have understood my explanation.  It is quite possible for a network to have a different set or productTypes to the template if the template has been upgraded at some stage to include additional product types.

daniel_abbatt
Getting noticed

I believe I do understand and agree with what you're saying.

That's not the issue I'm having though, can you explain why the same network retrieved via

"/networks/nnn"

comes back with different values to the same network entry in

 "/organizations/xxx/networks".

 

To be clear - this is for a Config Template (appliance, switch, wireless) and Network that were just created and bound and the MX then added to the network.

I understand the Config Template productTypes could be different from the Network productTypes at this point, but I don't understand why the same Network details retrieved from two different endpoints have different contents - this is unintuitive and so if there is a good reason then the documentation should state it, otherwise it's a bug I believe. 

John_on_API
Meraki Employee
Meraki Employee

You might want to raise this with support. I am not sure, but I think I understand the inconsistency, and this might not be expected.

Daniel___
Conversationalist

Was this raised with support?

I see the same issue, where I setup a combined network in the dashboard. When I make an API call to "/organizations/xxx/networks"

'productTypes': ['appliance', 'camera', 'cellularGateway', 'sensor', 'switch', 'wireless']

 

But if I make a call to "/networks/nnn" for that same network, I get

'productTypes': ['appliance']

 

I believe the call to /networks/nnn is returning incorrect data.

daniel_abbatt
Getting noticed

Is the network you created bound to a Configuration Template or is it unbound?

It seems strange that the same definition for an unbound network should come back with different values.

I kind of expect the network to return just "appliance" if it only has an appliance in it as that reflects the types of products actually present.

Daniel___
Conversationalist

No, I don't have any bound configuration templates, but after a bit more testing, it appears to affect networks that have been manually 'combined'.

 

To reproduce, in the Meraki dashboard,
- go to Networks -> "Create a new network"

- add a "Network Name"

- "Network Type" choose wireless

- "Network Configuration" leave at "Default Meraki Configuration"

- Hit the "Create Network" button

 

Repeat the above steps, but choose a different network type, eg. EMM systems manager.

Next, in the dashboard, go to "View all networks"

Select the two new networks and combine them by hitting the "Combine" button.

 

Now, making to an API call to organizations/[org-id]/networks returns the combined network with

'productTypes: ['systemsManager', 'wireless']

 

If you use /networks/[net-id] API call directly on the network, it returns just 'productTypes: ['systemsManager']

Daniel___
Conversationalist

Note, I just tried the same test with 'appliance' and 'wireless' and it works as expected. Both the organizations/[org-id]/networks and /networks/[net-id], return the correct productTypes list. 

Maybe it is something to do with systemsManager? Although the original post didn't have systemsManager set.

Get notified when there are additional replies to this discussion.