【发布时间】:2016-01-03 08:17:24
【问题描述】:
API Client Library for Python 是否支持在 google 容器引擎上创建和删除 pod 和作业?
【问题讨论】:
标签: google-api-python-client google-kubernetes-engine google-container-registry
API Client Library for Python 是否支持在 google 容器引擎上创建和删除 pod 和作业?
【问题讨论】:
标签: google-api-python-client google-kubernetes-engine google-container-registry
鉴于 Kubernetes 带有 Swagger 规范(1.2,不是最新版本),您可以使用 swagger-codegen 为其生成 Python API 客户端。
这里是一个使用https://generator.swagger.io生成Python API客户端的例子:
curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/swagger-spec/v1.json"}' https://generator.swagger.io/api/gen/clients/python
它返回一个带有 URL 的 JSON,用于下载压缩的 Python API 客户端。
参考:https://github.com/swagger-api/swagger-codegen#online-generators
如果您需要 swagger codegen 或 Python API 客户端方面的帮助,请通过https://github.com/swagger-api/swagger-codegen/issues 开票
【讨论】: