OpenShift / Origin API调用以启动部署

时间:2017-04-10 20:51:24

标签: openshift redhat openshift-origin redhat-containers

嗨:)我正在尝试模仿启动部署的主节点的oc cli API调用。所以最终,我可以拥有一个可以启动部署而无需安装oc cli的聊天机器人。

启动部署的API调用是什么?

当我查看oc cli对oc deploy <app> --latest --loglevel=9所做的事情时。我看到它只提取信息:

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

它在哪里进行调用以启动部署?我该如何模仿呢?

我无法在这些文档中找到任何内容:

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

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

感谢您的时间!

1 个答案:

答案 0 :(得分:0)

不确定这是否是你想去的地方,但你可能正在寻找这个

创建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