Hi,
I think this is a bit different. In this case put is used to change a port mode to tag/untagg for e.g. This can be done in following way:
vlan_port = { "port_id": "21", "port_mode" : "POM_TAGGED_STATIC"}
r3 = requests.put('http://192.168.100.1/rest/v1/vlans-ports/1-21', data = json.dumps(vlan_port))
vlan_port = { "port_id": "21", "port_mode" : "POM_UNTAGGED"}
r3 = requests.put('http://192.168.100.1/rest/v1/vlans-ports/1-21', data = json.dumps(vlan_port))
But if you want to add port in certain vlan you need to use post:
vlan_port1 = { "vlan_id": 10, "port_id": "20", "port_mode" : "POM_UNTAGGED"}
r4 = requests.post('http://192.168.100.1/rest/v1/vlans-ports', data = json.dumps(vlan_port1))
vlan_port1 = { "vlan_id": 70, "port_id": "21", "port_mode" : "POM_TAGGED_STATIC"}
r4 = requests.post('http://192.168.100.1/rest/v1/vlans-ports', data = json.dumps(vlan_port1))
Hope this will help you!
Regards, Dobias