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
So I tried and failed.
PATCH https://10.10.10.10/api/data/openconfig-vlan:vlans/vlan=30/members
{"openconfig-vlan:members": {
"member": [
{
"state":
{
"interface": "Production_trunk"
}
}
]
}
}
But it gives me 400 as a response code with such strange error code:
{
"ietf-restconf:errors": {
"error": [
{
"error-type": "application",
"error-tag": "malformed-message",
"error-path": "/openconfig-vlan:vlans/vlan[vlan-id='30']/members",
"error-message": "object is not writable: /oc-vlan:vlans/oc-vlan:vlan[oc-vlan:vlan-id='30']/oc-vlan:members/oc-vlan:member"
}
]
}
}
the vlan 30 exists, the trunk exists as well
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
- ZdenekFeb 22, 2024Cirrostratus
Yes that is the correct, it has to be done through interface API endpoint, Thanks Raam.
I just wonder what's the reason to have such complicated key names like "openconfig-vlan:switched-vlan", I don't see any benefits in that..
- michal-kNov 09, 2024Altostratus
Just ran into it earlier today. Netconf/yang is painful..
I think the fact the "members" container is not writable is either a bug, or the documentation needs a serious overhaul.
I will open a case for that..
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