-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[WIP] feat: client generated by openapi-generator #738
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Requested Commit: v3.3.4 | ||
Actual Commit: 2353d71d4b02be6dbabe25aac1a9e56eb3b812a2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since its been a while can you bump this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also just curious, how often would the version need to be bumped in the future? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe that we rarely bump the version of swagger-codegen right now. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.3.4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
b91982e3c7d98cbe1b39dc348ce2ba7499db73e8007b0d2a9ce4d633c564b272 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# kubernetes.client | ||
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) | ||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
|
||
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: | ||
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: | ||
|
||
- API version: v1.13.1 | ||
- API version: v1.13.3 | ||
- Package version: 9.0.0-snapshot | ||
- Build package: io.swagger.codegen.languages.PythonClientCodegen | ||
- Build package: org.openapitools.codegen.languages.PythonClientCodegen | ||
|
||
## Requirements. | ||
|
||
|
@@ -17,9 +17,9 @@ Python 2.7 and 3.4+ | |
If the python package is hosted on Github, you can install directly from Github | ||
|
||
```sh | ||
pip install git+https://github.com/kubernetes-client/python.git | ||
pip install git+https://github.com/kubernetes-kubernetes.client/python.git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these changed to this weird URL? |
||
``` | ||
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/kubernetes-client/python.git`) | ||
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/kubernetes-kubernetes.client/python.git`) | ||
|
||
Then import the package: | ||
```python | ||
|
@@ -52,11 +52,13 @@ from kubernetes.client.rest import ApiException | |
from pprint import pprint | ||
|
||
# Configure API key authorization: BearerToken | ||
kubernetes.client.configuration.api_key['authorization'] = 'YOUR_API_KEY' | ||
configuration = kubernetes.client.Configuration() | ||
configuration.api_key['authorization'] = 'YOUR_API_KEY' | ||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed | ||
# kubernetes.client.configuration.api_key_prefix['authorization'] = 'Bearer' | ||
# configuration.api_key_prefix['authorization'] = 'Bearer' | ||
|
||
# create an instance of the API class | ||
api_instance = kubernetes.client.AdmissionregistrationApi() | ||
api_instance = kubernetes.client.AdmissionregistrationApi(kubernetes.client.ApiClient(configuration)) | ||
|
||
try: | ||
api_response = api_instance.get_api_group() | ||
|
@@ -68,7 +70,7 @@ except ApiException as e: | |
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *https://localhost* | ||
All URIs are relative to *http://localhost* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also curious why it's http now instead of https? |
||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
|
@@ -1511,3 +1513,4 @@ Class | Method | HTTP request | Description | |
|
||
|
||
|
||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
from __future__ import absolute_import | ||
|
||
# flake8: noqa | ||
|
||
# import apis into api package | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This packages is renamed from apis to api. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity, why did you change it from apis to api? |
||
from kubernetes.client.api.admissionregistration_api import AdmissionregistrationApi | ||
from kubernetes.client.api.admissionregistration_v1alpha1_api import AdmissionregistrationV1alpha1Api | ||
from kubernetes.client.api.admissionregistration_v1beta1_api import AdmissionregistrationV1beta1Api | ||
from kubernetes.client.api.apiextensions_api import ApiextensionsApi | ||
from kubernetes.client.api.apiextensions_v1beta1_api import ApiextensionsV1beta1Api | ||
from kubernetes.client.api.apiregistration_api import ApiregistrationApi | ||
from kubernetes.client.api.apiregistration_v1_api import ApiregistrationV1Api | ||
from kubernetes.client.api.apiregistration_v1beta1_api import ApiregistrationV1beta1Api | ||
from kubernetes.client.api.apis_api import ApisApi | ||
from kubernetes.client.api.apps_api import AppsApi | ||
from kubernetes.client.api.apps_v1_api import AppsV1Api | ||
from kubernetes.client.api.apps_v1beta1_api import AppsV1beta1Api | ||
from kubernetes.client.api.apps_v1beta2_api import AppsV1beta2Api | ||
from kubernetes.client.api.auditregistration_api import AuditregistrationApi | ||
from kubernetes.client.api.auditregistration_v1alpha1_api import AuditregistrationV1alpha1Api | ||
from kubernetes.client.api.authentication_api import AuthenticationApi | ||
from kubernetes.client.api.authentication_v1_api import AuthenticationV1Api | ||
from kubernetes.client.api.authentication_v1beta1_api import AuthenticationV1beta1Api | ||
from kubernetes.client.api.authorization_api import AuthorizationApi | ||
from kubernetes.client.api.authorization_v1_api import AuthorizationV1Api | ||
from kubernetes.client.api.authorization_v1beta1_api import AuthorizationV1beta1Api | ||
from kubernetes.client.api.autoscaling_api import AutoscalingApi | ||
from kubernetes.client.api.autoscaling_v1_api import AutoscalingV1Api | ||
from kubernetes.client.api.autoscaling_v2beta1_api import AutoscalingV2beta1Api | ||
from kubernetes.client.api.autoscaling_v2beta2_api import AutoscalingV2beta2Api | ||
from kubernetes.client.api.batch_api import BatchApi | ||
from kubernetes.client.api.batch_v1_api import BatchV1Api | ||
from kubernetes.client.api.batch_v1beta1_api import BatchV1beta1Api | ||
from kubernetes.client.api.batch_v2alpha1_api import BatchV2alpha1Api | ||
from kubernetes.client.api.certificates_api import CertificatesApi | ||
from kubernetes.client.api.certificates_v1beta1_api import CertificatesV1beta1Api | ||
from kubernetes.client.api.coordination_api import CoordinationApi | ||
from kubernetes.client.api.coordination_v1beta1_api import CoordinationV1beta1Api | ||
from kubernetes.client.api.core_api import CoreApi | ||
from kubernetes.client.api.core_v1_api import CoreV1Api | ||
from kubernetes.client.api.custom_objects_api import CustomObjectsApi | ||
from kubernetes.client.api.events_api import EventsApi | ||
from kubernetes.client.api.events_v1beta1_api import EventsV1beta1Api | ||
from kubernetes.client.api.extensions_api import ExtensionsApi | ||
from kubernetes.client.api.extensions_v1beta1_api import ExtensionsV1beta1Api | ||
from kubernetes.client.api.logs_api import LogsApi | ||
from kubernetes.client.api.networking_api import NetworkingApi | ||
from kubernetes.client.api.networking_v1_api import NetworkingV1Api | ||
from kubernetes.client.api.policy_api import PolicyApi | ||
from kubernetes.client.api.policy_v1beta1_api import PolicyV1beta1Api | ||
from kubernetes.client.api.rbac_authorization_api import RbacAuthorizationApi | ||
from kubernetes.client.api.rbac_authorization_v1_api import RbacAuthorizationV1Api | ||
from kubernetes.client.api.rbac_authorization_v1alpha1_api import RbacAuthorizationV1alpha1Api | ||
from kubernetes.client.api.rbac_authorization_v1beta1_api import RbacAuthorizationV1beta1Api | ||
from kubernetes.client.api.scheduling_api import SchedulingApi | ||
from kubernetes.client.api.scheduling_v1alpha1_api import SchedulingV1alpha1Api | ||
from kubernetes.client.api.scheduling_v1beta1_api import SchedulingV1beta1Api | ||
from kubernetes.client.api.settings_api import SettingsApi | ||
from kubernetes.client.api.settings_v1alpha1_api import SettingsV1alpha1Api | ||
from kubernetes.client.api.storage_api import StorageApi | ||
from kubernetes.client.api.storage_v1_api import StorageV1Api | ||
from kubernetes.client.api.storage_v1alpha1_api import StorageV1alpha1Api | ||
from kubernetes.client.api.storage_v1beta1_api import StorageV1beta1Api | ||
from kubernetes.client.api.version_api import VersionApi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
Kubernetes | ||
|
||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 | ||
|
||
OpenAPI spec version: v1.13.3 | ||
Generated by: https://openapi-generator.tech | ||
""" | ||
|
||
|
||
from __future__ import absolute_import | ||
|
||
import re # noqa: F401 | ||
|
||
# python 2 and python 3 compatibility library | ||
import six | ||
|
||
from kubernetes.client.api_client import ApiClient | ||
|
||
|
||
class AdmissionregistrationApi(object): | ||
"""NOTE: This class is auto generated by OpenAPI Generator | ||
Ref: https://openapi-generator.tech | ||
|
||
Do not edit the class manually. | ||
""" | ||
|
||
def __init__(self, api_client=None): | ||
if api_client is None: | ||
api_client = ApiClient() | ||
self.api_client = api_client | ||
|
||
def get_api_group(self, **kwargs): # noqa: E501 | ||
"""get_api_group # noqa: E501 | ||
|
||
get information of a group # noqa: E501 | ||
This method makes a synchronous HTTP request by default. To make an | ||
asynchronous HTTP request, please pass async_req=True | ||
>>> thread = api.get_api_group(async_req=True) | ||
>>> result = thread.get() | ||
|
||
:param async_req bool | ||
:return: V1APIGroup | ||
If the method is called asynchronously, | ||
returns the request thread. | ||
""" | ||
kwargs['_return_http_data_only'] = True | ||
if kwargs.get('async_req'): | ||
return self.get_api_group_with_http_info(**kwargs) # noqa: E501 | ||
else: | ||
(data) = self.get_api_group_with_http_info(**kwargs) # noqa: E501 | ||
return data | ||
|
||
def get_api_group_with_http_info(self, **kwargs): # noqa: E501 | ||
"""get_api_group # noqa: E501 | ||
|
||
get information of a group # noqa: E501 | ||
This method makes a synchronous HTTP request by default. To make an | ||
asynchronous HTTP request, please pass async_req=True | ||
>>> thread = api.get_api_group_with_http_info(async_req=True) | ||
>>> result = thread.get() | ||
|
||
:param async_req bool | ||
:return: V1APIGroup | ||
If the method is called asynchronously, | ||
returns the request thread. | ||
""" | ||
|
||
local_var_params = locals() | ||
|
||
all_params = [] # noqa: E501 | ||
all_params.append('async_req') | ||
all_params.append('_return_http_data_only') | ||
all_params.append('_preload_content') | ||
all_params.append('_request_timeout') | ||
|
||
for key, val in six.iteritems(local_var_params['kwargs']): | ||
if key not in all_params: | ||
raise TypeError( | ||
"Got an unexpected keyword argument '%s'" | ||
" to method get_api_group" % key | ||
) | ||
local_var_params[key] = val | ||
del local_var_params['kwargs'] | ||
|
||
collection_formats = {} | ||
|
||
path_params = {} | ||
|
||
query_params = [] | ||
|
||
header_params = {} | ||
|
||
form_params = [] | ||
local_var_files = {} | ||
|
||
body_params = None | ||
# HTTP header `Accept` | ||
header_params['Accept'] = self.api_client.select_header_accept( | ||
['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 | ||
|
||
# Authentication setting | ||
auth_settings = ['BearerToken'] # noqa: E501 | ||
|
||
return self.api_client.call_api( | ||
'/apis/admissionregistration.k8s.io/', 'GET', | ||
path_params, | ||
query_params, | ||
header_params, | ||
body=body_params, | ||
post_params=form_params, | ||
files=local_var_files, | ||
response_type='V1APIGroup', # noqa: E501 | ||
auth_settings=auth_settings, | ||
async_req=local_var_params.get('async_req'), | ||
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 | ||
_preload_content=local_var_params.get('_preload_content', True), | ||
_request_timeout=local_var_params.get('_request_timeout'), | ||
collection_formats=collection_formats) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubernete/.swagger-codegen
is deleted, openapi-generator useskubernetes/.openapi-generator
and also.openapi-generator-ignore
instead of.swagger-codegen-ignore
(renamed).