F5Networks / f5-appsvcs-extension

F5 BIG-IP Application Services 3 Extension
Apache License 2.0
163 stars 52 forks source link

Using a PATCH operation on the GSLB_Topology_Records class overwrites all current entries, not just those intended to be modified. #809

Open npmaslow opened 3 months ago

npmaslow commented 3 months ago

Environment

Summary

Assume there is a list of 10 topology records where 10 unique source topology regions, if matched, all are assigned a destination datacenter of DC1. I am attempting to use the PATCH operation to update 5 of the 10 topology records to update the destination to DC2. Instead of the 5 records being updated, the topology records list is entirely replaced to contain only the 5 modified records.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Submit the following declaration with a POST operation to create the 10 topology records: { "class": "AS3", "action": "deploy", "persist": true, "declaration": { "class": "ADC", "schemaVersion": "3.30.0", "id": "urn:uuid:158c4f1f-5a00-46ad-9f56-3a30e5453d14", "remark": "DNS AS3 Declaration", "Common": { "class": "Tenant", "Shared": { "class": "Application", "template": "shared", "s000001": { "class": "GSLB_Topology_Region", "members": [ { "matchType": "subnet", "matchValue": "10.10.10.0/26" } ] }, "s000002": { "class": "GSLB_Topology_Region", "members": [ { "matchType": "subnet", "matchValue": "11.11.11.0/26" } ] }, "s000003": { "class": "GSLB_Topology_Region", "members": [ { "matchType": "subnet", "matchValue": "12.12.12.0/26" } ] }, "s000004": { "class": "GSLB_Topology_Region", "members": [ { "matchType": "subnet", "matchValue": "13.13.13.0/26" } ] }, "s000005": { "class": "GSLB_Topology_Region", "members": [ { "matchType": "subnet", "matchValue": "14.14.14.0/26" } ] }, "s000006": { "class": "GSLB_Topology_Region", "members": [ { "matchType": "subnet", "matchValue": "15.15.15.0/26" } ] }, "s000007": { "class": "GSLB_Topology_Region", "members": [ { "matchType": "subnet", "matchValue": "16.16.16.0/26" } ] }, "s000008": { "class": "GSLB_Topology_Region", "members": [ { "matchType": "subnet", "matchValue": "17.17.17.0/26" } ] }, "s000009": { "class": "GSLB_Topology_Region", "members": [ { "matchType": "subnet", "matchValue": "18.18.18.0/26" } ] }, "s000010": { "class": "GSLB_Topology_Region", "members": [ { "matchType": "subnet", "matchValue": "19.19.19.0/26" } ] }, "DC1": { "class": "GSLB_Data_Center" }, "DC2": { "class": "GSLB_Data_Center" }, "topo_records": { "class": "GSLB_Topology_Records", "records": [ { "destination": { "matchType": "datacenter", "matchValue": { "use": "DC1" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "use": "s000001" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "use": "DC1" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "use": "s000002" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "use": "DC1" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "use": "s000003" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "use": "DC1" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "use": "s000004" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "use": "DC1" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "use": "s000005" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "use": "DC1" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "use": "s000006" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "use": "DC1" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "use": "s000007" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "use": "DC1" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "use": "s000008" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "use": "DC1" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "use": "s000009" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "use": "DC1" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "use": "s000010" }, "matchOperator": "equals" }, "weight": 100 } ] }
    } } } }

  2. Submit this declaration with a PATCH operation and see that the topology records list was removed and now only contains the 5 modified records: { "class": "AS3", "action": "deploy", "persist": true, "declaration": { "class": "ADC", "schemaVersion": "3.30.0", "id": "urn:uuid:158c4f1f-5a00-46ad-9f56-3a30e5453d14", "remark": "DNS AS3 Declaration", "Common": { "class": "Tenant", "Shared": { "class": "Application", "template": "shared", "topo_records": { "class": "GSLB_Topology_Records", "records": [ { "destination": { "matchType": "datacenter", "matchValue": { "bigip": "/Common/DC2" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "bigip": "/Common/s000006" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "bigip": "/Common/DC2" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "bigip": "/Common/s000007" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "bigip": "/Common/DC2" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "bigip": "/Common/s000008" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "bigip": "/Common/DC2" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "bigip": "/Common/s000009" }, "matchOperator": "equals" }, "weight": 100 }, { "destination": { "matchType": "datacenter", "matchValue": { "bigip": "/Common/DC2" }, "matchOperator": "equals" }, "source": { "matchType": "region", "matchValue": { "bigip": "/Common/s000010" }, "matchOperator": "equals" }, "weight": 100 } ] }
    } } } }

Expected Behavior

The end result I'd expect with a PATCH operation is that the topology records list would contain 5 records with a destination of DC1 and 5 records with a destination of DC2

Actual Behavior

The topology records list only contains the 5 entries that were updated to a destination of DC2