Forum Discussion
F5OS API - not able to create vlan
- Feb 16, 2024
Try the following;
curl -k -X PATCH -H'Content-Type: application/yang-data+json' -u admin:admin "https://192.168.10.11/api/data/openconfig-interfaces:interfaces/interface" --data @- <<EOF { "interface": [ { "name": "6.0", "openconfig-if-ethernet:ethernet": { "openconfig-vlan:switched-vlan": { "config": { "trunk-vlans": [940] } } } } ] } EOF
I know this thread hasn't had updates in a while, but I am facing a similar issue with the F5OS VLAN API call.
I can do a GET request to /api/data/openconfig-vlan:vlans and return the current configuration.
If I copy the response from the GET request, change the VLAN # and name, then resend it back to the device as a PATCH call I get the malformed response 400 response.
{
"ietf-restconf:errors": {
"error": [
{
"error-type": "application",
"error-tag": "malformed-message",
"error-path": "/openconfig-vlan:vlans"
}
]
}
}
Here is my PATCH body
{
"openconfig-vlan:vlans": {
"vlan": [
{
"vlan-id": 1234,
"config": {
"vlan-id": 1234,
"name": "test-api"
}
}
]
}
}
I have tried everything i can think of, even pulling payloads from the Ansible F5OS module, and nothing seems to be working for creating these VLANs.
Thanks in advance for the help
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
