Python API for Kubernetes
Go to file
Davanum Srinivas 9f65944384 Fix flake8 with minimal changes
Just ignore a bunch of things now. We can fix these later as a big
bunch of these are in generated code.
2016-04-02 20:59:30 -04:00
doc/source Add Cookie cutter generated files for OpenStack 2016-04-01 14:16:11 -04:00
k8sclient Fix flake8 with minimal changes 2016-04-02 20:59:30 -04:00
.gitignore Get tests working 2016-04-01 14:27:35 -04:00
.testr.conf Get tests working 2016-04-01 14:27:35 -04:00
babel.cfg Add Cookie cutter generated files for OpenStack 2016-04-01 14:16:11 -04:00
CONTRIBUTING.rst Add Cookie cutter generated files for OpenStack 2016-04-01 14:16:11 -04:00
HACKING.rst Add Cookie cutter generated files for OpenStack 2016-04-01 14:16:11 -04:00
LICENSE Add Cookie cutter generated files for OpenStack 2016-04-01 14:16:11 -04:00
MANIFEST.in Add Cookie cutter generated files for OpenStack 2016-04-01 14:16:11 -04:00
README.rst Oops! restore old README.rst 2016-04-01 14:22:05 -04:00
requirements.txt Add missing requirement 2016-04-01 17:48:10 -04:00
setup.cfg Get tests working in py34 2016-04-01 17:26:32 -04:00
setup.py Add Cookie cutter generated files for OpenStack 2016-04-01 14:16:11 -04:00
test-requirements.txt Add Cookie cutter generated files for OpenStack 2016-04-01 14:16:11 -04:00
tox.ini Fix flake8 with minimal changes 2016-04-02 20:59:30 -04:00

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.

See also

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/magnum.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 ./magnum/magnum/common/pythonk8sclient/templates/v1.json \
        -l python -o ./KubernetesClientCode

Now you can check the code at location ./KubernetesClientCode.