From 459092d5fac3bfc59a7c3a510cb6e577e933a00a Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 1 Apr 2016 14:20:20 -0400 Subject: [PATCH] Oops! restore old README.rst --- README.rst | 56 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index d6c1f30..cc886b7 100644 --- a/README.rst +++ b/README.rst @@ -1,19 +1,57 @@ -=============================== -python-k8sclient -=============================== +============================================= +python-k8sclient - Kubernetes API client code +============================================= -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. +Overview +-------- -Please feel here a long description which must be at least 3 lines wrapped on -80 cols, so that distribution package maintainers can use it in their packages. -Note that this is a hard requirement. +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 -Features +See also -------- -* TODO +* 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 +``_ + +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.