Hello ,
Has anyone seen an issue when creating vlan profiles using API ?
Im trying to add a new vlan profile into an existing network, here is what im trying :
post" https://api.meraki.com/api/v1/networks/:networkId/vlanProfiles"
I think it's not a issue, it's just the order that you have to do the things.
I think you need to remove ""isDefault": true," as this is not part of the request body.
I think @rhbirkelund has cracked it. You could also try copying the code snippet in the documentation (on the right) and then start modifying it to be what you want.
https://developer.cisco.com/meraki/api-v1/create-network-vlan-profile/
I tried this but still getting the same results
I just tried it still getting the same results
I think what you need to do is to first add them to the default VLAN Profile. Afterwards you can create your own VLAN Profile "StandardVlan" with the VLANs.
That is.
#!/usr/bin/env python3
import meraki
def main():
dashboard = meraki.DashboardAPI()
network_id = "..."
# Update Defalt
iname = 'Default'
name = 'Default Profile'
vlan_names = [
{
'name': 'CORP',
'vlanId': '17'
},
{
'name': 'AV',
'vlanId': '11'
},
{
'name': 'MGMNT',
'vlanId': '10'
}
]
vlan_groups = [
{
'name': 'WW-TRUNK',
'vlanIds': '10,11,17'
}
]
response = dashboard.networks.updateNetworkVlanProfile(
network_id, iname, name, vlan_names, vlan_groups
)
print(response)
# Create custom VLAN Profile
iname = 'StandardVlan'
name = 'My Standard Vlan'
vlan_names = [
{
'name': 'CORP',
'vlanId': '17'
},
{
'name': 'AV',
'vlanId': '11'
},
{
'name': 'MGMNT',
'vlanId': '10'
}
]
vlan_groups = [
{
'name': 'WW-TRUNK',
'vlanIds': '10,11,17'
}
]
response = dashboard.networks.createNetworkVlanProfile(
network_id, name, vlan_names, vlan_groups, iname
)
if __name__ == "__main__":
main()
Thanks yeah if i add the vlans to the default profile it works, my question is why do i need to do this, makes no sense to me having to update a default profile in order to create mine but i assume thats how meraki works. 🙃