Hi There,
started to using Rancher 1.3.0 - I wanted to update an existing Service with a new Docker Image. I am using this snippets:
- Fetch Projects from API
- Select “Default”
- Fetch Stacks
- Select my Stack to be updated (All Services in one stack should get the update)
- Select all Services from this stack
- Update the launchConfig Object with a new imageUuid Version (Using docker:mydockerhost/app:1.1.0-SNAPSHOT)
From now on it is not working: - that fire an PUT Request. In Curl:
curl -X PUT -H 'Content-Type: application/json' -d '
{"launchConfig":
{"type":"launchConfig",
"command":["java","-Xmx512m","-jar","app.jar",],
"environment":{},
"imageUuid":"mydocker/app:1.1.0-SNAPSHOT",
"instanceTriggeredStop":"stop",
"kind":"container",
"labels":{"io.rancher.container.pull_image":"always"},
"logConfig":{"type":"logConfig"},
"networkMode":"managed",
"privileged":false,
"publishAllPorts":false,
"readOnly":false,
"startOnCreate":true,
"stdinOpen":true,
"system":false,
"tty":true,
"version":"0",
"vcpu":1}}' myrancher:8080/v2-beta/projects/1a5/services/1s12?action=upgrade"
In the response, I get back the old version number “1.0.0-SNAPSHOT” - so the update failed. No error in the audit-log. I tried:
curl -X POST -H 'Content-Type: application/json' myrancher:8080/v2-beta/projects/1a5/services/1s12?action=finishupgrade`
But get an Error Response:
"{\"id\":\"123-123",\"type\":\"error\",\"links\":{},\"actions\":{},\"status\":422,\"code\":\"ActionNotAvailable\",\"message\":null,\"detail\":null,\"fieldName\":\"action\",\"baseType\":\"error\"}"`
The Error Message is not quiet helpful…
As I could not find an example using the new API, I finally decided to try out the forums. What am I doing wrong ?