9a07ef5129
* We are no longer in magnum repo * file path to v1.json has changed Fix minor flake8 issues Change-Id: I077127d387399864e490d242806053237af32e0b
1.7 KiB
1.7 KiB
python-k8sclient - Kubernetes API client code
Overview
This is Kubernetes API python client code. This code is generated by swagger-codegen. Kubernetes provide swagger-spec to generate client code for different versions. The specs live in Kubernetes repo.
- Free software: Apache license
- Documentation: http://docs.openstack.org/developer/python-k8sclient
- Source: http://git.openstack.org/cgit/openstack/python-k8sclient
- Bugs: http://bugs.launchpad.net/python-k8sclient
See also
- swagger-codegen: https://github.com/swagger-api/swagger-codegen
- Kubernetes swagger-spec: https://github.com/GoogleCloudPlatform/kubernetes/tree/master/api/swagger-spec
Prerequisites
You need to install required packages for swagger codegen. Please refer to https://github.com/swagger-api/swagger-codegen#prerequisites
Steps to generate API client code
Steps to generate Kubernetes client code for v1:
Clone the Magnum repo:
git clone https://github.com/openstack/python-k8sclient.git
- * Clone the swagger-codegen repo. It is recommended to checkout a release
-
(e.g. v2.1.3) instead of using the master branch:
git clone https://github.com/swagger-api/swagger-codegen.git cd swagger-codegen/ git checkout tags/v2.1.3
Build swagger-codegen:
mvn package
Run below command to generate the API client code for Kubernetes:
cd .. java -jar ./swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \ generate \ -i ./k8sclient/templates/v1.json \ -l python -o ./KubernetesClientCode
Now you can check the code at location ./KubernetesClientCode.