3

Hi :) I'm trying to mimic the oc cli API call to the master node that initiates a deployment. So eventually, I can have a chatbot that can initiate a deployment without needing to install the oc cli.

What is the API call to initiate a deployment?

When I look at what the oc cli is doing with oc deploy <app> --latest --loglevel=9. I see it fetching information only:

curl -k -v -XGET  -H "Authorization: Bearer <token>" -H "User-Agent: oc/v1.3.0 (darwin/amd64) openshift/d451518" -H "Accept: application/json, */*" https://<host>:<port>/oapi/v1/namespaces/<namespace>/deploymentconfigs/<app>

curl -k -v -XGET  -H "User-Agent: oc/v1.3.0+52492b4 (darwin/amd64) kubernetes/52492b4" -H "Authorization: Bearer <token>" -H "Accept: application/json, */*" https://<host>:<port>/api/v1/namespaces/<namespace>/replicationcontrollers/<app>-15

Where does it make the call to initiate the deployment? And how do I mimic it?

I wasn't able to find anything in these docs:

https://docs.openshift.org/latest/rest_api/openshift_v1.html

https://docs.openshift.org/latest/rest_api/kubernetes_v1.html

Thank you for your time!

Zhao Li
  • 4,936
  • 8
  • 33
  • 51

1 Answers1

0

Not sure if this is where you are wanting to go but your maybe looking for this

create instantiate of a DeploymentRequest POST /oapi/v1/namespaces/{namespace}/deploymentconfigs/{name}/instantiate

https://docs.openshift.org/latest/rest_api/openshift_v1.html#create-instantiate-of-a-deploymentrequest

https://docs.openshift.org/latest/rest_api/openshift_v1.html#v1-deploymentrequest

Warren Paul
  • 56
  • 1
  • 5
  • Thanks Warren! I think deployment request is what I'm looking for. If I'm reading it correctly that's how I initiate a deployment if I already have a deployment config setup, correct? And would you happen to know what the curl command for it looks like? I'm not able to figure out the REST API path from the doc. Sorry I'm a noob at this. Thanks again for your time! – Zhao Li Apr 11 '17 at 15:10