Skip to content
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
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .swagger-codegen-ignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.gitignore
git_push.sh
test/*
requirements.txt
setup.py
846 changes: 0 additions & 846 deletions GEN_README.md

This file was deleted.

943 changes: 938 additions & 5 deletions README.md

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions README.prefix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Kubernetes Python Client

Python clients for talking to a [kubernetes](http://kubernetes.io/) cluster.

## Example

list all pods:

```python
import k8sutil
import k8sclient
import os

# Configs can be set in Configuration class directly or using helper utility
k8sutil.load_kube_config(os.environ["HOME"] + '/.kube/config')

v1=k8sclient.CoreV1Api()
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))
```

watch on namespace object:

```python
import k8sutil
import k8sclient
import os


# Configs can be set in Configuration class directly or using helper utility
k8sutil.load_kube_config(os.environ["HOME"] + '/.kube/config')

v1 = k8sclient.CoreV1Api()
count = 10
watch = k8sutil.Watch()
for event in watch.stream(v1.list_namespace, _request_timeout=60):
print("Event: %s %s" % (event['type'], event['object'].metadata.name))
count -= 1
if not count:
watch.stop()

print("Ended.")
```

More examples can be found in [examples](examples/) folder. To run examples, run this command:

```shell
python -m examples.example1
```

(replace example1 with the example base filename)


# Generated client README


10 changes: 5 additions & 5 deletions docs/AppsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ All URIs are relative to *https://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_apps_api_group**](AppsApi.md#get_apps_api_group) | **GET** /apis/apps/ |
[**get_api_group**](AppsApi.md#get_api_group) | **GET** /apis/apps/ |


# **get_apps_api_group**
> UnversionedAPIGroup get_apps_api_group()
# **get_api_group**
> UnversionedAPIGroup get_api_group()



Expand All @@ -31,10 +31,10 @@ k8sclient.configuration.api_key['authorization'] = 'YOUR_API_KEY'
api_instance = k8sclient.AppsApi()

try:
api_response = api_instance.get_apps_api_group()
api_response = api_instance.get_api_group()
pprint(api_response)
except ApiException as e:
print("Exception when calling AppsApi->get_apps_api_group: %s\n" % e)
print("Exception when calling AppsApi->get_api_group: %s\n" % e)
```

### Parameters
Expand Down
216 changes: 110 additions & 106 deletions docs/AppsV1alpha1Api.md → docs/AppsV1beta1Api.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/AuthenticationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ All URIs are relative to *https://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_authentication_api_group**](AuthenticationApi.md#get_authentication_api_group) | **GET** /apis/authentication.k8s.io/ |
[**get_api_group**](AuthenticationApi.md#get_api_group) | **GET** /apis/authentication.k8s.io/ |


# **get_authentication_api_group**
> UnversionedAPIGroup get_authentication_api_group()
# **get_api_group**
> UnversionedAPIGroup get_api_group()



Expand All @@ -31,10 +31,10 @@ k8sclient.configuration.api_key['authorization'] = 'YOUR_API_KEY'
api_instance = k8sclient.AuthenticationApi()

try:
api_response = api_instance.get_authentication_api_group()
api_response = api_instance.get_api_group()
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationApi->get_authentication_api_group: %s\n" % e)
print("Exception when calling AuthenticationApi->get_api_group: %s\n" % e)
```

### Parameters
Expand Down
20 changes: 10 additions & 10 deletions docs/AuthenticationV1beta1Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ All URIs are relative to *https://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_authentication_v1beta1_token_review**](AuthenticationV1beta1Api.md#create_authentication_v1beta1_token_review) | **POST** /apis/authentication.k8s.io/v1beta1/tokenreviews |
[**get_authentication_v1beta1_api_resources**](AuthenticationV1beta1Api.md#get_authentication_v1beta1_api_resources) | **GET** /apis/authentication.k8s.io/v1beta1/ |
[**create_token_review**](AuthenticationV1beta1Api.md#create_token_review) | **POST** /apis/authentication.k8s.io/v1beta1/tokenreviews |
[**get_api_resources**](AuthenticationV1beta1Api.md#get_api_resources) | **GET** /apis/authentication.k8s.io/v1beta1/ |


# **create_authentication_v1beta1_token_review**
> V1beta1TokenReview create_authentication_v1beta1_token_review(body, pretty=pretty)
# **create_token_review**
> V1beta1TokenReview create_token_review(body, pretty=pretty)



Expand All @@ -34,10 +34,10 @@ body = k8sclient.V1beta1TokenReview() # V1beta1TokenReview |
pretty = 'pretty_example' # str | If 'true', then the output is pretty printed. (optional)

try:
api_response = api_instance.create_authentication_v1beta1_token_review(body, pretty=pretty)
api_response = api_instance.create_token_review(body, pretty=pretty)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationV1beta1Api->create_authentication_v1beta1_token_review: %s\n" % e)
print("Exception when calling AuthenticationV1beta1Api->create_token_review: %s\n" % e)
```

### Parameters
Expand All @@ -62,8 +62,8 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_authentication_v1beta1_api_resources**
> UnversionedAPIResourceList get_authentication_v1beta1_api_resources()
# **get_api_resources**
> UnversionedAPIResourceList get_api_resources()



Expand All @@ -86,10 +86,10 @@ k8sclient.configuration.api_key['authorization'] = 'YOUR_API_KEY'
api_instance = k8sclient.AuthenticationV1beta1Api()

try:
api_response = api_instance.get_authentication_v1beta1_api_resources()
api_response = api_instance.get_api_resources()
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthenticationV1beta1Api->get_authentication_v1beta1_api_resources: %s\n" % e)
print("Exception when calling AuthenticationV1beta1Api->get_api_resources: %s\n" % e)
```

### Parameters
Expand Down
10 changes: 5 additions & 5 deletions docs/AuthorizationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ All URIs are relative to *https://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_authorization_api_group**](AuthorizationApi.md#get_authorization_api_group) | **GET** /apis/authorization.k8s.io/ |
[**get_api_group**](AuthorizationApi.md#get_api_group) | **GET** /apis/authorization.k8s.io/ |


# **get_authorization_api_group**
> UnversionedAPIGroup get_authorization_api_group()
# **get_api_group**
> UnversionedAPIGroup get_api_group()



Expand All @@ -31,10 +31,10 @@ k8sclient.configuration.api_key['authorization'] = 'YOUR_API_KEY'
api_instance = k8sclient.AuthorizationApi()

try:
api_response = api_instance.get_authorization_api_group()
api_response = api_instance.get_api_group()
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthorizationApi->get_authorization_api_group: %s\n" % e)
print("Exception when calling AuthorizationApi->get_api_group: %s\n" % e)
```

### Parameters
Expand Down
40 changes: 20 additions & 20 deletions docs/AuthorizationV1beta1Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ All URIs are relative to *https://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_authorization_v1beta1_namespaced_local_subject_access_review**](AuthorizationV1beta1Api.md#create_authorization_v1beta1_namespaced_local_subject_access_review) | **POST** /apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews |
[**create_authorization_v1beta1_self_subject_access_review**](AuthorizationV1beta1Api.md#create_authorization_v1beta1_self_subject_access_review) | **POST** /apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews |
[**create_authorization_v1beta1_subject_access_review**](AuthorizationV1beta1Api.md#create_authorization_v1beta1_subject_access_review) | **POST** /apis/authorization.k8s.io/v1beta1/subjectaccessreviews |
[**get_authorization_v1beta1_api_resources**](AuthorizationV1beta1Api.md#get_authorization_v1beta1_api_resources) | **GET** /apis/authorization.k8s.io/v1beta1/ |
[**create_namespaced_local_subject_access_review**](AuthorizationV1beta1Api.md#create_namespaced_local_subject_access_review) | **POST** /apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews |
[**create_self_subject_access_review**](AuthorizationV1beta1Api.md#create_self_subject_access_review) | **POST** /apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews |
[**create_subject_access_review**](AuthorizationV1beta1Api.md#create_subject_access_review) | **POST** /apis/authorization.k8s.io/v1beta1/subjectaccessreviews |
[**get_api_resources**](AuthorizationV1beta1Api.md#get_api_resources) | **GET** /apis/authorization.k8s.io/v1beta1/ |


# **create_authorization_v1beta1_namespaced_local_subject_access_review**
> V1beta1LocalSubjectAccessReview create_authorization_v1beta1_namespaced_local_subject_access_review(body, namespace, pretty=pretty)
# **create_namespaced_local_subject_access_review**
> V1beta1LocalSubjectAccessReview create_namespaced_local_subject_access_review(body, namespace, pretty=pretty)



Expand All @@ -37,10 +37,10 @@ namespace = 'namespace_example' # str | object name and auth scope, such as for
pretty = 'pretty_example' # str | If 'true', then the output is pretty printed. (optional)

try:
api_response = api_instance.create_authorization_v1beta1_namespaced_local_subject_access_review(body, namespace, pretty=pretty)
api_response = api_instance.create_namespaced_local_subject_access_review(body, namespace, pretty=pretty)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthorizationV1beta1Api->create_authorization_v1beta1_namespaced_local_subject_access_review: %s\n" % e)
print("Exception when calling AuthorizationV1beta1Api->create_namespaced_local_subject_access_review: %s\n" % e)
```

### Parameters
Expand All @@ -66,8 +66,8 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **create_authorization_v1beta1_self_subject_access_review**
> V1beta1SelfSubjectAccessReview create_authorization_v1beta1_self_subject_access_review(body, pretty=pretty)
# **create_self_subject_access_review**
> V1beta1SelfSubjectAccessReview create_self_subject_access_review(body, pretty=pretty)



Expand All @@ -92,10 +92,10 @@ body = k8sclient.V1beta1SelfSubjectAccessReview() # V1beta1SelfSubjectAccessRevi
pretty = 'pretty_example' # str | If 'true', then the output is pretty printed. (optional)

try:
api_response = api_instance.create_authorization_v1beta1_self_subject_access_review(body, pretty=pretty)
api_response = api_instance.create_self_subject_access_review(body, pretty=pretty)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthorizationV1beta1Api->create_authorization_v1beta1_self_subject_access_review: %s\n" % e)
print("Exception when calling AuthorizationV1beta1Api->create_self_subject_access_review: %s\n" % e)
```

### Parameters
Expand All @@ -120,8 +120,8 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **create_authorization_v1beta1_subject_access_review**
> V1beta1SubjectAccessReview create_authorization_v1beta1_subject_access_review(body, pretty=pretty)
# **create_subject_access_review**
> V1beta1SubjectAccessReview create_subject_access_review(body, pretty=pretty)



Expand All @@ -146,10 +146,10 @@ body = k8sclient.V1beta1SubjectAccessReview() # V1beta1SubjectAccessReview |
pretty = 'pretty_example' # str | If 'true', then the output is pretty printed. (optional)

try:
api_response = api_instance.create_authorization_v1beta1_subject_access_review(body, pretty=pretty)
api_response = api_instance.create_subject_access_review(body, pretty=pretty)
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthorizationV1beta1Api->create_authorization_v1beta1_subject_access_review: %s\n" % e)
print("Exception when calling AuthorizationV1beta1Api->create_subject_access_review: %s\n" % e)
```

### Parameters
Expand All @@ -174,8 +174,8 @@ Name | Type | Description | Notes

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_authorization_v1beta1_api_resources**
> UnversionedAPIResourceList get_authorization_v1beta1_api_resources()
# **get_api_resources**
> UnversionedAPIResourceList get_api_resources()



Expand All @@ -198,10 +198,10 @@ k8sclient.configuration.api_key['authorization'] = 'YOUR_API_KEY'
api_instance = k8sclient.AuthorizationV1beta1Api()

try:
api_response = api_instance.get_authorization_v1beta1_api_resources()
api_response = api_instance.get_api_resources()
pprint(api_response)
except ApiException as e:
print("Exception when calling AuthorizationV1beta1Api->get_authorization_v1beta1_api_resources: %s\n" % e)
print("Exception when calling AuthorizationV1beta1Api->get_api_resources: %s\n" % e)
```

### Parameters
Expand Down
10 changes: 5 additions & 5 deletions docs/AutoscalingApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ All URIs are relative to *https://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_autoscaling_api_group**](AutoscalingApi.md#get_autoscaling_api_group) | **GET** /apis/autoscaling/ |
[**get_api_group**](AutoscalingApi.md#get_api_group) | **GET** /apis/autoscaling/ |


# **get_autoscaling_api_group**
> UnversionedAPIGroup get_autoscaling_api_group()
# **get_api_group**
> UnversionedAPIGroup get_api_group()



Expand All @@ -31,10 +31,10 @@ k8sclient.configuration.api_key['authorization'] = 'YOUR_API_KEY'
api_instance = k8sclient.AutoscalingApi()

try:
api_response = api_instance.get_autoscaling_api_group()
api_response = api_instance.get_api_group()
pprint(api_response)
except ApiException as e:
print("Exception when calling AutoscalingApi->get_autoscaling_api_group: %s\n" % e)
print("Exception when calling AutoscalingApi->get_api_group: %s\n" % e)
```

### Parameters
Expand Down
Loading