Forum Discussion
Satoshi_Toyosa1
Jul 11, 2017Employee
I believe you are missing curly brackets around the name/value object. i.e.,
{"records":[ {"name":"default", "data":"virt_host2"} ]}
Example:
- Getting the datagroup (equivalent to
😞tmsh list ltm data-group internal images
curl -sku admin: https:///mgmt/tm/ltm/data-group/internal/images
{ kind: 'tm:ltm:data-group:internal:internalstate',
name: 'images',
fullPath: 'images',
generation: 299,
selfLink: 'https://localhost/mgmt/tm/ltm/data-group/internal/images?ver=11.6.1',
type: 'string',
records: [ { name: 'ext1', data: '.ppm' } ]
}
- Modify (equivalent to
)modify ltm data-group internal images records replace-all-with {ext1 {data .png} }
curl -sku admin: https:///mgmt/tm/ltm/data-group/internal/images \
-X PATCH -H "Content-type: application/json" \
-d '{"records":[ {"name": "ext1", "data":".png"} ]}'
{ kind: 'tm:ltm:data-group:internal:internalstate',
name: 'images',
fullPath: 'images',
generation: 306,
selfLink: 'https://localhost/mgmt/tm/ltm/data-group/internal/images?ver=11.6.1',
type: 'string',
records: [ { name: 'ext1', data: '.png' } ]
}