@@ -14,7 +14,7 @@ Python 2.7 and 3.4+
14
14
## Installation & Usage
15
15
### pip install
16
16
17
- If the python package is hosted on Github , you can install directly from Github
17
+ If the python package is hosted on a repository , you can install directly using:
18
18
19
19
``` sh
20
20
pip install git+https://github.com/kubernetes-client/python.git
@@ -23,7 +23,7 @@ pip install git+https://github.com/kubernetes-client/python.git
23
23
24
24
Then import the package:
25
25
``` python
26
- import kubernetes.client
26
+ import kubernetes.client
27
27
```
28
28
29
29
### Setuptools
@@ -51,21 +51,28 @@ import kubernetes.client
51
51
from kubernetes.client.rest import ApiException
52
52
from pprint import pprint
53
53
54
- # Configure API key authorization: BearerToken
55
54
configuration = kubernetes.client.Configuration()
55
+ # Configure API key authorization: BearerToken
56
56
configuration.api_key[' authorization' ] = ' YOUR_API_KEY'
57
57
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
58
58
# configuration.api_key_prefix['authorization'] = 'Bearer'
59
59
60
- # create an instance of the API class
61
- api_instance = kubernetes.client.AdmissionregistrationApi(kubernetes.client.ApiClient(configuration))
62
-
63
- try :
64
- api_response = api_instance.get_api_group()
65
- pprint(api_response)
66
- except ApiException as e:
67
- print (" Exception when calling AdmissionregistrationApi->get_api_group: %s \n " % e)
60
+ # Defining host is optional and default to http://localhost
61
+ configuration.host = " http://localhost"
68
62
63
+ # Defining host is optional and default to http://localhost
64
+ configuration.host = " http://localhost"
65
+ # Enter a context with an instance of the API kubernetes.client
66
+ with kubernetes.client.ApiClient(configuration) as api_client:
67
+ # Create an instance of the API class
68
+ api_instance = kubernetes.client.AdmissionregistrationApi(api_client)
69
+
70
+ try :
71
+ api_response = api_instance.get_api_group()
72
+ pprint(api_response)
73
+ except ApiException as e:
74
+ print (" Exception when calling AdmissionregistrationApi->get_api_group: %s \n " % e)
75
+
69
76
```
70
77
71
78
## Documentation for API Endpoints
@@ -648,10 +655,10 @@ Class | Method | HTTP request | Description
648
655
* CoreV1Api* | [ ** replace_persistent_volume_status** ] ( docs/CoreV1Api.md#replace_persistent_volume_status ) | ** PUT** /api/v1/persistentvolumes/{name}/status |
649
656
* CustomObjectsApi* | [ ** create_cluster_custom_object** ] ( docs/CustomObjectsApi.md#create_cluster_custom_object ) | ** POST** /apis/{group}/{version}/{plural} |
650
657
* CustomObjectsApi* | [ ** create_namespaced_custom_object** ] ( docs/CustomObjectsApi.md#create_namespaced_custom_object ) | ** POST** /apis/{group}/{version}/namespaces/{namespace}/{plural} |
651
- * CustomObjectsApi* | [ ** delete_cluster_custom_object** ] ( docs/CustomObjectsApi.md#delete_cluster_custom_object ) | ** DELETE** /apis/{group}/{version}/{plural} |
652
- * CustomObjectsApi* | [ ** delete_cluster_custom_object_0 ** ] ( docs/CustomObjectsApi.md#delete_cluster_custom_object_0 ) | ** DELETE** /apis/{group}/{version}/{plural}/{name } |
653
- * CustomObjectsApi* | [ ** delete_namespaced_custom_object ** ] ( docs/CustomObjectsApi.md#delete_namespaced_custom_object ) | ** DELETE** /apis/{group}/{version}/namespaces/{namespace}/{plural} |
654
- * CustomObjectsApi* | [ ** delete_namespaced_custom_object_0 ** ] ( docs/CustomObjectsApi.md#delete_namespaced_custom_object_0 ) | ** DELETE** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} |
658
+ * CustomObjectsApi* | [ ** delete_cluster_custom_object** ] ( docs/CustomObjectsApi.md#delete_cluster_custom_object ) | ** DELETE** /apis/{group}/{version}/{plural}/{name} |
659
+ * CustomObjectsApi* | [ ** delete_collection_cluster_custom_object ** ] ( docs/CustomObjectsApi.md#delete_collection_cluster_custom_object ) | ** DELETE** /apis/{group}/{version}/{plural} |
660
+ * CustomObjectsApi* | [ ** delete_collection_namespaced_custom_object ** ] ( docs/CustomObjectsApi.md#delete_collection_namespaced_custom_object ) | ** DELETE** /apis/{group}/{version}/namespaces/{namespace}/{plural} |
661
+ * CustomObjectsApi* | [ ** delete_namespaced_custom_object ** ] ( docs/CustomObjectsApi.md#delete_namespaced_custom_object ) | ** DELETE** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} |
655
662
* CustomObjectsApi* | [ ** get_cluster_custom_object** ] ( docs/CustomObjectsApi.md#get_cluster_custom_object ) | ** GET** /apis/{group}/{version}/{plural}/{name} |
656
663
* CustomObjectsApi* | [ ** get_cluster_custom_object_scale** ] ( docs/CustomObjectsApi.md#get_cluster_custom_object_scale ) | ** GET** /apis/{group}/{version}/{plural}/{name}/scale |
657
664
* CustomObjectsApi* | [ ** get_cluster_custom_object_status** ] ( docs/CustomObjectsApi.md#get_cluster_custom_object_status ) | ** GET** /apis/{group}/{version}/{plural}/{name}/status |
0 commit comments