Use API to start new container from catalog

There is no “deploy this catalog entry” API call… the catalog API supplies compose yaml files, the UI generates a key/value map of answers, and those are passed to the standard create stack call (environment in the API…).

(Note: this is for Cattle orchestration… Kubernetes has different endpoints because it goes to the kubectl service directly)

http://docs.rancher.com/rancher/latest/en/api/api-resources/environment/

Basically POST /v1/projects/<projectId>/environments

{
  name: "My App",
  dockerCompose: "your docker-compose yaml",
  rancherCompose: "your rancher-compose yaml",
  environment: {
    question1: "answer1",
    question2: "answer2"
  }
}

For double confusion, the answers go in the property called environment, because the substitution is intended for environment variables in libcompose.