使用适用于Python的API客户端库提交作业? [英] Submit jobs using API Client Library for Python?

查看:116
本文介绍了使用适用于Python的API客户端库提交作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python的API客户端库是否支持创建和删除广告连播,以及Google容器引擎上的工作?

解决方案

鉴于Kubernetes随附Swagger规范(1.2,不是最新版本),您可以使用swagger-codegen为其生成Python API客户端./p>

以下是使用 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代码生成或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/python

which returns a JSON with an URL to download the zipped Python API client.

Ref: https://github.com/swagger-api/swagger-codegen#online-generators

If 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客户端库提交作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆