Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Generated client change for 8.0.0 release #675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Nov 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
dist: trusty
dist: xenial
sudo: true
services:
- docker
Expand All @@ -12,7 +12,7 @@ matrix:
- python: 2.7
env: TOXENV=py27-functional
- python: 2.7
env: TOXENV=update-pep8
env: TOXENV=update-pycodestyle
- python: 2.7
env: TOXENV=docs
- python: 2.7
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v8.0.0
**New Feature:**
- Add utility to create API resource from yaml file [kubernetes-client/python#655](https://github.com/kubernetes-client/python/pull/655)

# v8.0.0b1
**Bug Fix:**
- Update ExecProvider to use safe\_get() to tolerate kube-config file that sets
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,13 @@ between client-python versions.
| 4.0 Alpha/Beta | Kubernetes main repo, 1.8 branch | ✗ |
| 4.0 | Kubernetes main repo, 1.8 branch | ✗ |
| 5.0 Alpha/Beta | Kubernetes main repo, 1.9 branch | ✗ |
| 5.0 | Kubernetes main repo, 1.9 branch | |
| 5.0 | Kubernetes main repo, 1.9 branch | |
| 6.0 Alpha/Beta | Kubernetes main repo, 1.10 branch | ✗ |
| 6.0 | Kubernetes main repo, 1.10 branch | ✓ |
| 7.0 Alpha/Beta | Kubernetes main repo, 1.11 branch | ✗ |
| 7.0 | Kubernetes main repo, 1.11 branch | ✓ |
| 8.0 Alpha/Beta | Kubernetes main repo, 1.12 branch | ✓ |
| 8.0 Alpha/Beta | Kubernetes main repo, 1.12 branch | ✗ |
| 8.0 | Kubernetes main repo, 1.12 branch | ✓ |


Key:
Expand Down
32 changes: 32 additions & 0 deletions examples/create_deployment_from_yaml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from os import path

from kubernetes import client, config, utils


def main():
# Configs can be set in Configuration class directly or using helper
# utility. If no argument provided, the config will be loaded from
# default location.
config.load_kube_config()
k8s_client = client.ApiClient()
k8s_api = utils.create_from_yaml(k8s_client, "nginx-deployment.yaml")
deps = k8s_api.read_namespaced_deployment("nginx-deployment", "default")
print("Deployment {0} created".format(deps.metadata.name))


if __name__ == '__main__':
main()
58 changes: 58 additions & 0 deletions examples/remote_cluster.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This example demonstrate communication with a remote Kube cluster from a
# server outside of the cluster without kube client installed on it.
# The communication is secured with the use of Bearer token.

from kubernetes import client, config


def main():
# Define the barer token we are going to use to authenticate.
# See here to create the token:
# https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/
aToken = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

# Create a configuration object
aConfiguration = client.Configuration()

# Specify the endpoint of your Kube cluster
aConfiguration.host = "https://XXX.XXX.XXX.XXX:443"

# Security part.
# In this simple example we are not going to verify the SSL certificate of
# the remote cluster (for simplicity reason)
aConfiguration.verify_ssl = False
# Nevertheless if you want to do it you can with these 2 parameters
# configuration.verify_ssl=True
# ssl_ca_cert is the filepath to the file that contains the certificate.
# configuration.ssl_ca_cert="certificate"

aConfiguration.api_key = {"authorization": "Bearer " + aToken}

# Create a ApiClient with our config
aApiClient = client.ApiClient(aConfiguration)

# Do calls
v1 = client.CoreV1Api(aApiClient)
print("Listing pods with their IPs:")
ret = v1.list_pod_for_all_namespaces(watch=False)
for i in ret.items:
print("%s\t%s\t%s" %
(i.status.pod_ip, i.metadata.namespace, i.metadata.name))


if __name__ == '__main__':
main()
4 changes: 2 additions & 2 deletions kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ No description provided (generated by Swagger Codegen https://github.com/swagger

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: v1.12.2
- Package version: 8.0.0b1
- API version: v1.12.3
- Package version: 8.0.0
- Build package: io.swagger.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
3 changes: 2 additions & 1 deletion kubernetes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

__project__ = 'kubernetes'
# The version is auto-updated. Please do not edit.
__version__ = "8.0.0b1"
__version__ = "8.0.0"

import kubernetes.client
import kubernetes.config
import kubernetes.watch
import kubernetes.stream
import kubernetes.utils
2 changes: 1 addition & 1 deletion kubernetes/base
Submodule base updated 1 files
+1 −1 .travis.yml
2 changes: 1 addition & 1 deletion kubernetes/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down Expand Up @@ -71,7 +71,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'Swagger-Codegen/8.0.0b1/python'
self.user_agent = 'Swagger-Codegen/8.0.0/python'

def __del__(self):
self.pool.close()
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/admissionregistration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/apiextensions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/apiextensions_v1beta1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/apiregistration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/apiregistration_v1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/apiregistration_v1beta1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/apis_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/apps_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/apps_v1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/apps_v1beta1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/apps_v1beta2_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/authentication_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/authentication_v1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/authentication_v1beta1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/authorization_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/authorization_v1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/authorization_v1beta1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/autoscaling_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/autoscaling_v1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/autoscaling_v2beta1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/client/apis/autoscaling_v2beta2_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.12.2
OpenAPI spec version: v1.12.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
Expand Down
Loading