Hi all, I’m trying to automate modifying the SNMP community string via icontrol REST API, using curl on linux, on our BigIP Virtual Edition appliances. It’s a subcollection in /mgmt/tm/sys/snmp but I just can’t figure out the right PUT method syntax. I’ve read the icontrol user guide and I’m missing something that I need some help on. Here’s the JSON output:
"communitiesReference": {
"isSubcollection": true,
"items": [
{
"access": "ro",
"communityName": "public",
"fullPath": "/Common/comm-public",
"generation": 0,
"ipv6": "disabled",
"kind": "tm:sys:snmp:communities:communitiesstate",
"name": "comm-public",
"partition": "Common",
"selfLink": "https://localhost/mgmt/tm/sys/snmp/communities/~Common~comm-public?ver=11.6.0",
"source": "default"
}
I basically want to modify pair “communityName”:“public” to “communityName”:“nonpublic” as an example. That’s it. My curl syntax is like so:
curl -sk -u admin:admin -H "Content-type: application/json" -X PUT -d '{"communities": [{"access":"ro","communityName":"nonpublic"}]}' 'https://10.1.1.25/mgmt/tm/sys/snmp | python -m json.tool'
My error when I run that is:
{ “code”: 400, “errorStack”: [], “message”: “one or more configuration identifiers must be provided” }
I don’t know what I’m missing. Thank you!