S__233_bastien2
Jul 06, 2017Nimbostratus
Update/modify an iApp instance with iControlREST
Hi, I've build an iApp, and I would like to create/update services using iControl REST.
Creation is working fine:
↪ curl -sk -u admin:password -H "Content-Type: application/json" -X POST --data @iapp.json https://172.31.X.X/mgmt/tm/sys/application/service/ | jq .
{
"kind": "tm:sys:application:service:servicestate",
"name": "test",
"partition": "Common",
"subPath": "test.app",
"fullPath": "/Common/test.app/test",
"generation": 1120,
"selfLink": "https://localhost/mgmt/tm/sys/application/service/~Common~test.app~test?ver=13.0.0",
"deviceGroup": "none",
"inheritedDevicegroup": "false",
"inheritedTrafficGroup": "false",
"strictUpdates": "enabled",
"template": "/Common/mytemplate",
"templateReference": {
"link": "https://localhost/mgmt/tm/sys/application/template/~Common~mytemplate?ver=13.0.0"
},
"templateModified": "no",
"trafficGroup": "none",
"tables": [
{
"name": "hosts__ip_host",
"columnNames": [
"ip",
"host"
],
"rows": [ ..... ]
}
],
"variables": [
{
"name": "vip__vip",
"encrypted": "no",
"value": "2.2.2.2"
}
]
}
`
Update is not easy :
`↪ curl -sk -u admin:password -H "Content-Type: application/json" -X POST --data @iapp.json https://172.31.X.X/mgmt/tm/sys/application/service/
{"code":400,"message":"01020066:3: The requested application instance (/Common/test.app/test) already exists in partition Common.","errorStack":[],"apiError":3}
↪ curl -sk -u admin:password -H "Content-Type: application/json" -X PUT --data @iapp.json https://172.31.X.X/mgmt/tm/sys/application/service/
{"code":403,"message":"Operation is not supported on component /sys/application/service.","errorStack":[],"apiError":1}
Do you see where I'm wrong ?
Do you know how to use the "Reconfigure" action that I use to have in WebUI?
Thank you in advance,
Best regards,
- Sébastien B.