Add an Object Using PATCH Request
The following example uses a PATCH
request to add a VRF to a template in an existing schema. The request response contains the entire object that was updated.
Original schema:
{
"id": "5c4b55db1a00003422f2215e",
"displayName": "SampleSchema",
"templates": [
{
"name": "Template1",
"displayName": "Template1",
"tenantId": "0000ffff0000000000000010",
"anps": [],
"vrfs": [],
"bds": [],
"contracts": [],
"filters": [],
"externalEpgs": [],
"serviceGraphs": [],
"intersiteL3outs": []
}
]
}
Request URL:
PATCH https://<mso-ip>/api/v1/schemas/5c4b55db1a00003422f2215e
Request payload:
[{
"op": "add",
"path": "/templates/Template1/vrfs/-",
"value": {
"displayName" : "vrf1",
"name" : "vrf1" }
}]
Request response:
{
"id": "5c4b55db1a00003422f2215e",
"displayName": "SampleSchema",
"templates": [
{
"name": "Template1",
"displayName": "T1",
"tenantId": "0000ffff0000000000000010",
"anps": [],
"vrfs": [
{
"name": "vrf1",
"displayName": "vrf1",
"vrfRef": "/schemas/5c4b55db1a00003422f2215e/templates/Template1/vrfs/vrf1",
"vzAnyProviderContracts": [],
"vzAnyConsumerContracts": []
}
],
"bds": [],
"contracts": [],
"filters": [],
"externalEpgs": [],
"serviceGraphs": [],
"intersiteL3outs": []
}
]
}
Remove an Object Using PATCH Request (VRF Example)
The following example uses a PATCH
request to remove a VRF from a template in an existing schema. The request response contains the entire object that was updated.
Original schema:
{
"id": "5c4b55db1a00003422f2215e",
"displayName": "SampleSchema",
"templates": [
{
"name": "Template1",
"displayName": "T1",
"tenantId": "0000ffff0000000000000010",
"anps": [],
"vrfs": [
{
"name": "vrf1",
"displayName": "vrf1",
"vrfRef": "/schemas/5c4b55db1a00003422f2215e/templates/Template1/vrfs/vrf1",
"vzAnyProviderContracts": [],
"vzAnyConsumerContracts": []
}
],
"bds": [],
"contracts": [],
"filters": [],
"externalEpgs": [],
"serviceGraphs": [],
"intersiteL3outs": []
}
]
}
Request URL:
PATCH https://<mso-ip>/api/v1/schemas/5c4b55db1a00003422f2215e
Request payload:
[{
"op": "remove",
"path": "/templates/Template1/vrfs/vrf1"
}]
Request response:
{
"id": "5c4b55db1a00003422f2215e",
"displayName": "SampleSchema",
"templates": [
{
"name": "Template1",
"displayName": "T1",
"tenantId": "0000ffff0000000000000010",
"anps": [],
"vrfs": [],
"bds": [],
"contracts": [],
"filters": [],
"externalEpgs": [],
"serviceGraphs": [],
"intersiteL3outs": []
}
]
}
Remove an Object Using PATCH Request (staticPort Example)
An additional example of using PATCH
request to remove a static port.
Original schema:
{
"id": "601acfed38000070a4ee9ec0",
"displayName": "Schema1",
"description": "",
"templates": [
{
"name": "Template1",
"displayName": "Template 1",
"tenantId": "0000ffff0000000000000010",
"anps": [
{
"name": "AP1",
"displayName": "AP 1",
"anpRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/anps/AP1",
"epgs": [
{
"name": "EPG1",
"displayName": "EPG 1",
"epgRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/anps/AP1/epgs/EPG1",
"contractRelationships": [],
"subnets": [],
"uSegEpg": false,
"uSegAttrs": [],
"intraEpg": "unenforced",
"prio": "unspecified",
"proxyArp": false,
"preferredGroup": false,
"bdRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/bds/BD1",
"vrfRef": "",
"selectors": [],
"epgType": "application"
}
]
}
],
"vrfs": [
{
"name": "VRF1",
"displayName": "VRF 1",
"vrfRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/vrfs/VRF1",
"l3MCast": false,
"preferredGroup": false,
"vzAnyEnabled": false,
"vzAnyProviderContracts": [],
"vzAnyConsumerContracts": [],
"rpConfigs": [],
"pcEnfPref": "enforced",
"ipDataPlaneLearning": "enabled"
}
],
"bds": [
{
"name": "BD1",
"displayName": "BD 1",
"bdRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/bds/BD1",
"l2UnknownUnicast": "proxy",
"intersiteBumTrafficAllow": true,
"optimizeWanBandwidth": true,
"l2Stretch": true,
"subnets": [],
"vrfRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/vrfs/VRF1",
"unkMcastAct": "flood",
"v6unkMcastAct": "flood",
"arpFlood": true,
"multiDstPktAct": "bd-flood"
}
],
"contracts": [],
"filters": [],
"externalEpgs": [],
"serviceGraphs": [],
"intersiteL3outs": [],
"templateType": "stretched-template",
"templateSubType": []
}
],
"_updateVersion": 1,
"sites": [
{
"siteId": "5efceb4a3600002738221157",
"templateName": "Template1",
"anps": [
{
"anpRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/anps/AP1",
"epgs": [
{
"epgRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/anps/AP1/epgs/EPG1",
"domainAssociations": [],
"staticPorts": [
{
"type": "port",
"path": "topology/pod-1/paths-101/pathep-[eth1/1]",
"portEncapVlan": 1,
"deploymentImmediacy": "lazy",
"mode": "regular"
},
{
"type": "port",
"path": "topology/pod-1/paths-102/pathep-[eth1/2]",
"portEncapVlan": 2,
"deploymentImmediacy": "lazy",
"mode": "regular"
}
],
"staticLeafs": [],
"uSegAttrs": [],
"subnets": [],
"selectors": []
}
]
}
],
"vrfs": [],
"bds": [],
"contracts": [],
"externalEpgs": [],
"serviceGraphs": [],
"intersiteL3outs": []
}
]
}
Request URL:
PATCH https://<mso-ip>/api/v1/schemas/601acfed38000070a4ee9ec0
Request payload:
[{
"op": "remove",
"path": "/sites/0/anps/0/epgs/0/staticPorts/1"
}]
Request response:
{
"id": "601acfed38000070a4ee9ec0",
"displayName": "Schema1",
"description": "",
"templates": [
{
"name": "Template1",
"displayName": "Template 1",
"tenantId": "0000ffff0000000000000010",
"anps": [
{
"name": "AP1",
"displayName": "AP 1",
"anpRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/anps/AP1",
"epgs": [
{
"name": "EPG1",
"displayName": "EPG 1",
"epgRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/anps/AP1/epgs/EPG1",
"contractRelationships": [],
"subnets": [],
"uSegEpg": false,
"uSegAttrs": [],
"intraEpg": "unenforced",
"prio": "unspecified",
"proxyArp": false,
"preferredGroup": false,
"bdRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/bds/BD1",
"vrfRef": "",
"selectors": [],
"epgType": "application"
}
]
}
],
"vrfs": [
{
"name": "VRF1",
"displayName": "VRF 1",
"vrfRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/vrfs/VRF1",
"l3MCast": false,
"preferredGroup": false,
"vzAnyEnabled": false,
"vzAnyProviderContracts": [],
"vzAnyConsumerContracts": [],
"rpConfigs": [],
"pcEnfPref": "enforced",
"ipDataPlaneLearning": "enabled"
}
],
"bds": [
{
"name": "BD1",
"displayName": "BD 1",
"bdRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/bds/BD1",
"l2UnknownUnicast": "proxy",
"intersiteBumTrafficAllow": true,
"optimizeWanBandwidth": true,
"l2Stretch": true,
"subnets": [],
"vrfRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/vrfs/VRF1",
"unkMcastAct": "flood",
"v6unkMcastAct": "flood",
"arpFlood": true,
"multiDstPktAct": "bd-flood"
}
],
"contracts": [],
"filters": [],
"externalEpgs": [],
"serviceGraphs": [],
"intersiteL3outs": [],
"templateType": "stretched-template",
"templateSubType": []
}
],
"_updateVersion": 1,
"sites": [
{
"siteId": "5efceb4a3600002738221157",
"templateName": "Template1",
"anps": [
{
"anpRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/anps/AP1",
"epgs": [
{
"epgRef": "/schemas/601acfed38000070a4ee9ec0/templates/Template1/anps/AP1/epgs/EPG1",
"domainAssociations": [],
"staticPorts": [
{
"type": "port",
"path": "topology/pod-1/paths-101/pathep-[eth1/1]",
"portEncapVlan": 1,
"deploymentImmediacy": "lazy",
"mode": "regular"
}
],
"staticLeafs": [],
"uSegAttrs": [],
"subnets": [],
"selectors": []
}
]
}
],
"vrfs": [],
"bds": [],
"contracts": [],
"externalEpgs": [],
"serviceGraphs": [],
"intersiteL3outs": []
}
]
}