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代码生成或Python API客户端的帮助,请通过 https://github.com/swagger-api/swagger-codegen/issues Does API Client Library for Python support creation and deletion of pods and jobs on google container engine? 解决方案 Given that Kubernetes comes with a Swagger spec (1.2, not the latest version), you can use swagger-codegen to generate an Python API client for it.Here is an example to generate Python API client using https://generator.swagger.io: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/pythonwhich returns a JSON with an URL to download the zipped Python API client.Ref: https://github.com/swagger-api/swagger-codegen#online-generatorsIf you need help with swagger codegen or the Python API client, please open a ticket via https://github.com/swagger-api/swagger-codegen/issues 这篇关于使用适用于Python的API客户端库提交作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-20 05:44