Forum Discussion
BigIP VE 11.6.0 modify json subcollection for SNMP
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!
1 Reply
- Michael_Jenkins
Cirrostratus
The iControlRest doesn't seem to do to well with updating collections. So in my experience, what I've had to do is grab the collection, modify the fields I want, and then PUT the collection back.
I think your curl string is accurate, except that you need your identifiers (the name field at least)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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