Hi,
I want to restore a snapshot to a container every day at the same time. Therefore I wrote a shell script which uses curl and the API on LXD 2.16. So far so good . . . the restore process is running with the following output
curl -s --unix-socket /var/lib/lxd/unix.socket -X PUT -d '{"restore": "snap2"}' a/1.0/containers/apache-12345 | jq .
{
"type": "async",
"status": "Operation created",
"status_code": 100,
"operation": "/1.0/operations/d6e9dc2b-9c00-47e3-8b6b-67a9839a83a5",
"error_code": 0,
"error": "",
"metadata": {
"id": "d6e9dc2b-9c00-47e3-8b6b-67a9839a83a5",
"class": "task",
"created_at": "2017-10-08T11:35:09.705302724+02:00",
"updated_at": "2017-10-08T11:35:09.705302724+02:00",
"status": "Running",
"status_code": 103,
"resources": {
"containers": [
"/1.0/containers/apache-12345"
]
},
"metadata": null,
"may_cancel": false,
"err": ""
}
}
But when I want to access the information of the operation I get a “not found” error like this
curl -s --unix-socket /var/lib/lxd/unix.socket -X GET a/1.0/operations/d6e9dc2b-9c00-47e3-8b6b-67a9839a83a5 | jq .
{
"error": "not found",
"error_code": 404,
"type": "error"
}
I was hoping to get a status of the process to proceed with further steps in my script. What did I wrong?
Best regards!
Andy