Let me take your own example as below.
Below is the existing IP set which I have with revision number 1.
Name - MyWebSite
Value - 22.214.171.124, 126.96.36.199
revision - 1
I wanted to add 188.8.131.52, 184.108.40.206 , 220.127.116.11, 18.104.22.168
I don't want to worry about what was the previous value, I need to add the values which i need to pass.
The old entries can be removed or vanished. The entry which i will pass will have the old entries along with the new entries.
Let me know in this scenario what should be my revision number.
Is there any way to ignore the revision number & add the IPsets value which i pass.
What ever i add pass as the IP address into the IPSets needs to be added. Is there any way i can ignore the revision number.
Get-NsxIpSet blah | Add-NsxIpSetMember -IpAddress 22.214.171.124,126.96.36.199,188.8.131.52-184.108.40.206,10.0.0.0/8
The above command i understand will add the ip address to the existing IPSet group.
What i am looking is that every time i need to delete the existing IP Addresses & add the IP Addresses which i pass.
Let me know how to achieve it.
This will completely overwrite the currently configured values in the IP Set and replace it with what you specify (220.127.116.11,18.104.22.168)
$ipset = Get-NsxIpSet test1003
$ipset.value = "22.214.171.124,126.96.36.199"
Invoke-NsxRestMethod -method "put" -URI "/api/2.0/services/ipset/$($ipset.objectid)" -body $ipset.outerxml