diff --git a/doc/source/conf.py b/doc/source/conf.py index 2d1d6acc97..1f8b09d787 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -81,16 +81,19 @@ # html_static_path = ['static'] # Output file base name for HTML help builder. -htmlhelp_basename = '%sdoc' % project +htmlhelp_basename = f'{project}doc' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). latex_documents = [ - ('index', - '%s.tex' % project, - u'%s Documentation' % project, - u'Kubernetes', 'manual'), + ( + 'index', + f'{project}.tex', + f'{project} Documentation', + u'Kubernetes', + 'manual', + ) ] # Example configuration for intersphinx: refer to the Python standard library. diff --git a/examples/deployment_create.py b/examples/deployment_create.py index ba13440ff8..bc8ea0329d 100644 --- a/examples/deployment_create.py +++ b/examples/deployment_create.py @@ -30,7 +30,7 @@ def main(): k8s_apps_v1 = client.AppsV1Api() resp = k8s_apps_v1.create_namespaced_deployment( body=dep, namespace="default") - print("Deployment created. status='%s'" % resp.metadata.name) + print(f"Deployment created. status='{resp.metadata.name}'") if __name__ == '__main__': diff --git a/examples/deployment_crud.py b/examples/deployment_crud.py index 191a235529..ddbc0cbeec 100644 --- a/examples/deployment_crud.py +++ b/examples/deployment_crud.py @@ -36,14 +36,12 @@ def create_deployment_object(): replicas=3, template=template, selector={'matchLabels': {'app': 'nginx'}}) - # Instantiate the deployment object - deployment = client.V1Deployment( + return client.V1Deployment( api_version="apps/v1", kind="Deployment", metadata=client.V1ObjectMeta(name=DEPLOYMENT_NAME), - spec=spec) - - return deployment + spec=spec, + ) def create_deployment(api_instance, deployment): @@ -51,7 +49,7 @@ def create_deployment(api_instance, deployment): api_response = api_instance.create_namespaced_deployment( body=deployment, namespace="default") - print("Deployment created. status='%s'" % str(api_response.status)) + print(f"Deployment created. status='{str(api_response.status)}'") def update_deployment(api_instance, deployment): @@ -62,7 +60,7 @@ def update_deployment(api_instance, deployment): name=DEPLOYMENT_NAME, namespace="default", body=deployment) - print("Deployment updated. status='%s'" % str(api_response.status)) + print(f"Deployment updated. status='{str(api_response.status)}'") def delete_deployment(api_instance): @@ -73,7 +71,7 @@ def delete_deployment(api_instance): body=client.V1DeleteOptions( propagation_policy='Foreground', grace_period_seconds=5)) - print("Deployment deleted. status='%s'" % str(api_response.status)) + print(f"Deployment deleted. status='{str(api_response.status)}'") def main(): diff --git a/examples/job_crud.py b/examples/job_crud.py index b18b152d4d..7aba7d01f4 100644 --- a/examples/job_crud.py +++ b/examples/job_crud.py @@ -39,21 +39,19 @@ def create_job_object(): spec = client.V1JobSpec( template=template, backoff_limit=4) - # Instantiate the job object - job = client.V1Job( + return client.V1Job( api_version="batch/v1", kind="Job", metadata=client.V1ObjectMeta(name=JOB_NAME), - spec=spec) - - return job + spec=spec, + ) def create_job(api_instance, job): api_response = api_instance.create_namespaced_job( body=job, namespace="default") - print("Job created. status='%s'" % str(api_response.status)) + print(f"Job created. status='{str(api_response.status)}'") def update_job(api_instance, job): @@ -63,7 +61,7 @@ def update_job(api_instance, job): name=JOB_NAME, namespace="default", body=job) - print("Job updated. status='%s'" % str(api_response.status)) + print(f"Job updated. status='{str(api_response.status)}'") def delete_job(api_instance): @@ -73,7 +71,7 @@ def delete_job(api_instance): body=client.V1DeleteOptions( propagation_policy='Foreground', grace_period_seconds=5)) - print("Job deleted. status='%s'" % str(api_response.status)) + print(f"Job deleted. status='{str(api_response.status)}'") def main(): diff --git a/examples/pick_kube_config_context.py b/examples/pick_kube_config_context.py index 962639669b..b0b8e951fc 100644 --- a/examples/pick_kube_config_context.py +++ b/examples/pick_kube_config_context.py @@ -36,7 +36,7 @@ def main(): # utility config.load_kube_config(context=option) - print("Active host is %s" % configuration.Configuration().host) + print(f"Active host is {configuration.Configuration().host}") v1 = client.CoreV1Api() print("Listing pods with their IPs:") diff --git a/examples/pod_config_list.py b/examples/pod_config_list.py index 09bbde9b69..1493a8c1d7 100644 --- a/examples/pod_config_list.py +++ b/examples/pod_config_list.py @@ -37,7 +37,7 @@ def main(): # utility config.load_kube_config(context=option) - print("Active host is %s" % configuration.Configuration().host) + print(f"Active host is {configuration.Configuration().host}") v1 = client.CoreV1Api() print("Listing pods with their IPs:") diff --git a/examples/pod_exec.py b/examples/pod_exec.py index 6a4bf6bdb5..71f22112b3 100644 --- a/examples/pod_exec.py +++ b/examples/pod_exec.py @@ -33,11 +33,11 @@ def exec_commands(api_instance): namespace='default') except ApiException as e: if e.status != 404: - print("Unknown error: %s" % e) + print(f"Unknown error: {e}") exit(1) if not resp: - print("Pod %s does not exist. Creating it..." % name) + print(f"Pod {name} does not exist. Creating it...") pod_manifest = { 'apiVersion': 'v1', 'kind': 'Pod', @@ -77,7 +77,7 @@ def exec_commands(api_instance): command=exec_command, stderr=True, stdin=False, stdout=True, tty=False) - print("Response: " + resp) + print(f"Response: {resp}") # Calling exec interactively exec_command = ['/bin/sh'] @@ -96,22 +96,21 @@ def exec_commands(api_instance): while resp.is_open(): resp.update(timeout=1) if resp.peek_stdout(): - print("STDOUT: %s" % resp.read_stdout()) + print(f"STDOUT: {resp.read_stdout()}") if resp.peek_stderr(): - print("STDERR: %s" % resp.read_stderr()) - if commands: - c = commands.pop(0) - print("Running command... %s\n" % c) - resp.write_stdin(c + "\n") - else: + print(f"STDERR: {resp.read_stderr()}") + if not commands: break + c = commands.pop(0) + print("Running command... %s\n" % c) + resp.write_stdin(c + "\n") resp.write_stdin("date\n") sdate = resp.readline_stdout(timeout=3) - print("Server date command returns: %s" % sdate) + print(f"Server date command returns: {sdate}") resp.write_stdin("whoami\n") user = resp.readline_stdout(timeout=3) - print("Server user is: %s" % user) + print(f"Server user is: {user}") resp.close() diff --git a/examples/pod_namespace_watch.py b/examples/pod_namespace_watch.py index f09768cf7d..9bb09a8a46 100644 --- a/examples/pod_namespace_watch.py +++ b/examples/pod_namespace_watch.py @@ -32,17 +32,15 @@ def main(): count = 10 w = watch.Watch() for event in w.stream(v1.list_namespace, timeout_seconds=10): - print("Event: %s %s" % (event['type'], event['object'].metadata.name)) + print(f"Event: {event['type']} {event['object'].metadata.name}") count -= 1 if not count: w.stop() print("Finished namespace stream.") for event in w.stream(v1.list_pod_for_all_namespaces, timeout_seconds=10): - print("Event: %s %s %s" % ( - event['type'], - event['object'].kind, - event['object'].metadata.name) + print( + f"Event: {event['type']} {event['object'].kind} {event['object'].metadata.name}" ) count -= 1 if not count: diff --git a/examples/remote_cluster.py b/examples/remote_cluster.py index b72b39b4e9..c28ddf3675 100644 --- a/examples/remote_cluster.py +++ b/examples/remote_cluster.py @@ -40,7 +40,7 @@ def main(): # ssl_ca_cert is the filepath to the file that contains the certificate. # configuration.ssl_ca_cert="certificate" - aConfiguration.api_key = {"authorization": "Bearer " + aToken} + aConfiguration.api_key = {"authorization": f"Bearer {aToken}"} # Create a ApiClient with our config aApiClient = client.ApiClient(aConfiguration) diff --git a/kubernetes/client/api/admissionregistration_api.py b/kubernetes/client/api/admissionregistration_api.py index 1d10bf546a..bcd421147a 100644 --- a/kubernetes/client/api/admissionregistration_api.py +++ b/kubernetes/client/api/admissionregistration_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def get_api_group(self, **kwargs): # noqa: E501 + def get_api_group(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -47,13 +47,9 @@ def get_api_group(self, **kwargs): # noqa: E501 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 + return self.get_api_group_with_http_info(**kwargs) # noqa: E501 - def get_api_group_with_http_info(self, **kwargs): # noqa: E501 + def get_api_group_with_http_info(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -70,40 +66,41 @@ def get_api_group_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 + f"Got an unexpected keyword argument '{key}' to method get_api_group" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/admissionregistration.k8s.io/', 'GET', path_params, diff --git a/kubernetes/client/api/admissionregistration_v1beta1_api.py b/kubernetes/client/api/admissionregistration_v1beta1_api.py index 7c4d73fcba..dfb7374d50 100644 --- a/kubernetes/client/api/admissionregistration_v1beta1_api.py +++ b/kubernetes/client/api/admissionregistration_v1beta1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_mutating_webhook_configuration(self, body, **kwargs): # noqa: E501 + def create_mutating_webhook_configuration(self, body, **kwargs): # noqa: E501 """create_mutating_webhook_configuration # noqa: E501 create a MutatingWebhookConfiguration # noqa: E501 @@ -51,13 +51,9 @@ def create_mutating_webhook_configuration(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_mutating_webhook_configuration_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_mutating_webhook_configuration_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_mutating_webhook_configuration_with_http_info(body, **kwargs) # noqa: E501 - def create_mutating_webhook_configuration_with_http_info(self, body, **kwargs): # noqa: E501 + def create_mutating_webhook_configuration_with_http_info(self, body, **kwargs): # noqa: E501 """create_mutating_webhook_configuration # noqa: E501 create a MutatingWebhookConfiguration # noqa: E501 @@ -78,17 +74,20 @@ def create_mutating_webhook_configuration_with_http_info(self, body, **kwargs): local_var_params = locals() - all_params = ['body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_mutating_webhook_configuration" % key + f"Got an unexpected keyword argument '{key}' to method create_mutating_webhook_configuration" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -97,8 +96,6 @@ def create_mutating_webhook_configuration_with_http_info(self, body, **kwargs): local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_mutating_webhook_configuration`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -109,21 +106,24 @@ def create_mutating_webhook_configuration_with_http_info(self, body, **kwargs): if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations', 'POST', path_params, @@ -140,7 +140,7 @@ def create_mutating_webhook_configuration_with_http_info(self, body, **kwargs): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_validating_webhook_configuration(self, body, **kwargs): # noqa: E501 + def create_validating_webhook_configuration(self, body, **kwargs): # noqa: E501 """create_validating_webhook_configuration # noqa: E501 create a ValidatingWebhookConfiguration # noqa: E501 @@ -159,13 +159,9 @@ def create_validating_webhook_configuration(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_validating_webhook_configuration_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_validating_webhook_configuration_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_validating_webhook_configuration_with_http_info(body, **kwargs) # noqa: E501 - def create_validating_webhook_configuration_with_http_info(self, body, **kwargs): # noqa: E501 + def create_validating_webhook_configuration_with_http_info(self, body, **kwargs): # noqa: E501 """create_validating_webhook_configuration # noqa: E501 create a ValidatingWebhookConfiguration # noqa: E501 @@ -186,17 +182,20 @@ def create_validating_webhook_configuration_with_http_info(self, body, **kwargs) local_var_params = locals() - all_params = ['body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_validating_webhook_configuration" % key + f"Got an unexpected keyword argument '{key}' to method create_validating_webhook_configuration" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -205,8 +204,6 @@ def create_validating_webhook_configuration_with_http_info(self, body, **kwargs) local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_validating_webhook_configuration`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -217,21 +214,24 @@ def create_validating_webhook_configuration_with_http_info(self, body, **kwargs) if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations', 'POST', path_params, @@ -248,7 +248,7 @@ def create_validating_webhook_configuration_with_http_info(self, body, **kwargs) _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_mutating_webhook_configuration(self, **kwargs): # noqa: E501 + def delete_collection_mutating_webhook_configuration(self, **kwargs): # noqa: E501 """delete_collection_mutating_webhook_configuration # noqa: E501 delete collection of MutatingWebhookConfiguration # noqa: E501 @@ -277,13 +277,9 @@ def delete_collection_mutating_webhook_configuration(self, **kwargs): # noqa: E returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_mutating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.delete_collection_mutating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - return data + return self.delete_collection_mutating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - def delete_collection_mutating_webhook_configuration_with_http_info(self, **kwargs): # noqa: E501 + def delete_collection_mutating_webhook_configuration_with_http_info(self, **kwargs): # noqa: E501 """delete_collection_mutating_webhook_configuration # noqa: E501 delete collection of MutatingWebhookConfiguration # noqa: E501 @@ -314,17 +310,30 @@ def delete_collection_mutating_webhook_configuration_with_http_info(self, **kwar local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_mutating_webhook_configuration" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_mutating_webhook_configuration" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -361,18 +370,19 @@ def delete_collection_mutating_webhook_configuration_with_http_info(self, **kwar if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -392,7 +402,7 @@ def delete_collection_mutating_webhook_configuration_with_http_info(self, **kwar _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_validating_webhook_configuration(self, **kwargs): # noqa: E501 + def delete_collection_validating_webhook_configuration(self, **kwargs): # noqa: E501 """delete_collection_validating_webhook_configuration # noqa: E501 delete collection of ValidatingWebhookConfiguration # noqa: E501 @@ -421,13 +431,9 @@ def delete_collection_validating_webhook_configuration(self, **kwargs): # noqa: returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_validating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.delete_collection_validating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - return data + return self.delete_collection_validating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - def delete_collection_validating_webhook_configuration_with_http_info(self, **kwargs): # noqa: E501 + def delete_collection_validating_webhook_configuration_with_http_info(self, **kwargs): # noqa: E501 """delete_collection_validating_webhook_configuration # noqa: E501 delete collection of ValidatingWebhookConfiguration # noqa: E501 @@ -458,17 +464,30 @@ def delete_collection_validating_webhook_configuration_with_http_info(self, **kw local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_validating_webhook_configuration" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_validating_webhook_configuration" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -505,18 +524,19 @@ def delete_collection_validating_webhook_configuration_with_http_info(self, **kw if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -536,7 +556,7 @@ def delete_collection_validating_webhook_configuration_with_http_info(self, **kw _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_mutating_webhook_configuration(self, name, **kwargs): # noqa: E501 + def delete_mutating_webhook_configuration(self, name, **kwargs): # noqa: E501 """delete_mutating_webhook_configuration # noqa: E501 delete a MutatingWebhookConfiguration # noqa: E501 @@ -558,13 +578,9 @@ def delete_mutating_webhook_configuration(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_mutating_webhook_configuration_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.delete_mutating_webhook_configuration_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.delete_mutating_webhook_configuration_with_http_info(name, **kwargs) # noqa: E501 - def delete_mutating_webhook_configuration_with_http_info(self, name, **kwargs): # noqa: E501 + def delete_mutating_webhook_configuration_with_http_info(self, name, **kwargs): # noqa: E501 """delete_mutating_webhook_configuration # noqa: E501 delete a MutatingWebhookConfiguration # noqa: E501 @@ -588,17 +604,23 @@ def delete_mutating_webhook_configuration_with_http_info(self, name, **kwargs): local_var_params = locals() - all_params = ['name', 'pretty', 'dry_run', 'grace_period_seconds', 'orphan_dependents', 'propagation_policy', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'body', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_mutating_webhook_configuration" % key + f"Got an unexpected keyword argument '{key}' to method delete_mutating_webhook_configuration" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -609,10 +631,7 @@ def delete_mutating_webhook_configuration_with_http_info(self, name, **kwargs): collection_formats = {} - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - + path_params = {'name': local_var_params['name']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -625,18 +644,19 @@ def delete_mutating_webhook_configuration_with_http_info(self, name, **kwargs): if 'propagation_policy' in local_var_params: query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('body') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -656,7 +676,7 @@ def delete_mutating_webhook_configuration_with_http_info(self, name, **kwargs): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_validating_webhook_configuration(self, name, **kwargs): # noqa: E501 + def delete_validating_webhook_configuration(self, name, **kwargs): # noqa: E501 """delete_validating_webhook_configuration # noqa: E501 delete a ValidatingWebhookConfiguration # noqa: E501 @@ -678,13 +698,9 @@ def delete_validating_webhook_configuration(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_validating_webhook_configuration_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.delete_validating_webhook_configuration_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.delete_validating_webhook_configuration_with_http_info(name, **kwargs) # noqa: E501 - def delete_validating_webhook_configuration_with_http_info(self, name, **kwargs): # noqa: E501 + def delete_validating_webhook_configuration_with_http_info(self, name, **kwargs): # noqa: E501 """delete_validating_webhook_configuration # noqa: E501 delete a ValidatingWebhookConfiguration # noqa: E501 @@ -708,17 +724,23 @@ def delete_validating_webhook_configuration_with_http_info(self, name, **kwargs) local_var_params = locals() - all_params = ['name', 'pretty', 'dry_run', 'grace_period_seconds', 'orphan_dependents', 'propagation_policy', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'body', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_validating_webhook_configuration" % key + f"Got an unexpected keyword argument '{key}' to method delete_validating_webhook_configuration" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -729,10 +751,7 @@ def delete_validating_webhook_configuration_with_http_info(self, name, **kwargs) collection_formats = {} - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - + path_params = {'name': local_var_params['name']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -745,18 +764,19 @@ def delete_validating_webhook_configuration_with_http_info(self, name, **kwargs) if 'propagation_policy' in local_var_params: query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('body') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -776,7 +796,7 @@ def delete_validating_webhook_configuration_with_http_info(self, name, **kwargs) _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -791,13 +811,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -814,40 +830,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/admissionregistration.k8s.io/v1beta1/', 'GET', path_params, @@ -864,7 +881,7 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_mutating_webhook_configuration(self, **kwargs): # noqa: E501 + def list_mutating_webhook_configuration(self, **kwargs): # noqa: E501 """list_mutating_webhook_configuration # noqa: E501 list or watch objects of kind MutatingWebhookConfiguration # noqa: E501 @@ -888,13 +905,9 @@ def list_mutating_webhook_configuration(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_mutating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_mutating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_mutating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - def list_mutating_webhook_configuration_with_http_info(self, **kwargs): # noqa: E501 + def list_mutating_webhook_configuration_with_http_info(self, **kwargs): # noqa: E501 """list_mutating_webhook_configuration # noqa: E501 list or watch objects of kind MutatingWebhookConfiguration # noqa: E501 @@ -920,23 +933,29 @@ def list_mutating_webhook_configuration_with_http_info(self, **kwargs): # noqa: local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_mutating_webhook_configuration" % key + f"Got an unexpected keyword argument '{key}' to method list_mutating_webhook_configuration" ) local_var_params[key] = val del local_var_params['kwargs'] - collection_formats = {} - path_params = {} query_params = [] @@ -959,19 +978,25 @@ def list_mutating_webhook_configuration_with_http_info(self, **kwargs): # noqa: if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations', 'GET', path_params, @@ -988,7 +1013,7 @@ def list_mutating_webhook_configuration_with_http_info(self, **kwargs): # noqa: _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_validating_webhook_configuration(self, **kwargs): # noqa: E501 + def list_validating_webhook_configuration(self, **kwargs): # noqa: E501 """list_validating_webhook_configuration # noqa: E501 list or watch objects of kind ValidatingWebhookConfiguration # noqa: E501 @@ -1012,11 +1037,7 @@ def list_validating_webhook_configuration(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_validating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_validating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_validating_webhook_configuration_with_http_info(**kwargs) # noqa: E501 def list_validating_webhook_configuration_with_http_info(self, **kwargs): # noqa: E501 """list_validating_webhook_configuration # noqa: E501 diff --git a/kubernetes/client/api/apiextensions_api.py b/kubernetes/client/api/apiextensions_api.py index abd74191fd..dd5ba5144d 100644 --- a/kubernetes/client/api/apiextensions_api.py +++ b/kubernetes/client/api/apiextensions_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def get_api_group(self, **kwargs): # noqa: E501 + def get_api_group(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -47,13 +47,9 @@ def get_api_group(self, **kwargs): # noqa: E501 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 + return self.get_api_group_with_http_info(**kwargs) # noqa: E501 - def get_api_group_with_http_info(self, **kwargs): # noqa: E501 + def get_api_group_with_http_info(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -70,40 +66,41 @@ def get_api_group_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 + f"Got an unexpected keyword argument '{key}' to method get_api_group" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiextensions.k8s.io/', 'GET', path_params, diff --git a/kubernetes/client/api/apiextensions_v1beta1_api.py b/kubernetes/client/api/apiextensions_v1beta1_api.py index 7840da9162..ba437a58c7 100644 --- a/kubernetes/client/api/apiextensions_v1beta1_api.py +++ b/kubernetes/client/api/apiextensions_v1beta1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_custom_resource_definition(self, body, **kwargs): # noqa: E501 + def create_custom_resource_definition(self, body, **kwargs): # noqa: E501 """create_custom_resource_definition # noqa: E501 create a CustomResourceDefinition # noqa: E501 @@ -51,13 +51,9 @@ def create_custom_resource_definition(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_custom_resource_definition_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_custom_resource_definition_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_custom_resource_definition_with_http_info(body, **kwargs) # noqa: E501 - def create_custom_resource_definition_with_http_info(self, body, **kwargs): # noqa: E501 + def create_custom_resource_definition_with_http_info(self, body, **kwargs): # noqa: E501 """create_custom_resource_definition # noqa: E501 create a CustomResourceDefinition # noqa: E501 @@ -78,17 +74,20 @@ def create_custom_resource_definition_with_http_info(self, body, **kwargs): # n local_var_params = locals() - all_params = ['body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_custom_resource_definition" % key + f"Got an unexpected keyword argument '{key}' to method create_custom_resource_definition" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -97,8 +96,6 @@ def create_custom_resource_definition_with_http_info(self, body, **kwargs): # n local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_custom_resource_definition`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -109,21 +106,24 @@ def create_custom_resource_definition_with_http_info(self, body, **kwargs): # n if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions', 'POST', path_params, @@ -140,7 +140,7 @@ def create_custom_resource_definition_with_http_info(self, body, **kwargs): # n _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_custom_resource_definition(self, **kwargs): # noqa: E501 + def delete_collection_custom_resource_definition(self, **kwargs): # noqa: E501 """delete_collection_custom_resource_definition # noqa: E501 delete collection of CustomResourceDefinition # noqa: E501 @@ -169,13 +169,9 @@ def delete_collection_custom_resource_definition(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_custom_resource_definition_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.delete_collection_custom_resource_definition_with_http_info(**kwargs) # noqa: E501 - return data + return self.delete_collection_custom_resource_definition_with_http_info(**kwargs) # noqa: E501 - def delete_collection_custom_resource_definition_with_http_info(self, **kwargs): # noqa: E501 + def delete_collection_custom_resource_definition_with_http_info(self, **kwargs): # noqa: E501 """delete_collection_custom_resource_definition # noqa: E501 delete collection of CustomResourceDefinition # noqa: E501 @@ -206,17 +202,30 @@ def delete_collection_custom_resource_definition_with_http_info(self, **kwargs): local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_custom_resource_definition" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_custom_resource_definition" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -253,18 +262,19 @@ def delete_collection_custom_resource_definition_with_http_info(self, **kwargs): if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -284,7 +294,7 @@ def delete_collection_custom_resource_definition_with_http_info(self, **kwargs): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_custom_resource_definition(self, name, **kwargs): # noqa: E501 + def delete_custom_resource_definition(self, name, **kwargs): # noqa: E501 """delete_custom_resource_definition # noqa: E501 delete a CustomResourceDefinition # noqa: E501 @@ -306,13 +316,9 @@ def delete_custom_resource_definition(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_custom_resource_definition_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.delete_custom_resource_definition_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.delete_custom_resource_definition_with_http_info(name, **kwargs) # noqa: E501 - def delete_custom_resource_definition_with_http_info(self, name, **kwargs): # noqa: E501 + def delete_custom_resource_definition_with_http_info(self, name, **kwargs): # noqa: E501 """delete_custom_resource_definition # noqa: E501 delete a CustomResourceDefinition # noqa: E501 @@ -336,17 +342,23 @@ def delete_custom_resource_definition_with_http_info(self, name, **kwargs): # n local_var_params = locals() - all_params = ['name', 'pretty', 'dry_run', 'grace_period_seconds', 'orphan_dependents', 'propagation_policy', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'body', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_custom_resource_definition" % key + f"Got an unexpected keyword argument '{key}' to method delete_custom_resource_definition" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -357,10 +369,7 @@ def delete_custom_resource_definition_with_http_info(self, name, **kwargs): # n collection_formats = {} - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - + path_params = {'name': local_var_params['name']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -373,18 +382,19 @@ def delete_custom_resource_definition_with_http_info(self, name, **kwargs): # n if 'propagation_policy' in local_var_params: query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('body') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -404,7 +414,7 @@ def delete_custom_resource_definition_with_http_info(self, name, **kwargs): # n _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -419,13 +429,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -442,40 +448,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiextensions.k8s.io/v1beta1/', 'GET', path_params, @@ -492,7 +499,7 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_custom_resource_definition(self, **kwargs): # noqa: E501 + def list_custom_resource_definition(self, **kwargs): # noqa: E501 """list_custom_resource_definition # noqa: E501 list or watch objects of kind CustomResourceDefinition # noqa: E501 @@ -516,13 +523,9 @@ def list_custom_resource_definition(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_custom_resource_definition_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_custom_resource_definition_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_custom_resource_definition_with_http_info(**kwargs) # noqa: E501 - def list_custom_resource_definition_with_http_info(self, **kwargs): # noqa: E501 + def list_custom_resource_definition_with_http_info(self, **kwargs): # noqa: E501 """list_custom_resource_definition # noqa: E501 list or watch objects of kind CustomResourceDefinition # noqa: E501 @@ -548,23 +551,29 @@ def list_custom_resource_definition_with_http_info(self, **kwargs): # noqa: E50 local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_custom_resource_definition" % key + f"Got an unexpected keyword argument '{key}' to method list_custom_resource_definition" ) local_var_params[key] = val del local_var_params['kwargs'] - collection_formats = {} - path_params = {} query_params = [] @@ -587,19 +596,25 @@ def list_custom_resource_definition_with_http_info(self, **kwargs): # noqa: E50 if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions', 'GET', path_params, @@ -616,7 +631,7 @@ def list_custom_resource_definition_with_http_info(self, **kwargs): # noqa: E50 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_custom_resource_definition(self, name, body, **kwargs): # noqa: E501 + def patch_custom_resource_definition(self, name, body, **kwargs): # noqa: E501 """patch_custom_resource_definition # noqa: E501 partially update the specified CustomResourceDefinition # noqa: E501 @@ -637,13 +652,9 @@ def patch_custom_resource_definition(self, name, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_custom_resource_definition_with_http_info(name, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_custom_resource_definition_with_http_info(name, body, **kwargs) # noqa: E501 - return data + return self.patch_custom_resource_definition_with_http_info(name, body, **kwargs) # noqa: E501 - def patch_custom_resource_definition_with_http_info(self, name, body, **kwargs): # noqa: E501 + def patch_custom_resource_definition_with_http_info(self, name, body, **kwargs): # noqa: E501 """patch_custom_resource_definition # noqa: E501 partially update the specified CustomResourceDefinition # noqa: E501 @@ -666,17 +677,22 @@ def patch_custom_resource_definition_with_http_info(self, name, body, **kwargs): local_var_params = locals() - all_params = ['name', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_custom_resource_definition" % key + f"Got an unexpected keyword argument '{key}' to method patch_custom_resource_definition" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -689,8 +705,6 @@ def patch_custom_resource_definition_with_http_info(self, name, body, **kwargs): local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_custom_resource_definition`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -705,18 +719,20 @@ def patch_custom_resource_definition_with_http_info(self, name, body, **kwargs): if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -724,6 +740,7 @@ def patch_custom_resource_definition_with_http_info(self, name, body, **kwargs): # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}', 'PATCH', path_params, @@ -740,7 +757,7 @@ def patch_custom_resource_definition_with_http_info(self, name, body, **kwargs): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_custom_resource_definition_status(self, name, body, **kwargs): # noqa: E501 + def patch_custom_resource_definition_status(self, name, body, **kwargs): # noqa: E501 """patch_custom_resource_definition_status # noqa: E501 partially update status of the specified CustomResourceDefinition # noqa: E501 @@ -761,13 +778,9 @@ def patch_custom_resource_definition_status(self, name, body, **kwargs): # noqa returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_custom_resource_definition_status_with_http_info(name, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_custom_resource_definition_status_with_http_info(name, body, **kwargs) # noqa: E501 - return data + return self.patch_custom_resource_definition_status_with_http_info(name, body, **kwargs) # noqa: E501 - def patch_custom_resource_definition_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + def patch_custom_resource_definition_status_with_http_info(self, name, body, **kwargs): # noqa: E501 """patch_custom_resource_definition_status # noqa: E501 partially update status of the specified CustomResourceDefinition # noqa: E501 @@ -790,17 +803,22 @@ def patch_custom_resource_definition_status_with_http_info(self, name, body, **k local_var_params = locals() - all_params = ['name', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_custom_resource_definition_status" % key + f"Got an unexpected keyword argument '{key}' to method patch_custom_resource_definition_status" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -813,8 +831,6 @@ def patch_custom_resource_definition_status_with_http_info(self, name, body, **k local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_custom_resource_definition_status`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -829,18 +845,20 @@ def patch_custom_resource_definition_status_with_http_info(self, name, body, **k if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -848,6 +866,7 @@ def patch_custom_resource_definition_status_with_http_info(self, name, body, **k # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status', 'PATCH', path_params, @@ -864,7 +883,7 @@ def patch_custom_resource_definition_status_with_http_info(self, name, body, **k _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def read_custom_resource_definition(self, name, **kwargs): # noqa: E501 + def read_custom_resource_definition(self, name, **kwargs): # noqa: E501 """read_custom_resource_definition # noqa: E501 read the specified CustomResourceDefinition # noqa: E501 @@ -883,13 +902,9 @@ def read_custom_resource_definition(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.read_custom_resource_definition_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.read_custom_resource_definition_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.read_custom_resource_definition_with_http_info(name, **kwargs) # noqa: E501 - def read_custom_resource_definition_with_http_info(self, name, **kwargs): # noqa: E501 + def read_custom_resource_definition_with_http_info(self, name, **kwargs): # noqa: E501 """read_custom_resource_definition # noqa: E501 read the specified CustomResourceDefinition # noqa: E501 @@ -910,17 +925,20 @@ def read_custom_resource_definition_with_http_info(self, name, **kwargs): # noq local_var_params = locals() - all_params = ['name', 'pretty', 'exact', 'export'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'pretty', + 'exact', + 'export', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 read_custom_resource_definition" % key + f"Got an unexpected keyword argument '{key}' to method read_custom_resource_definition" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -929,12 +947,7 @@ def read_custom_resource_definition_with_http_info(self, name, **kwargs): # noq local_var_params['name'] is None): raise ValueError("Missing the required parameter `name` when calling `read_custom_resource_definition`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - + path_params = {'name': local_var_params['name']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -943,19 +956,23 @@ def read_custom_resource_definition_with_http_info(self, name, **kwargs): # noq if 'export' in local_var_params: query_params.append(('export', local_var_params['export'])) # noqa: E501 - 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}', 'GET', path_params, @@ -972,7 +989,7 @@ def read_custom_resource_definition_with_http_info(self, name, **kwargs): # noq _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def read_custom_resource_definition_status(self, name, **kwargs): # noqa: E501 + def read_custom_resource_definition_status(self, name, **kwargs): # noqa: E501 """read_custom_resource_definition_status # noqa: E501 read status of the specified CustomResourceDefinition # noqa: E501 @@ -989,11 +1006,7 @@ def read_custom_resource_definition_status(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.read_custom_resource_definition_status_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.read_custom_resource_definition_status_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.read_custom_resource_definition_status_with_http_info(name, **kwargs) # noqa: E501 def read_custom_resource_definition_status_with_http_info(self, name, **kwargs): # noqa: E501 """read_custom_resource_definition_status # noqa: E501 diff --git a/kubernetes/client/api/apiregistration_api.py b/kubernetes/client/api/apiregistration_api.py index 2adea183f8..35a2d1715b 100644 --- a/kubernetes/client/api/apiregistration_api.py +++ b/kubernetes/client/api/apiregistration_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def get_api_group(self, **kwargs): # noqa: E501 + def get_api_group(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -47,13 +47,9 @@ def get_api_group(self, **kwargs): # noqa: E501 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 + return self.get_api_group_with_http_info(**kwargs) # noqa: E501 - def get_api_group_with_http_info(self, **kwargs): # noqa: E501 + def get_api_group_with_http_info(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -70,40 +66,41 @@ def get_api_group_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 + f"Got an unexpected keyword argument '{key}' to method get_api_group" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/', 'GET', path_params, diff --git a/kubernetes/client/api/apiregistration_v1_api.py b/kubernetes/client/api/apiregistration_v1_api.py index 0490eb2aae..70e9e7767c 100644 --- a/kubernetes/client/api/apiregistration_v1_api.py +++ b/kubernetes/client/api/apiregistration_v1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_api_service(self, body, **kwargs): # noqa: E501 + def create_api_service(self, body, **kwargs): # noqa: E501 """create_api_service # noqa: E501 create an APIService # noqa: E501 @@ -51,13 +51,9 @@ def create_api_service(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_api_service_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_api_service_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_api_service_with_http_info(body, **kwargs) # noqa: E501 - def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 + def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 """create_api_service # noqa: E501 create an APIService # noqa: E501 @@ -78,17 +74,20 @@ def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_api_service" % key + f"Got an unexpected keyword argument '{key}' to method create_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -97,8 +96,6 @@ def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_api_service`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -109,21 +106,24 @@ def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1/apiservices', 'POST', path_params, @@ -140,7 +140,7 @@ def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_api_service(self, name, **kwargs): # noqa: E501 + def delete_api_service(self, name, **kwargs): # noqa: E501 """delete_api_service # noqa: E501 delete an APIService # noqa: E501 @@ -162,13 +162,9 @@ def delete_api_service(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_api_service_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.delete_api_service_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.delete_api_service_with_http_info(name, **kwargs) # noqa: E501 - def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 + def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 """delete_api_service # noqa: E501 delete an APIService # noqa: E501 @@ -192,17 +188,23 @@ def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['name', 'pretty', 'dry_run', 'grace_period_seconds', 'orphan_dependents', 'propagation_policy', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'body', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_api_service" % key + f"Got an unexpected keyword argument '{key}' to method delete_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -213,10 +215,7 @@ def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 collection_formats = {} - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - + path_params = {'name': local_var_params['name']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -229,18 +228,19 @@ def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 if 'propagation_policy' in local_var_params: query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('body') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -260,7 +260,7 @@ def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_api_service(self, **kwargs): # noqa: E501 + def delete_collection_api_service(self, **kwargs): # noqa: E501 """delete_collection_api_service # noqa: E501 delete collection of APIService # noqa: E501 @@ -289,13 +289,9 @@ def delete_collection_api_service(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_api_service_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.delete_collection_api_service_with_http_info(**kwargs) # noqa: E501 - return data + return self.delete_collection_api_service_with_http_info(**kwargs) # noqa: E501 - def delete_collection_api_service_with_http_info(self, **kwargs): # noqa: E501 + def delete_collection_api_service_with_http_info(self, **kwargs): # noqa: E501 """delete_collection_api_service # noqa: E501 delete collection of APIService # noqa: E501 @@ -326,17 +322,30 @@ def delete_collection_api_service_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_api_service" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -373,18 +382,19 @@ def delete_collection_api_service_with_http_info(self, **kwargs): # noqa: E501 if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -404,7 +414,7 @@ def delete_collection_api_service_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -419,13 +429,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -442,40 +448,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1/', 'GET', path_params, @@ -492,7 +499,7 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_api_service(self, **kwargs): # noqa: E501 + def list_api_service(self, **kwargs): # noqa: E501 """list_api_service # noqa: E501 list or watch objects of kind APIService # noqa: E501 @@ -516,13 +523,9 @@ def list_api_service(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_api_service_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_api_service_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_api_service_with_http_info(**kwargs) # noqa: E501 - def list_api_service_with_http_info(self, **kwargs): # noqa: E501 + def list_api_service_with_http_info(self, **kwargs): # noqa: E501 """list_api_service # noqa: E501 list or watch objects of kind APIService # noqa: E501 @@ -548,23 +551,29 @@ def list_api_service_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_api_service" % key + f"Got an unexpected keyword argument '{key}' to method list_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] - collection_formats = {} - path_params = {} query_params = [] @@ -587,19 +596,25 @@ def list_api_service_with_http_info(self, **kwargs): # noqa: E501 if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1/apiservices', 'GET', path_params, @@ -616,7 +631,7 @@ def list_api_service_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_api_service(self, name, body, **kwargs): # noqa: E501 + def patch_api_service(self, name, body, **kwargs): # noqa: E501 """patch_api_service # noqa: E501 partially update the specified APIService # noqa: E501 @@ -637,13 +652,9 @@ def patch_api_service(self, name, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_api_service_with_http_info(name, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_api_service_with_http_info(name, body, **kwargs) # noqa: E501 - return data + return self.patch_api_service_with_http_info(name, body, **kwargs) # noqa: E501 - def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 + def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 """patch_api_service # noqa: E501 partially update the specified APIService # noqa: E501 @@ -666,17 +677,22 @@ def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['name', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_api_service" % key + f"Got an unexpected keyword argument '{key}' to method patch_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -689,8 +705,6 @@ def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_api_service`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -705,18 +719,20 @@ def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -724,6 +740,7 @@ def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1/apiservices/{name}', 'PATCH', path_params, @@ -740,7 +757,7 @@ def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_api_service_status(self, name, body, **kwargs): # noqa: E501 + def patch_api_service_status(self, name, body, **kwargs): # noqa: E501 """patch_api_service_status # noqa: E501 partially update status of the specified APIService # noqa: E501 @@ -761,13 +778,9 @@ def patch_api_service_status(self, name, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_api_service_status_with_http_info(name, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_api_service_status_with_http_info(name, body, **kwargs) # noqa: E501 - return data + return self.patch_api_service_status_with_http_info(name, body, **kwargs) # noqa: E501 - def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa: E501 """patch_api_service_status # noqa: E501 partially update status of the specified APIService # noqa: E501 @@ -790,17 +803,22 @@ def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa local_var_params = locals() - all_params = ['name', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_api_service_status" % key + f"Got an unexpected keyword argument '{key}' to method patch_api_service_status" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -813,8 +831,6 @@ def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_api_service_status`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -829,18 +845,20 @@ def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -848,6 +866,7 @@ def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status', 'PATCH', path_params, @@ -864,7 +883,7 @@ def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def read_api_service(self, name, **kwargs): # noqa: E501 + def read_api_service(self, name, **kwargs): # noqa: E501 """read_api_service # noqa: E501 read the specified APIService # noqa: E501 @@ -883,13 +902,9 @@ def read_api_service(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.read_api_service_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.read_api_service_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.read_api_service_with_http_info(name, **kwargs) # noqa: E501 - def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 + def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 """read_api_service # noqa: E501 read the specified APIService # noqa: E501 @@ -910,17 +925,20 @@ def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['name', 'pretty', 'exact', 'export'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'pretty', + 'exact', + 'export', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 read_api_service" % key + f"Got an unexpected keyword argument '{key}' to method read_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -929,12 +947,7 @@ def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 local_var_params['name'] is None): raise ValueError("Missing the required parameter `name` when calling `read_api_service`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - + path_params = {'name': local_var_params['name']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -943,19 +956,23 @@ def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 if 'export' in local_var_params: query_params.append(('export', local_var_params['export'])) # noqa: E501 - 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1/apiservices/{name}', 'GET', path_params, @@ -972,7 +989,7 @@ def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def read_api_service_status(self, name, **kwargs): # noqa: E501 + def read_api_service_status(self, name, **kwargs): # noqa: E501 """read_api_service_status # noqa: E501 read status of the specified APIService # noqa: E501 @@ -989,11 +1006,7 @@ def read_api_service_status(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.read_api_service_status_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.read_api_service_status_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.read_api_service_status_with_http_info(name, **kwargs) # noqa: E501 def read_api_service_status_with_http_info(self, name, **kwargs): # noqa: E501 """read_api_service_status # noqa: E501 diff --git a/kubernetes/client/api/apiregistration_v1beta1_api.py b/kubernetes/client/api/apiregistration_v1beta1_api.py index 72ce06f28b..39d07bb770 100644 --- a/kubernetes/client/api/apiregistration_v1beta1_api.py +++ b/kubernetes/client/api/apiregistration_v1beta1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_api_service(self, body, **kwargs): # noqa: E501 + def create_api_service(self, body, **kwargs): # noqa: E501 """create_api_service # noqa: E501 create an APIService # noqa: E501 @@ -51,13 +51,9 @@ def create_api_service(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_api_service_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_api_service_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_api_service_with_http_info(body, **kwargs) # noqa: E501 - def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 + def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 """create_api_service # noqa: E501 create an APIService # noqa: E501 @@ -78,17 +74,20 @@ def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_api_service" % key + f"Got an unexpected keyword argument '{key}' to method create_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -97,8 +96,6 @@ def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_api_service`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -109,21 +106,24 @@ def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1beta1/apiservices', 'POST', path_params, @@ -140,7 +140,7 @@ def create_api_service_with_http_info(self, body, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_api_service(self, name, **kwargs): # noqa: E501 + def delete_api_service(self, name, **kwargs): # noqa: E501 """delete_api_service # noqa: E501 delete an APIService # noqa: E501 @@ -162,13 +162,9 @@ def delete_api_service(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_api_service_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.delete_api_service_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.delete_api_service_with_http_info(name, **kwargs) # noqa: E501 - def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 + def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 """delete_api_service # noqa: E501 delete an APIService # noqa: E501 @@ -192,17 +188,23 @@ def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['name', 'pretty', 'dry_run', 'grace_period_seconds', 'orphan_dependents', 'propagation_policy', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'body', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_api_service" % key + f"Got an unexpected keyword argument '{key}' to method delete_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -213,10 +215,7 @@ def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 collection_formats = {} - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - + path_params = {'name': local_var_params['name']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -229,18 +228,19 @@ def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 if 'propagation_policy' in local_var_params: query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('body') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -260,7 +260,7 @@ def delete_api_service_with_http_info(self, name, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_api_service(self, **kwargs): # noqa: E501 + def delete_collection_api_service(self, **kwargs): # noqa: E501 """delete_collection_api_service # noqa: E501 delete collection of APIService # noqa: E501 @@ -289,13 +289,9 @@ def delete_collection_api_service(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_api_service_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.delete_collection_api_service_with_http_info(**kwargs) # noqa: E501 - return data + return self.delete_collection_api_service_with_http_info(**kwargs) # noqa: E501 - def delete_collection_api_service_with_http_info(self, **kwargs): # noqa: E501 + def delete_collection_api_service_with_http_info(self, **kwargs): # noqa: E501 """delete_collection_api_service # noqa: E501 delete collection of APIService # noqa: E501 @@ -326,17 +322,30 @@ def delete_collection_api_service_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_api_service" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -373,18 +382,19 @@ def delete_collection_api_service_with_http_info(self, **kwargs): # noqa: E501 if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -404,7 +414,7 @@ def delete_collection_api_service_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -419,13 +429,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -442,40 +448,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1beta1/', 'GET', path_params, @@ -492,7 +499,7 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_api_service(self, **kwargs): # noqa: E501 + def list_api_service(self, **kwargs): # noqa: E501 """list_api_service # noqa: E501 list or watch objects of kind APIService # noqa: E501 @@ -516,13 +523,9 @@ def list_api_service(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_api_service_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_api_service_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_api_service_with_http_info(**kwargs) # noqa: E501 - def list_api_service_with_http_info(self, **kwargs): # noqa: E501 + def list_api_service_with_http_info(self, **kwargs): # noqa: E501 """list_api_service # noqa: E501 list or watch objects of kind APIService # noqa: E501 @@ -548,23 +551,29 @@ def list_api_service_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_api_service" % key + f"Got an unexpected keyword argument '{key}' to method list_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] - collection_formats = {} - path_params = {} query_params = [] @@ -587,19 +596,25 @@ def list_api_service_with_http_info(self, **kwargs): # noqa: E501 if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1beta1/apiservices', 'GET', path_params, @@ -616,7 +631,7 @@ def list_api_service_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_api_service(self, name, body, **kwargs): # noqa: E501 + def patch_api_service(self, name, body, **kwargs): # noqa: E501 """patch_api_service # noqa: E501 partially update the specified APIService # noqa: E501 @@ -637,13 +652,9 @@ def patch_api_service(self, name, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_api_service_with_http_info(name, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_api_service_with_http_info(name, body, **kwargs) # noqa: E501 - return data + return self.patch_api_service_with_http_info(name, body, **kwargs) # noqa: E501 - def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 + def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 """patch_api_service # noqa: E501 partially update the specified APIService # noqa: E501 @@ -666,17 +677,22 @@ def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['name', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_api_service" % key + f"Got an unexpected keyword argument '{key}' to method patch_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -689,8 +705,6 @@ def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_api_service`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -705,18 +719,20 @@ def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -724,6 +740,7 @@ def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}', 'PATCH', path_params, @@ -740,7 +757,7 @@ def patch_api_service_with_http_info(self, name, body, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_api_service_status(self, name, body, **kwargs): # noqa: E501 + def patch_api_service_status(self, name, body, **kwargs): # noqa: E501 """patch_api_service_status # noqa: E501 partially update status of the specified APIService # noqa: E501 @@ -761,13 +778,9 @@ def patch_api_service_status(self, name, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_api_service_status_with_http_info(name, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_api_service_status_with_http_info(name, body, **kwargs) # noqa: E501 - return data + return self.patch_api_service_status_with_http_info(name, body, **kwargs) # noqa: E501 - def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa: E501 + def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa: E501 """patch_api_service_status # noqa: E501 partially update status of the specified APIService # noqa: E501 @@ -790,17 +803,22 @@ def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa local_var_params = locals() - all_params = ['name', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_api_service_status" % key + f"Got an unexpected keyword argument '{key}' to method patch_api_service_status" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -813,8 +831,6 @@ def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_api_service_status`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -829,18 +845,20 @@ def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -848,6 +866,7 @@ def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status', 'PATCH', path_params, @@ -864,7 +883,7 @@ def patch_api_service_status_with_http_info(self, name, body, **kwargs): # noqa _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def read_api_service(self, name, **kwargs): # noqa: E501 + def read_api_service(self, name, **kwargs): # noqa: E501 """read_api_service # noqa: E501 read the specified APIService # noqa: E501 @@ -883,13 +902,9 @@ def read_api_service(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.read_api_service_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.read_api_service_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.read_api_service_with_http_info(name, **kwargs) # noqa: E501 - def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 + def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 """read_api_service # noqa: E501 read the specified APIService # noqa: E501 @@ -910,17 +925,20 @@ def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['name', 'pretty', 'exact', 'export'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'pretty', + 'exact', + 'export', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 read_api_service" % key + f"Got an unexpected keyword argument '{key}' to method read_api_service" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -929,12 +947,7 @@ def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 local_var_params['name'] is None): raise ValueError("Missing the required parameter `name` when calling `read_api_service`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - + path_params = {'name': local_var_params['name']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -943,19 +956,23 @@ def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 if 'export' in local_var_params: query_params.append(('export', local_var_params['export'])) # noqa: E501 - 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}', 'GET', path_params, @@ -972,7 +989,7 @@ def read_api_service_with_http_info(self, name, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def read_api_service_status(self, name, **kwargs): # noqa: E501 + def read_api_service_status(self, name, **kwargs): # noqa: E501 """read_api_service_status # noqa: E501 read status of the specified APIService # noqa: E501 @@ -989,11 +1006,7 @@ def read_api_service_status(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.read_api_service_status_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.read_api_service_status_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.read_api_service_status_with_http_info(name, **kwargs) # noqa: E501 def read_api_service_status_with_http_info(self, name, **kwargs): # noqa: E501 """read_api_service_status # noqa: E501 diff --git a/kubernetes/client/api/apis_api.py b/kubernetes/client/api/apis_api.py index ebb7399b6d..6cf36112bf 100644 --- a/kubernetes/client/api/apis_api.py +++ b/kubernetes/client/api/apis_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def get_api_versions(self, **kwargs): # noqa: E501 + def get_api_versions(self, **kwargs): # noqa: E501 """get_api_versions # noqa: E501 get available API versions # noqa: E501 @@ -47,13 +47,9 @@ def get_api_versions(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_versions_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_versions_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_versions_with_http_info(**kwargs) # noqa: E501 - def get_api_versions_with_http_info(self, **kwargs): # noqa: E501 + def get_api_versions_with_http_info(self, **kwargs): # noqa: E501 """get_api_versions # noqa: E501 get available API versions # noqa: E501 @@ -70,40 +66,41 @@ def get_api_versions_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_versions" % key + f"Got an unexpected keyword argument '{key}' to method get_api_versions" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/', 'GET', path_params, diff --git a/kubernetes/client/api/apps_api.py b/kubernetes/client/api/apps_api.py index 3780b9dfbe..3c58d0980e 100644 --- a/kubernetes/client/api/apps_api.py +++ b/kubernetes/client/api/apps_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def get_api_group(self, **kwargs): # noqa: E501 + def get_api_group(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -47,13 +47,9 @@ def get_api_group(self, **kwargs): # noqa: E501 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 + return self.get_api_group_with_http_info(**kwargs) # noqa: E501 - def get_api_group_with_http_info(self, **kwargs): # noqa: E501 + def get_api_group_with_http_info(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -70,40 +66,41 @@ def get_api_group_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 + f"Got an unexpected keyword argument '{key}' to method get_api_group" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/', 'GET', path_params, diff --git a/kubernetes/client/api/apps_v1_api.py b/kubernetes/client/api/apps_v1_api.py index 590a15b04d..520b3bcc81 100644 --- a/kubernetes/client/api/apps_v1_api.py +++ b/kubernetes/client/api/apps_v1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_namespaced_controller_revision(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_controller_revision(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_controller_revision # noqa: E501 create a ControllerRevision # noqa: E501 @@ -52,13 +52,9 @@ def create_namespaced_controller_revision(self, namespace, body, **kwargs): # n returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_controller_revision_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_controller_revision_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_controller_revision_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_controller_revision_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_controller_revision_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_controller_revision # noqa: E501 create a ControllerRevision # noqa: E501 @@ -80,17 +76,21 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_controller_revision" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_controller_revision" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -103,8 +103,6 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_controller_revision`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -117,21 +115,24 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1/namespaces/{namespace}/controllerrevisions', 'POST', path_params, @@ -148,7 +149,7 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_daemon_set(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_daemon_set(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_daemon_set # noqa: E501 create a DaemonSet # noqa: E501 @@ -168,13 +169,9 @@ def create_namespaced_daemon_set(self, namespace, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_daemon_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_daemon_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_daemon_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_daemon_set # noqa: E501 create a DaemonSet # noqa: E501 @@ -196,17 +193,21 @@ def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs) local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_daemon_set" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_daemon_set" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -219,8 +220,6 @@ def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs) local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_daemon_set`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -233,21 +232,24 @@ def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs) if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1/namespaces/{namespace}/daemonsets', 'POST', path_params, @@ -264,7 +266,7 @@ def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs) _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_deployment(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_deployment(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_deployment # noqa: E501 create a Deployment # noqa: E501 @@ -284,13 +286,9 @@ def create_namespaced_deployment(self, namespace, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_deployment_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_deployment_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_deployment_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_deployment # noqa: E501 create a Deployment # noqa: E501 @@ -312,17 +310,21 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_deployment" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_deployment" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -335,8 +337,6 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_deployment`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -349,21 +349,24 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1/namespaces/{namespace}/deployments', 'POST', path_params, @@ -380,7 +383,7 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_replica_set(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_replica_set(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_replica_set # noqa: E501 create a ReplicaSet # noqa: E501 @@ -400,13 +403,9 @@ def create_namespaced_replica_set(self, namespace, body, **kwargs): # noqa: E50 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_replica_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_replica_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_replica_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_replica_set # noqa: E501 create a ReplicaSet # noqa: E501 @@ -428,17 +427,21 @@ def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_replica_set" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_replica_set" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -451,8 +454,6 @@ def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_replica_set`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -465,21 +466,24 @@ def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1/namespaces/{namespace}/replicasets', 'POST', path_params, @@ -496,7 +500,7 @@ def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_stateful_set(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_stateful_set(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_stateful_set # noqa: E501 create a StatefulSet # noqa: E501 @@ -516,13 +520,9 @@ def create_namespaced_stateful_set(self, namespace, body, **kwargs): # noqa: E5 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_stateful_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_stateful_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_stateful_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_stateful_set # noqa: E501 create a StatefulSet # noqa: E501 @@ -544,17 +544,21 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_stateful_set" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_stateful_set" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -567,8 +571,6 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_stateful_set`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -581,21 +583,24 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1/namespaces/{namespace}/statefulsets', 'POST', path_params, @@ -612,7 +617,7 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_controller_revision(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_controller_revision(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_controller_revision # noqa: E501 delete collection of ControllerRevision # noqa: E501 @@ -642,13 +647,9 @@ def delete_collection_namespaced_controller_revision(self, namespace, **kwargs): returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_controller_revision_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_controller_revision_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_controller_revision_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_controller_revision_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_controller_revision_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_controller_revision # noqa: E501 delete collection of ControllerRevision # noqa: E501 @@ -680,17 +681,31 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_controller_revision" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_controller_revision" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -701,10 +716,7 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -733,18 +745,19 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -764,7 +777,7 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_daemon_set(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_daemon_set(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_daemon_set # noqa: E501 delete collection of DaemonSet # noqa: E501 @@ -794,13 +807,9 @@ def delete_collection_namespaced_daemon_set(self, namespace, **kwargs): # noqa: returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_daemon_set_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_daemon_set_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_daemon_set_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_daemon_set # noqa: E501 delete collection of DaemonSet # noqa: E501 @@ -832,17 +841,31 @@ def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kw local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_daemon_set" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_daemon_set" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -853,10 +876,7 @@ def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kw collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -885,18 +905,19 @@ def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kw if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -916,7 +937,7 @@ def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kw _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_deployment(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_deployment(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_deployment # noqa: E501 delete collection of Deployment # noqa: E501 @@ -946,11 +967,7 @@ def delete_collection_namespaced_deployment(self, namespace, **kwargs): # noqa: returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_deployment_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_deployment_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_deployment_with_http_info(namespace, **kwargs) # noqa: E501 def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_deployment # noqa: E501 diff --git a/kubernetes/client/api/apps_v1beta1_api.py b/kubernetes/client/api/apps_v1beta1_api.py index 4dc2f51ade..1df07febbe 100644 --- a/kubernetes/client/api/apps_v1beta1_api.py +++ b/kubernetes/client/api/apps_v1beta1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_namespaced_controller_revision(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_controller_revision(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_controller_revision # noqa: E501 create a ControllerRevision # noqa: E501 @@ -52,13 +52,9 @@ def create_namespaced_controller_revision(self, namespace, body, **kwargs): # n returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_controller_revision_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_controller_revision_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_controller_revision_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_controller_revision_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_controller_revision_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_controller_revision # noqa: E501 create a ControllerRevision # noqa: E501 @@ -80,17 +76,21 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_controller_revision" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_controller_revision" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -103,8 +103,6 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_controller_revision`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -117,21 +115,24 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions', 'POST', path_params, @@ -148,7 +149,7 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_deployment(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_deployment(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_deployment # noqa: E501 create a Deployment # noqa: E501 @@ -168,13 +169,9 @@ def create_namespaced_deployment(self, namespace, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_deployment_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_deployment_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_deployment_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_deployment # noqa: E501 create a Deployment # noqa: E501 @@ -196,17 +193,21 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_deployment" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_deployment" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -219,8 +220,6 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_deployment`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -233,21 +232,24 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1beta1/namespaces/{namespace}/deployments', 'POST', path_params, @@ -264,7 +266,7 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_deployment_rollback(self, name, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_deployment_rollback(self, name, namespace, body, **kwargs): # noqa: E501 """create_namespaced_deployment_rollback # noqa: E501 create rollback of a Deployment # noqa: E501 @@ -285,13 +287,9 @@ def create_namespaced_deployment_rollback(self, name, namespace, body, **kwargs) returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_deployment_rollback_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_deployment_rollback_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_deployment_rollback_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - def create_namespaced_deployment_rollback_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_deployment_rollback_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 """create_namespaced_deployment_rollback # noqa: E501 create rollback of a Deployment # noqa: E501 @@ -314,17 +312,22 @@ def create_namespaced_deployment_rollback_with_http_info(self, name, namespace, local_var_params = locals() - all_params = ['name', 'namespace', 'body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'namespace', + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_deployment_rollback" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_deployment_rollback" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -341,8 +344,6 @@ def create_namespaced_deployment_rollback_with_http_info(self, name, namespace, local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_deployment_rollback`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -357,21 +358,24 @@ def create_namespaced_deployment_rollback_with_http_info(self, name, namespace, if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/rollback', 'POST', path_params, @@ -388,7 +392,7 @@ def create_namespaced_deployment_rollback_with_http_info(self, name, namespace, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_stateful_set(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_stateful_set(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_stateful_set # noqa: E501 create a StatefulSet # noqa: E501 @@ -408,13 +412,9 @@ def create_namespaced_stateful_set(self, namespace, body, **kwargs): # noqa: E5 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_stateful_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_stateful_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_stateful_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_stateful_set # noqa: E501 create a StatefulSet # noqa: E501 @@ -436,17 +436,21 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_stateful_set" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_stateful_set" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -459,8 +463,6 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_stateful_set`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -473,21 +475,24 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1beta1/namespaces/{namespace}/statefulsets', 'POST', path_params, @@ -504,7 +509,7 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_controller_revision(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_controller_revision(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_controller_revision # noqa: E501 delete collection of ControllerRevision # noqa: E501 @@ -534,13 +539,9 @@ def delete_collection_namespaced_controller_revision(self, namespace, **kwargs): returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_controller_revision_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_controller_revision_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_controller_revision_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_controller_revision_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_controller_revision_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_controller_revision # noqa: E501 delete collection of ControllerRevision # noqa: E501 @@ -572,17 +573,31 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_controller_revision" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_controller_revision" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -593,10 +608,7 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -625,18 +637,19 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -656,7 +669,7 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_deployment(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_deployment(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_deployment # noqa: E501 delete collection of Deployment # noqa: E501 @@ -686,13 +699,9 @@ def delete_collection_namespaced_deployment(self, namespace, **kwargs): # noqa: returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_deployment_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_deployment_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_deployment_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_deployment # noqa: E501 delete collection of Deployment # noqa: E501 @@ -724,17 +733,31 @@ def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kw local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_deployment" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_deployment" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -745,10 +768,7 @@ def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kw collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -777,18 +797,19 @@ def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kw if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -808,7 +829,7 @@ def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kw _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_stateful_set(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_stateful_set(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_stateful_set # noqa: E501 delete collection of StatefulSet # noqa: E501 @@ -838,13 +859,9 @@ def delete_collection_namespaced_stateful_set(self, namespace, **kwargs): # noq returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_stateful_set_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_stateful_set_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_stateful_set_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_stateful_set_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_stateful_set_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_stateful_set # noqa: E501 delete collection of StatefulSet # noqa: E501 @@ -876,17 +893,31 @@ def delete_collection_namespaced_stateful_set_with_http_info(self, namespace, ** local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_stateful_set" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_stateful_set" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -897,10 +928,7 @@ def delete_collection_namespaced_stateful_set_with_http_info(self, namespace, ** collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -929,18 +957,19 @@ def delete_collection_namespaced_stateful_set_with_http_info(self, namespace, ** if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -960,7 +989,7 @@ def delete_collection_namespaced_stateful_set_with_http_info(self, namespace, ** _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_namespaced_controller_revision(self, name, namespace, **kwargs): # noqa: E501 + def delete_namespaced_controller_revision(self, name, namespace, **kwargs): # noqa: E501 """delete_namespaced_controller_revision # noqa: E501 delete a ControllerRevision # noqa: E501 @@ -983,11 +1012,7 @@ def delete_namespaced_controller_revision(self, name, namespace, **kwargs): # n returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_namespaced_controller_revision_with_http_info(name, namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_namespaced_controller_revision_with_http_info(name, namespace, **kwargs) # noqa: E501 - return data + return self.delete_namespaced_controller_revision_with_http_info(name, namespace, **kwargs) # noqa: E501 def delete_namespaced_controller_revision_with_http_info(self, name, namespace, **kwargs): # noqa: E501 """delete_namespaced_controller_revision # noqa: E501 diff --git a/kubernetes/client/api/apps_v1beta2_api.py b/kubernetes/client/api/apps_v1beta2_api.py index bd87952e36..69951ea1ce 100644 --- a/kubernetes/client/api/apps_v1beta2_api.py +++ b/kubernetes/client/api/apps_v1beta2_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_namespaced_controller_revision(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_controller_revision(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_controller_revision # noqa: E501 create a ControllerRevision # noqa: E501 @@ -52,13 +52,9 @@ def create_namespaced_controller_revision(self, namespace, body, **kwargs): # n returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_controller_revision_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_controller_revision_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_controller_revision_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_controller_revision_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_controller_revision_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_controller_revision # noqa: E501 create a ControllerRevision # noqa: E501 @@ -80,17 +76,21 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_controller_revision" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_controller_revision" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -103,8 +103,6 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_controller_revision`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -117,21 +115,24 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions', 'POST', path_params, @@ -148,7 +149,7 @@ def create_namespaced_controller_revision_with_http_info(self, namespace, body, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_daemon_set(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_daemon_set(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_daemon_set # noqa: E501 create a DaemonSet # noqa: E501 @@ -168,13 +169,9 @@ def create_namespaced_daemon_set(self, namespace, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_daemon_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_daemon_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_daemon_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_daemon_set # noqa: E501 create a DaemonSet # noqa: E501 @@ -196,17 +193,21 @@ def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs) local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_daemon_set" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_daemon_set" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -219,8 +220,6 @@ def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs) local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_daemon_set`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -233,21 +232,24 @@ def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs) if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1beta2/namespaces/{namespace}/daemonsets', 'POST', path_params, @@ -264,7 +266,7 @@ def create_namespaced_daemon_set_with_http_info(self, namespace, body, **kwargs) _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_deployment(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_deployment(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_deployment # noqa: E501 create a Deployment # noqa: E501 @@ -284,13 +286,9 @@ def create_namespaced_deployment(self, namespace, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_deployment_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_deployment_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_deployment_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_deployment # noqa: E501 create a Deployment # noqa: E501 @@ -312,17 +310,21 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_deployment" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_deployment" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -335,8 +337,6 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_deployment`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -349,21 +349,24 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1beta2/namespaces/{namespace}/deployments', 'POST', path_params, @@ -380,7 +383,7 @@ def create_namespaced_deployment_with_http_info(self, namespace, body, **kwargs) _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_replica_set(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_replica_set(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_replica_set # noqa: E501 create a ReplicaSet # noqa: E501 @@ -400,13 +403,9 @@ def create_namespaced_replica_set(self, namespace, body, **kwargs): # noqa: E50 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_replica_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_replica_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_replica_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_replica_set # noqa: E501 create a ReplicaSet # noqa: E501 @@ -428,17 +427,21 @@ def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_replica_set" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_replica_set" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -451,8 +454,6 @@ def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_replica_set`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -465,21 +466,24 @@ def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1beta2/namespaces/{namespace}/replicasets', 'POST', path_params, @@ -496,7 +500,7 @@ def create_namespaced_replica_set_with_http_info(self, namespace, body, **kwargs _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_namespaced_stateful_set(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_stateful_set(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_stateful_set # noqa: E501 create a StatefulSet # noqa: E501 @@ -516,13 +520,9 @@ def create_namespaced_stateful_set(self, namespace, body, **kwargs): # noqa: E5 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_stateful_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_stateful_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_stateful_set_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_stateful_set # noqa: E501 create a StatefulSet # noqa: E501 @@ -544,17 +544,21 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_stateful_set" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_stateful_set" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -567,8 +571,6 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_stateful_set`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -581,21 +583,24 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/apps/v1beta2/namespaces/{namespace}/statefulsets', 'POST', path_params, @@ -612,7 +617,7 @@ def create_namespaced_stateful_set_with_http_info(self, namespace, body, **kwarg _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_controller_revision(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_controller_revision(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_controller_revision # noqa: E501 delete collection of ControllerRevision # noqa: E501 @@ -642,13 +647,9 @@ def delete_collection_namespaced_controller_revision(self, namespace, **kwargs): returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_controller_revision_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_controller_revision_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_controller_revision_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_controller_revision_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_controller_revision_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_controller_revision # noqa: E501 delete collection of ControllerRevision # noqa: E501 @@ -680,17 +681,31 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_controller_revision" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_controller_revision" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -701,10 +716,7 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -733,18 +745,19 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -764,7 +777,7 @@ def delete_collection_namespaced_controller_revision_with_http_info(self, namesp _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_daemon_set(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_daemon_set(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_daemon_set # noqa: E501 delete collection of DaemonSet # noqa: E501 @@ -794,13 +807,9 @@ def delete_collection_namespaced_daemon_set(self, namespace, **kwargs): # noqa: returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_daemon_set_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_daemon_set_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_daemon_set_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_daemon_set # noqa: E501 delete collection of DaemonSet # noqa: E501 @@ -832,17 +841,31 @@ def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kw local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_daemon_set" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_daemon_set" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -853,10 +876,7 @@ def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kw collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -885,18 +905,19 @@ def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kw if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -916,7 +937,7 @@ def delete_collection_namespaced_daemon_set_with_http_info(self, namespace, **kw _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_deployment(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_deployment(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_deployment # noqa: E501 delete collection of Deployment # noqa: E501 @@ -946,13 +967,9 @@ def delete_collection_namespaced_deployment(self, namespace, **kwargs): # noqa: returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_deployment_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_deployment_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_deployment_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_deployment # noqa: E501 delete collection of Deployment # noqa: E501 @@ -984,17 +1001,31 @@ def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kw local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_deployment" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_deployment" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -1005,10 +1036,7 @@ def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kw collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -1037,18 +1065,19 @@ def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kw if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -1068,7 +1097,7 @@ def delete_collection_namespaced_deployment_with_http_info(self, namespace, **kw _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_replica_set(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_replica_set(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_replica_set # noqa: E501 delete collection of ReplicaSet # noqa: E501 @@ -1098,11 +1127,7 @@ def delete_collection_namespaced_replica_set(self, namespace, **kwargs): # noqa returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_replica_set_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_replica_set_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_replica_set_with_http_info(namespace, **kwargs) # noqa: E501 def delete_collection_namespaced_replica_set_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_replica_set # noqa: E501 diff --git a/kubernetes/client/api/auditregistration_api.py b/kubernetes/client/api/auditregistration_api.py index 2810db624b..717d347871 100644 --- a/kubernetes/client/api/auditregistration_api.py +++ b/kubernetes/client/api/auditregistration_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def get_api_group(self, **kwargs): # noqa: E501 + def get_api_group(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -47,13 +47,9 @@ def get_api_group(self, **kwargs): # noqa: E501 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 + return self.get_api_group_with_http_info(**kwargs) # noqa: E501 - def get_api_group_with_http_info(self, **kwargs): # noqa: E501 + def get_api_group_with_http_info(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -70,40 +66,41 @@ def get_api_group_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 + f"Got an unexpected keyword argument '{key}' to method get_api_group" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/auditregistration.k8s.io/', 'GET', path_params, diff --git a/kubernetes/client/api/auditregistration_v1alpha1_api.py b/kubernetes/client/api/auditregistration_v1alpha1_api.py index 23bd2455b4..b5fd450865 100644 --- a/kubernetes/client/api/auditregistration_v1alpha1_api.py +++ b/kubernetes/client/api/auditregistration_v1alpha1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_audit_sink(self, body, **kwargs): # noqa: E501 + def create_audit_sink(self, body, **kwargs): # noqa: E501 """create_audit_sink # noqa: E501 create an AuditSink # noqa: E501 @@ -51,13 +51,9 @@ def create_audit_sink(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_audit_sink_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_audit_sink_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_audit_sink_with_http_info(body, **kwargs) # noqa: E501 - def create_audit_sink_with_http_info(self, body, **kwargs): # noqa: E501 + def create_audit_sink_with_http_info(self, body, **kwargs): # noqa: E501 """create_audit_sink # noqa: E501 create an AuditSink # noqa: E501 @@ -78,17 +74,20 @@ def create_audit_sink_with_http_info(self, body, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_audit_sink" % key + f"Got an unexpected keyword argument '{key}' to method create_audit_sink" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -97,8 +96,6 @@ def create_audit_sink_with_http_info(self, body, **kwargs): # noqa: E501 local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_audit_sink`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -109,21 +106,24 @@ def create_audit_sink_with_http_info(self, body, **kwargs): # noqa: E501 if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/auditregistration.k8s.io/v1alpha1/auditsinks', 'POST', path_params, @@ -140,7 +140,7 @@ def create_audit_sink_with_http_info(self, body, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_audit_sink(self, name, **kwargs): # noqa: E501 + def delete_audit_sink(self, name, **kwargs): # noqa: E501 """delete_audit_sink # noqa: E501 delete an AuditSink # noqa: E501 @@ -162,13 +162,9 @@ def delete_audit_sink(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_audit_sink_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.delete_audit_sink_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.delete_audit_sink_with_http_info(name, **kwargs) # noqa: E501 - def delete_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 + def delete_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 """delete_audit_sink # noqa: E501 delete an AuditSink # noqa: E501 @@ -192,17 +188,23 @@ def delete_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['name', 'pretty', 'dry_run', 'grace_period_seconds', 'orphan_dependents', 'propagation_policy', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'body', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_audit_sink" % key + f"Got an unexpected keyword argument '{key}' to method delete_audit_sink" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -213,10 +215,7 @@ def delete_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 collection_formats = {} - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - + path_params = {'name': local_var_params['name']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -229,18 +228,19 @@ def delete_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 if 'propagation_policy' in local_var_params: query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('body') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -260,7 +260,7 @@ def delete_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_audit_sink(self, **kwargs): # noqa: E501 + def delete_collection_audit_sink(self, **kwargs): # noqa: E501 """delete_collection_audit_sink # noqa: E501 delete collection of AuditSink # noqa: E501 @@ -289,13 +289,9 @@ def delete_collection_audit_sink(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_audit_sink_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.delete_collection_audit_sink_with_http_info(**kwargs) # noqa: E501 - return data + return self.delete_collection_audit_sink_with_http_info(**kwargs) # noqa: E501 - def delete_collection_audit_sink_with_http_info(self, **kwargs): # noqa: E501 + def delete_collection_audit_sink_with_http_info(self, **kwargs): # noqa: E501 """delete_collection_audit_sink # noqa: E501 delete collection of AuditSink # noqa: E501 @@ -326,17 +322,30 @@ def delete_collection_audit_sink_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_audit_sink" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_audit_sink" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -373,18 +382,19 @@ def delete_collection_audit_sink_with_http_info(self, **kwargs): # noqa: E501 if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -404,7 +414,7 @@ def delete_collection_audit_sink_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -419,13 +429,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -442,40 +448,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/auditregistration.k8s.io/v1alpha1/', 'GET', path_params, @@ -492,7 +499,7 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_audit_sink(self, **kwargs): # noqa: E501 + def list_audit_sink(self, **kwargs): # noqa: E501 """list_audit_sink # noqa: E501 list or watch objects of kind AuditSink # noqa: E501 @@ -516,13 +523,9 @@ def list_audit_sink(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_audit_sink_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_audit_sink_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_audit_sink_with_http_info(**kwargs) # noqa: E501 - def list_audit_sink_with_http_info(self, **kwargs): # noqa: E501 + def list_audit_sink_with_http_info(self, **kwargs): # noqa: E501 """list_audit_sink # noqa: E501 list or watch objects of kind AuditSink # noqa: E501 @@ -548,23 +551,29 @@ def list_audit_sink_with_http_info(self, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['pretty', 'allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_audit_sink" % key + f"Got an unexpected keyword argument '{key}' to method list_audit_sink" ) local_var_params[key] = val del local_var_params['kwargs'] - collection_formats = {} - path_params = {} query_params = [] @@ -587,19 +596,25 @@ def list_audit_sink_with_http_info(self, **kwargs): # noqa: E501 if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/auditregistration.k8s.io/v1alpha1/auditsinks', 'GET', path_params, @@ -616,7 +631,7 @@ def list_audit_sink_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_audit_sink(self, name, body, **kwargs): # noqa: E501 + def patch_audit_sink(self, name, body, **kwargs): # noqa: E501 """patch_audit_sink # noqa: E501 partially update the specified AuditSink # noqa: E501 @@ -637,13 +652,9 @@ def patch_audit_sink(self, name, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_audit_sink_with_http_info(name, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_audit_sink_with_http_info(name, body, **kwargs) # noqa: E501 - return data + return self.patch_audit_sink_with_http_info(name, body, **kwargs) # noqa: E501 - def patch_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 + def patch_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 """patch_audit_sink # noqa: E501 partially update the specified AuditSink # noqa: E501 @@ -666,17 +677,22 @@ def patch_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['name', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_audit_sink" % key + f"Got an unexpected keyword argument '{key}' to method patch_audit_sink" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -689,8 +705,6 @@ def patch_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_audit_sink`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -705,18 +719,20 @@ def patch_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -724,6 +740,7 @@ def patch_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}', 'PATCH', path_params, @@ -740,7 +757,7 @@ def patch_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def read_audit_sink(self, name, **kwargs): # noqa: E501 + def read_audit_sink(self, name, **kwargs): # noqa: E501 """read_audit_sink # noqa: E501 read the specified AuditSink # noqa: E501 @@ -759,13 +776,9 @@ def read_audit_sink(self, name, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.read_audit_sink_with_http_info(name, **kwargs) # noqa: E501 - else: - (data) = self.read_audit_sink_with_http_info(name, **kwargs) # noqa: E501 - return data + return self.read_audit_sink_with_http_info(name, **kwargs) # noqa: E501 - def read_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 + def read_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 """read_audit_sink # noqa: E501 read the specified AuditSink # noqa: E501 @@ -786,17 +799,20 @@ def read_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['name', 'pretty', 'exact', 'export'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'pretty', + 'exact', + 'export', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 read_audit_sink" % key + f"Got an unexpected keyword argument '{key}' to method read_audit_sink" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -805,12 +821,7 @@ def read_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 local_var_params['name'] is None): raise ValueError("Missing the required parameter `name` when calling `read_audit_sink`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'name' in local_var_params: - path_params['name'] = local_var_params['name'] # noqa: E501 - + path_params = {'name': local_var_params['name']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -819,19 +830,23 @@ def read_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 if 'export' in local_var_params: query_params.append(('export', local_var_params['export'])) # noqa: E501 - 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}', 'GET', path_params, @@ -848,7 +863,7 @@ def read_audit_sink_with_http_info(self, name, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def replace_audit_sink(self, name, body, **kwargs): # noqa: E501 + def replace_audit_sink(self, name, body, **kwargs): # noqa: E501 """replace_audit_sink # noqa: E501 replace the specified AuditSink # noqa: E501 @@ -868,13 +883,9 @@ def replace_audit_sink(self, name, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.replace_audit_sink_with_http_info(name, body, **kwargs) # noqa: E501 - else: - (data) = self.replace_audit_sink_with_http_info(name, body, **kwargs) # noqa: E501 - return data + return self.replace_audit_sink_with_http_info(name, body, **kwargs) # noqa: E501 - def replace_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 + def replace_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 """replace_audit_sink # noqa: E501 replace the specified AuditSink # noqa: E501 @@ -896,17 +907,21 @@ def replace_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['name', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 replace_audit_sink" % key + f"Got an unexpected keyword argument '{key}' to method replace_audit_sink" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -919,8 +934,6 @@ def replace_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `replace_audit_sink`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -933,21 +946,24 @@ def replace_audit_sink_with_http_info(self, name, body, **kwargs): # noqa: E501 if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}', 'PUT', path_params, diff --git a/kubernetes/client/api/authentication_api.py b/kubernetes/client/api/authentication_api.py index fa868ea9bd..d4a946763d 100644 --- a/kubernetes/client/api/authentication_api.py +++ b/kubernetes/client/api/authentication_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def get_api_group(self, **kwargs): # noqa: E501 + def get_api_group(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -47,13 +47,9 @@ def get_api_group(self, **kwargs): # noqa: E501 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 + return self.get_api_group_with_http_info(**kwargs) # noqa: E501 - def get_api_group_with_http_info(self, **kwargs): # noqa: E501 + def get_api_group_with_http_info(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -70,40 +66,41 @@ def get_api_group_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 + f"Got an unexpected keyword argument '{key}' to method get_api_group" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authentication.k8s.io/', 'GET', path_params, diff --git a/kubernetes/client/api/authentication_v1_api.py b/kubernetes/client/api/authentication_v1_api.py index 5e76aeb956..a42de7f925 100644 --- a/kubernetes/client/api/authentication_v1_api.py +++ b/kubernetes/client/api/authentication_v1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_token_review(self, body, **kwargs): # noqa: E501 + def create_token_review(self, body, **kwargs): # noqa: E501 """create_token_review # noqa: E501 create a TokenReview # noqa: E501 @@ -51,13 +51,9 @@ def create_token_review(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_token_review_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_token_review_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_token_review_with_http_info(body, **kwargs) # noqa: E501 - def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 + def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 """create_token_review # noqa: E501 create a TokenReview # noqa: E501 @@ -78,17 +74,20 @@ def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_token_review" % key + f"Got an unexpected keyword argument '{key}' to method create_token_review" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -97,8 +96,6 @@ def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_token_review`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -109,21 +106,24 @@ def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authentication.k8s.io/v1/tokenreviews', 'POST', path_params, @@ -140,7 +140,7 @@ def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -155,13 +155,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -178,40 +174,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authentication.k8s.io/v1/', 'GET', path_params, diff --git a/kubernetes/client/api/authentication_v1beta1_api.py b/kubernetes/client/api/authentication_v1beta1_api.py index 8b4c92ae03..4e81c98792 100644 --- a/kubernetes/client/api/authentication_v1beta1_api.py +++ b/kubernetes/client/api/authentication_v1beta1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_token_review(self, body, **kwargs): # noqa: E501 + def create_token_review(self, body, **kwargs): # noqa: E501 """create_token_review # noqa: E501 create a TokenReview # noqa: E501 @@ -51,13 +51,9 @@ def create_token_review(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_token_review_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_token_review_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_token_review_with_http_info(body, **kwargs) # noqa: E501 - def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 + def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 """create_token_review # noqa: E501 create a TokenReview # noqa: E501 @@ -78,17 +74,20 @@ def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 local_var_params = locals() - all_params = ['body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_token_review" % key + f"Got an unexpected keyword argument '{key}' to method create_token_review" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -97,8 +96,6 @@ def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_token_review`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -109,21 +106,24 @@ def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authentication.k8s.io/v1beta1/tokenreviews', 'POST', path_params, @@ -140,7 +140,7 @@ def create_token_review_with_http_info(self, body, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -155,13 +155,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -178,40 +174,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authentication.k8s.io/v1beta1/', 'GET', path_params, diff --git a/kubernetes/client/api/authorization_api.py b/kubernetes/client/api/authorization_api.py index bb8a8b1dac..c2f5d16f34 100644 --- a/kubernetes/client/api/authorization_api.py +++ b/kubernetes/client/api/authorization_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def get_api_group(self, **kwargs): # noqa: E501 + def get_api_group(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -47,13 +47,9 @@ def get_api_group(self, **kwargs): # noqa: E501 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 + return self.get_api_group_with_http_info(**kwargs) # noqa: E501 - def get_api_group_with_http_info(self, **kwargs): # noqa: E501 + def get_api_group_with_http_info(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -70,40 +66,41 @@ def get_api_group_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 + f"Got an unexpected keyword argument '{key}' to method get_api_group" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/', 'GET', path_params, diff --git a/kubernetes/client/api/authorization_v1_api.py b/kubernetes/client/api/authorization_v1_api.py index 970ce5527c..278ae8d677 100644 --- a/kubernetes/client/api/authorization_v1_api.py +++ b/kubernetes/client/api/authorization_v1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_namespaced_local_subject_access_review(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_local_subject_access_review(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_local_subject_access_review # noqa: E501 create a LocalSubjectAccessReview # noqa: E501 @@ -52,13 +52,9 @@ def create_namespaced_local_subject_access_review(self, namespace, body, **kwarg returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_local_subject_access_review_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_local_subject_access_review_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_local_subject_access_review_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_local_subject_access_review_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_local_subject_access_review_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_local_subject_access_review # noqa: E501 create a LocalSubjectAccessReview # noqa: E501 @@ -80,17 +76,21 @@ def create_namespaced_local_subject_access_review_with_http_info(self, namespace local_var_params = locals() - all_params = ['namespace', 'body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_local_subject_access_review" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_local_subject_access_review" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -103,8 +103,6 @@ def create_namespaced_local_subject_access_review_with_http_info(self, namespace local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_local_subject_access_review`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -117,21 +115,24 @@ def create_namespaced_local_subject_access_review_with_http_info(self, namespace if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews', 'POST', path_params, @@ -148,7 +149,7 @@ def create_namespaced_local_subject_access_review_with_http_info(self, namespace _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_self_subject_access_review(self, body, **kwargs): # noqa: E501 + def create_self_subject_access_review(self, body, **kwargs): # noqa: E501 """create_self_subject_access_review # noqa: E501 create a SelfSubjectAccessReview # noqa: E501 @@ -167,13 +168,9 @@ def create_self_subject_access_review(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_self_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_self_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_self_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - def create_self_subject_access_review_with_http_info(self, body, **kwargs): # noqa: E501 + def create_self_subject_access_review_with_http_info(self, body, **kwargs): # noqa: E501 """create_self_subject_access_review # noqa: E501 create a SelfSubjectAccessReview # noqa: E501 @@ -194,17 +191,20 @@ def create_self_subject_access_review_with_http_info(self, body, **kwargs): # n local_var_params = locals() - all_params = ['body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_self_subject_access_review" % key + f"Got an unexpected keyword argument '{key}' to method create_self_subject_access_review" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -213,8 +213,6 @@ def create_self_subject_access_review_with_http_info(self, body, **kwargs): # n local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_self_subject_access_review`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -225,21 +223,24 @@ def create_self_subject_access_review_with_http_info(self, body, **kwargs): # n if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/v1/selfsubjectaccessreviews', 'POST', path_params, @@ -256,7 +257,7 @@ def create_self_subject_access_review_with_http_info(self, body, **kwargs): # n _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_self_subject_rules_review(self, body, **kwargs): # noqa: E501 + def create_self_subject_rules_review(self, body, **kwargs): # noqa: E501 """create_self_subject_rules_review # noqa: E501 create a SelfSubjectRulesReview # noqa: E501 @@ -275,13 +276,9 @@ def create_self_subject_rules_review(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_self_subject_rules_review_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_self_subject_rules_review_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_self_subject_rules_review_with_http_info(body, **kwargs) # noqa: E501 - def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # noqa: E501 + def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # noqa: E501 """create_self_subject_rules_review # noqa: E501 create a SelfSubjectRulesReview # noqa: E501 @@ -302,17 +299,20 @@ def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # no local_var_params = locals() - all_params = ['body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_self_subject_rules_review" % key + f"Got an unexpected keyword argument '{key}' to method create_self_subject_rules_review" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -321,8 +321,6 @@ def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # no local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_self_subject_rules_review`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -333,21 +331,24 @@ def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # no if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/v1/selfsubjectrulesreviews', 'POST', path_params, @@ -364,7 +365,7 @@ def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # no _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_subject_access_review(self, body, **kwargs): # noqa: E501 + def create_subject_access_review(self, body, **kwargs): # noqa: E501 """create_subject_access_review # noqa: E501 create a SubjectAccessReview # noqa: E501 @@ -383,13 +384,9 @@ def create_subject_access_review(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: E501 + def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: E501 """create_subject_access_review # noqa: E501 create a SubjectAccessReview # noqa: E501 @@ -410,17 +407,20 @@ def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: local_var_params = locals() - all_params = ['body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_subject_access_review" % key + f"Got an unexpected keyword argument '{key}' to method create_subject_access_review" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -429,8 +429,6 @@ def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_subject_access_review`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -441,21 +439,24 @@ def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/v1/subjectaccessreviews', 'POST', path_params, @@ -472,7 +473,7 @@ def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -487,13 +488,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -510,40 +507,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/v1/', 'GET', path_params, diff --git a/kubernetes/client/api/authorization_v1beta1_api.py b/kubernetes/client/api/authorization_v1beta1_api.py index 463ab2bb0d..12d7d87985 100644 --- a/kubernetes/client/api/authorization_v1beta1_api.py +++ b/kubernetes/client/api/authorization_v1beta1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_namespaced_local_subject_access_review(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_local_subject_access_review(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_local_subject_access_review # noqa: E501 create a LocalSubjectAccessReview # noqa: E501 @@ -52,13 +52,9 @@ def create_namespaced_local_subject_access_review(self, namespace, body, **kwarg returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_local_subject_access_review_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_local_subject_access_review_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_local_subject_access_review_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_local_subject_access_review_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_local_subject_access_review_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_local_subject_access_review # noqa: E501 create a LocalSubjectAccessReview # noqa: E501 @@ -80,17 +76,21 @@ def create_namespaced_local_subject_access_review_with_http_info(self, namespace local_var_params = locals() - all_params = ['namespace', 'body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_local_subject_access_review" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_local_subject_access_review" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -103,8 +103,6 @@ def create_namespaced_local_subject_access_review_with_http_info(self, namespace local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_local_subject_access_review`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -117,21 +115,24 @@ def create_namespaced_local_subject_access_review_with_http_info(self, namespace if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews', 'POST', path_params, @@ -148,7 +149,7 @@ def create_namespaced_local_subject_access_review_with_http_info(self, namespace _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_self_subject_access_review(self, body, **kwargs): # noqa: E501 + def create_self_subject_access_review(self, body, **kwargs): # noqa: E501 """create_self_subject_access_review # noqa: E501 create a SelfSubjectAccessReview # noqa: E501 @@ -167,13 +168,9 @@ def create_self_subject_access_review(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_self_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_self_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_self_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - def create_self_subject_access_review_with_http_info(self, body, **kwargs): # noqa: E501 + def create_self_subject_access_review_with_http_info(self, body, **kwargs): # noqa: E501 """create_self_subject_access_review # noqa: E501 create a SelfSubjectAccessReview # noqa: E501 @@ -194,17 +191,20 @@ def create_self_subject_access_review_with_http_info(self, body, **kwargs): # n local_var_params = locals() - all_params = ['body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_self_subject_access_review" % key + f"Got an unexpected keyword argument '{key}' to method create_self_subject_access_review" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -213,8 +213,6 @@ def create_self_subject_access_review_with_http_info(self, body, **kwargs): # n local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_self_subject_access_review`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -225,21 +223,24 @@ def create_self_subject_access_review_with_http_info(self, body, **kwargs): # n if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews', 'POST', path_params, @@ -256,7 +257,7 @@ def create_self_subject_access_review_with_http_info(self, body, **kwargs): # n _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_self_subject_rules_review(self, body, **kwargs): # noqa: E501 + def create_self_subject_rules_review(self, body, **kwargs): # noqa: E501 """create_self_subject_rules_review # noqa: E501 create a SelfSubjectRulesReview # noqa: E501 @@ -275,13 +276,9 @@ def create_self_subject_rules_review(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_self_subject_rules_review_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_self_subject_rules_review_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_self_subject_rules_review_with_http_info(body, **kwargs) # noqa: E501 - def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # noqa: E501 + def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # noqa: E501 """create_self_subject_rules_review # noqa: E501 create a SelfSubjectRulesReview # noqa: E501 @@ -302,17 +299,20 @@ def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # no local_var_params = locals() - all_params = ['body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_self_subject_rules_review" % key + f"Got an unexpected keyword argument '{key}' to method create_self_subject_rules_review" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -321,8 +321,6 @@ def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # no local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_self_subject_rules_review`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -333,21 +331,24 @@ def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # no if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews', 'POST', path_params, @@ -364,7 +365,7 @@ def create_self_subject_rules_review_with_http_info(self, body, **kwargs): # no _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def create_subject_access_review(self, body, **kwargs): # noqa: E501 + def create_subject_access_review(self, body, **kwargs): # noqa: E501 """create_subject_access_review # noqa: E501 create a SubjectAccessReview # noqa: E501 @@ -383,13 +384,9 @@ def create_subject_access_review(self, body, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - else: - (data) = self.create_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - return data + return self.create_subject_access_review_with_http_info(body, **kwargs) # noqa: E501 - def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: E501 + def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: E501 """create_subject_access_review # noqa: E501 create a SubjectAccessReview # noqa: E501 @@ -410,17 +407,20 @@ def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: local_var_params = locals() - all_params = ['body', 'dry_run', 'field_manager', 'pretty'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'body', + 'dry_run', + 'field_manager', + 'pretty', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_subject_access_review" % key + f"Got an unexpected keyword argument '{key}' to method create_subject_access_review" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -429,8 +429,6 @@ def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_subject_access_review`") # noqa: E501 - collection_formats = {} - path_params = {} query_params = [] @@ -441,21 +439,24 @@ def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/v1beta1/subjectaccessreviews', 'POST', path_params, @@ -472,7 +473,7 @@ def create_subject_access_review_with_http_info(self, body, **kwargs): # noqa: _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -487,13 +488,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -510,40 +507,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/authorization.k8s.io/v1beta1/', 'GET', path_params, diff --git a/kubernetes/client/api/autoscaling_api.py b/kubernetes/client/api/autoscaling_api.py index 53fbab7e1a..f95665b8bf 100644 --- a/kubernetes/client/api/autoscaling_api.py +++ b/kubernetes/client/api/autoscaling_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def get_api_group(self, **kwargs): # noqa: E501 + def get_api_group(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -47,13 +47,9 @@ def get_api_group(self, **kwargs): # noqa: E501 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 + return self.get_api_group_with_http_info(**kwargs) # noqa: E501 - def get_api_group_with_http_info(self, **kwargs): # noqa: E501 + def get_api_group_with_http_info(self, **kwargs): # noqa: E501 """get_api_group # noqa: E501 get information of a group # noqa: E501 @@ -70,40 +66,41 @@ def get_api_group_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 + f"Got an unexpected keyword argument '{key}' to method get_api_group" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/', 'GET', path_params, diff --git a/kubernetes/client/api/autoscaling_v1_api.py b/kubernetes/client/api/autoscaling_v1_api.py index 8924788b4a..eaefd144c4 100644 --- a/kubernetes/client/api/autoscaling_v1_api.py +++ b/kubernetes/client/api/autoscaling_v1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_horizontal_pod_autoscaler # noqa: E501 create a HorizontalPodAutoscaler # noqa: E501 @@ -52,13 +52,9 @@ def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs) returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_horizontal_pod_autoscaler # noqa: E501 create a HorizontalPodAutoscaler # noqa: E501 @@ -80,17 +76,21 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -103,8 +103,6 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_horizontal_pod_autoscaler`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -117,21 +115,24 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers', 'POST', path_params, @@ -148,7 +149,7 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_horizontal_pod_autoscaler # noqa: E501 delete collection of HorizontalPodAutoscaler # noqa: E501 @@ -178,13 +179,9 @@ def delete_collection_namespaced_horizontal_pod_autoscaler(self, namespace, **kw returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_horizontal_pod_autoscaler # noqa: E501 delete collection of HorizontalPodAutoscaler # noqa: E501 @@ -216,17 +213,31 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -237,10 +248,7 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -269,18 +277,19 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -300,7 +309,7 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): # noqa: E501 + def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): # noqa: E501 """delete_namespaced_horizontal_pod_autoscaler # noqa: E501 delete a HorizontalPodAutoscaler # noqa: E501 @@ -323,13 +332,9 @@ def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs) returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - return data + return self.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, **kwargs): # noqa: E501 """delete_namespaced_horizontal_pod_autoscaler # noqa: E501 delete a HorizontalPodAutoscaler # noqa: E501 @@ -354,17 +359,24 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names local_var_params = locals() - all_params = ['name', 'namespace', 'pretty', 'dry_run', 'grace_period_seconds', 'orphan_dependents', 'propagation_policy', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'body', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method delete_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -382,8 +394,7 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 query_params = [] if 'pretty' in local_var_params: @@ -397,18 +408,19 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names if 'propagation_policy' in local_var_params: query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('body') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -428,7 +440,7 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -443,13 +455,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -466,40 +474,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v1/', 'GET', path_params, @@ -516,7 +525,7 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_horizontal_pod_autoscaler_for_all_namespaces(self, **kwargs): # noqa: E501 + def list_horizontal_pod_autoscaler_for_all_namespaces(self, **kwargs): # noqa: E501 """list_horizontal_pod_autoscaler_for_all_namespaces # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -540,13 +549,9 @@ def list_horizontal_pod_autoscaler_for_all_namespaces(self, **kwargs): # noqa: returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 - def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 """list_horizontal_pod_autoscaler_for_all_namespaces # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -572,23 +577,29 @@ def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwa local_var_params = locals() - all_params = ['allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'pretty', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_horizontal_pod_autoscaler_for_all_namespaces" % key + f"Got an unexpected keyword argument '{key}' to method list_horizontal_pod_autoscaler_for_all_namespaces" ) local_var_params[key] = val del local_var_params['kwargs'] - collection_formats = {} - path_params = {} query_params = [] @@ -611,19 +622,25 @@ def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwa if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v1/horizontalpodautoscalers', 'GET', path_params, @@ -640,7 +657,7 @@ def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwa _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 + def list_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 """list_namespaced_horizontal_pod_autoscaler # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -665,13 +682,9 @@ def list_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noq returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 + def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 """list_namespaced_horizontal_pod_autoscaler # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -698,17 +711,26 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method list_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -717,12 +739,7 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** local_var_params['namespace'] is None): raise ValueError("Missing the required parameter `namespace` when calling `list_namespaced_horizontal_pod_autoscaler`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -743,19 +760,25 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers', 'GET', path_params, @@ -772,7 +795,7 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): # noqa: E501 + def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler # noqa: E501 partially update the specified HorizontalPodAutoscaler # noqa: E501 @@ -794,13 +817,9 @@ def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kw returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - return data + return self.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler # noqa: E501 partially update the specified HorizontalPodAutoscaler # noqa: E501 @@ -824,17 +843,23 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp local_var_params = locals() - all_params = ['name', 'namespace', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method patch_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -851,8 +876,6 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_namespaced_horizontal_pod_autoscaler`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -869,18 +892,20 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -888,6 +913,7 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'PATCH', path_params, @@ -904,7 +930,7 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): # noqa: E501 + def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler_status # noqa: E501 partially update status of the specified HorizontalPodAutoscaler # noqa: E501 @@ -926,11 +952,7 @@ def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, bod returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - return data + return self.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 def patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler_status # noqa: E501 diff --git a/kubernetes/client/api/autoscaling_v2beta1_api.py b/kubernetes/client/api/autoscaling_v2beta1_api.py index 152c3bfadc..c17292fba8 100644 --- a/kubernetes/client/api/autoscaling_v2beta1_api.py +++ b/kubernetes/client/api/autoscaling_v2beta1_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_horizontal_pod_autoscaler # noqa: E501 create a HorizontalPodAutoscaler # noqa: E501 @@ -52,13 +52,9 @@ def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs) returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_horizontal_pod_autoscaler # noqa: E501 create a HorizontalPodAutoscaler # noqa: E501 @@ -80,17 +76,21 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -103,8 +103,6 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_horizontal_pod_autoscaler`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -117,21 +115,24 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers', 'POST', path_params, @@ -148,7 +149,7 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_horizontal_pod_autoscaler # noqa: E501 delete collection of HorizontalPodAutoscaler # noqa: E501 @@ -178,13 +179,9 @@ def delete_collection_namespaced_horizontal_pod_autoscaler(self, namespace, **kw returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_horizontal_pod_autoscaler # noqa: E501 delete collection of HorizontalPodAutoscaler # noqa: E501 @@ -216,17 +213,31 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -237,10 +248,7 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -269,18 +277,19 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -300,7 +309,7 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): # noqa: E501 + def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): # noqa: E501 """delete_namespaced_horizontal_pod_autoscaler # noqa: E501 delete a HorizontalPodAutoscaler # noqa: E501 @@ -323,13 +332,9 @@ def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs) returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - return data + return self.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, **kwargs): # noqa: E501 """delete_namespaced_horizontal_pod_autoscaler # noqa: E501 delete a HorizontalPodAutoscaler # noqa: E501 @@ -354,17 +359,24 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names local_var_params = locals() - all_params = ['name', 'namespace', 'pretty', 'dry_run', 'grace_period_seconds', 'orphan_dependents', 'propagation_policy', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'body', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method delete_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -382,8 +394,7 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 query_params = [] if 'pretty' in local_var_params: @@ -397,18 +408,19 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names if 'propagation_policy' in local_var_params: query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('body') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -428,7 +440,7 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -443,13 +455,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -466,40 +474,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta1/', 'GET', path_params, @@ -516,7 +525,7 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_horizontal_pod_autoscaler_for_all_namespaces(self, **kwargs): # noqa: E501 + def list_horizontal_pod_autoscaler_for_all_namespaces(self, **kwargs): # noqa: E501 """list_horizontal_pod_autoscaler_for_all_namespaces # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -540,13 +549,9 @@ def list_horizontal_pod_autoscaler_for_all_namespaces(self, **kwargs): # noqa: returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 - def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 """list_horizontal_pod_autoscaler_for_all_namespaces # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -572,23 +577,29 @@ def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwa local_var_params = locals() - all_params = ['allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'pretty', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_horizontal_pod_autoscaler_for_all_namespaces" % key + f"Got an unexpected keyword argument '{key}' to method list_horizontal_pod_autoscaler_for_all_namespaces" ) local_var_params[key] = val del local_var_params['kwargs'] - collection_formats = {} - path_params = {} query_params = [] @@ -611,19 +622,25 @@ def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwa if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta1/horizontalpodautoscalers', 'GET', path_params, @@ -640,7 +657,7 @@ def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwa _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 + def list_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 """list_namespaced_horizontal_pod_autoscaler # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -665,13 +682,9 @@ def list_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noq returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 + def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 """list_namespaced_horizontal_pod_autoscaler # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -698,17 +711,26 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method list_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -717,12 +739,7 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** local_var_params['namespace'] is None): raise ValueError("Missing the required parameter `namespace` when calling `list_namespaced_horizontal_pod_autoscaler`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -743,19 +760,25 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers', 'GET', path_params, @@ -772,7 +795,7 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): # noqa: E501 + def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler # noqa: E501 partially update the specified HorizontalPodAutoscaler # noqa: E501 @@ -794,13 +817,9 @@ def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kw returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - return data + return self.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler # noqa: E501 partially update the specified HorizontalPodAutoscaler # noqa: E501 @@ -824,17 +843,23 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp local_var_params = locals() - all_params = ['name', 'namespace', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method patch_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -851,8 +876,6 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_namespaced_horizontal_pod_autoscaler`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -869,18 +892,20 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -888,6 +913,7 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'PATCH', path_params, @@ -904,7 +930,7 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): # noqa: E501 + def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler_status # noqa: E501 partially update status of the specified HorizontalPodAutoscaler # noqa: E501 @@ -926,11 +952,7 @@ def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, bod returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - return data + return self.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 def patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler_status # noqa: E501 diff --git a/kubernetes/client/api/autoscaling_v2beta2_api.py b/kubernetes/client/api/autoscaling_v2beta2_api.py index 62f13cfa30..7da68ae9de 100644 --- a/kubernetes/client/api/autoscaling_v2beta2_api.py +++ b/kubernetes/client/api/autoscaling_v2beta2_api.py @@ -32,7 +32,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_horizontal_pod_autoscaler # noqa: E501 create a HorizontalPodAutoscaler # noqa: E501 @@ -52,13 +52,9 @@ def create_namespaced_horizontal_pod_autoscaler(self, namespace, body, **kwargs) returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, **kwargs) # noqa: E501 - return data + return self.create_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, body, **kwargs) # noqa: E501 - def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, body, **kwargs): # noqa: E501 + def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, body, **kwargs): # noqa: E501 """create_namespaced_horizontal_pod_autoscaler # noqa: E501 create a HorizontalPodAutoscaler # noqa: E501 @@ -80,17 +76,21 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, local_var_params = locals() - all_params = ['namespace', 'body', 'pretty', 'dry_run', 'field_manager'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 create_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method create_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -103,8 +103,6 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `create_namespaced_horizontal_pod_autoscaler`") # noqa: E501 - collection_formats = {} - path_params = {} if 'namespace' in local_var_params: path_params['namespace'] = local_var_params['namespace'] # noqa: E501 @@ -117,21 +115,24 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, if 'field_manager' in local_var_params: query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers', 'POST', path_params, @@ -148,7 +149,7 @@ def create_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_collection_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_horizontal_pod_autoscaler # noqa: E501 delete collection of HorizontalPodAutoscaler # noqa: E501 @@ -178,13 +179,9 @@ def delete_collection_namespaced_horizontal_pod_autoscaler(self, namespace, **kw returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 + def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 """delete_collection_namespaced_horizontal_pod_autoscaler # noqa: E501 delete collection of HorizontalPodAutoscaler # noqa: E501 @@ -216,17 +213,31 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'dry_run', 'field_selector', 'grace_period_seconds', 'label_selector', 'limit', 'orphan_dependents', 'propagation_policy', 'resource_version', 'timeout_seconds', 'watch', 'v1_delete_options'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'dry_run', + 'field_selector', + 'grace_period_seconds', + 'label_selector', + 'limit', + 'orphan_dependents', + 'propagation_policy', + 'resource_version', + 'timeout_seconds', + 'watch', + 'v1_delete_options', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_collection_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method delete_collection_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -237,10 +248,7 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, collection_formats = {} - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -269,18 +277,19 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'v1_delete_options' in local_var_params: - body_params = local_var_params['v1_delete_options'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('v1_delete_options') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -300,7 +309,7 @@ def delete_collection_namespaced_horizontal_pod_autoscaler_with_http_info(self, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): # noqa: E501 + def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): # noqa: E501 """delete_namespaced_horizontal_pod_autoscaler # noqa: E501 delete a HorizontalPodAutoscaler # noqa: E501 @@ -323,13 +332,9 @@ def delete_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs) returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - else: - (data) = self.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - return data + return self.delete_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, **kwargs): # noqa: E501 + def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, **kwargs): # noqa: E501 """delete_namespaced_horizontal_pod_autoscaler # noqa: E501 delete a HorizontalPodAutoscaler # noqa: E501 @@ -354,17 +359,24 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names local_var_params = locals() - all_params = ['name', 'namespace', 'pretty', 'dry_run', 'grace_period_seconds', 'orphan_dependents', 'propagation_policy', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'namespace', + 'pretty', + 'dry_run', + 'grace_period_seconds', + 'orphan_dependents', + 'propagation_policy', + 'body', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 delete_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method delete_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -382,8 +394,7 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 + path_params['namespace'] = local_var_params['namespace'] # noqa: E501 query_params = [] if 'pretty' in local_var_params: @@ -397,18 +408,19 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names if 'propagation_policy' in local_var_params: query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} - body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params.get('body') + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 @@ -428,7 +440,7 @@ def delete_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, names _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def get_api_resources(self, **kwargs): # noqa: E501 + def get_api_resources(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -443,13 +455,9 @@ def get_api_resources(self, **kwargs): # noqa: E501 returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - return data + return self.get_api_resources_with_http_info(**kwargs) # noqa: E501 - def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 + def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 """get_api_resources # noqa: E501 get available resources # noqa: E501 @@ -466,40 +474,41 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 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') - + all_params = [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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_resources" % key + f"Got an unexpected keyword argument '{key}' to method get_api_resources" ) 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 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta2/', 'GET', path_params, @@ -516,7 +525,7 @@ def get_api_resources_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_horizontal_pod_autoscaler_for_all_namespaces(self, **kwargs): # noqa: E501 + def list_horizontal_pod_autoscaler_for_all_namespaces(self, **kwargs): # noqa: E501 """list_horizontal_pod_autoscaler_for_all_namespaces # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -540,13 +549,9 @@ def list_horizontal_pod_autoscaler_for_all_namespaces(self, **kwargs): # noqa: returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 - return data + return self.list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(**kwargs) # noqa: E501 - def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 + def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwargs): # noqa: E501 """list_horizontal_pod_autoscaler_for_all_namespaces # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -572,23 +577,29 @@ def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwa local_var_params = locals() - all_params = ['allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'pretty', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'pretty', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_horizontal_pod_autoscaler_for_all_namespaces" % key + f"Got an unexpected keyword argument '{key}' to method list_horizontal_pod_autoscaler_for_all_namespaces" ) local_var_params[key] = val del local_var_params['kwargs'] - collection_formats = {} - path_params = {} query_params = [] @@ -611,19 +622,25 @@ def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwa if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta2/horizontalpodautoscalers', 'GET', path_params, @@ -640,7 +657,7 @@ def list_horizontal_pod_autoscaler_for_all_namespaces_with_http_info(self, **kwa _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def list_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 + def list_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noqa: E501 """list_namespaced_horizontal_pod_autoscaler # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -665,13 +682,9 @@ def list_namespaced_horizontal_pod_autoscaler(self, namespace, **kwargs): # noq returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - else: - (data) = self.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - return data + return self.list_namespaced_horizontal_pod_autoscaler_with_http_info(namespace, **kwargs) # noqa: E501 - def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 + def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, **kwargs): # noqa: E501 """list_namespaced_horizontal_pod_autoscaler # noqa: E501 list or watch objects of kind HorizontalPodAutoscaler # noqa: E501 @@ -698,17 +711,26 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** local_var_params = locals() - all_params = ['namespace', 'pretty', 'allow_watch_bookmarks', '_continue', 'field_selector', 'label_selector', 'limit', 'resource_version', 'timeout_seconds', 'watch'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'namespace', + 'pretty', + 'allow_watch_bookmarks', + '_continue', + 'field_selector', + 'label_selector', + 'limit', + 'resource_version', + 'timeout_seconds', + 'watch', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 list_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method list_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -717,12 +739,7 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** local_var_params['namespace'] is None): raise ValueError("Missing the required parameter `namespace` when calling `list_namespaced_horizontal_pod_autoscaler`") # noqa: E501 - collection_formats = {} - - path_params = {} - if 'namespace' in local_var_params: - path_params['namespace'] = local_var_params['namespace'] # noqa: E501 - + path_params = {'namespace': local_var_params['namespace']} query_params = [] if 'pretty' in local_var_params: query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501 @@ -743,19 +760,25 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** if 'watch' in local_var_params: query_params.append(('watch', local_var_params['watch'])) # noqa: E501 - 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', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # noqa: E501 - + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + 'application/json;stream=watch', + 'application/vnd.kubernetes.protobuf;stream=watch', + ] + ) + } # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers', 'GET', path_params, @@ -772,7 +795,7 @@ def list_namespaced_horizontal_pod_autoscaler_with_http_info(self, namespace, ** _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): # noqa: E501 + def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler # noqa: E501 partially update the specified HorizontalPodAutoscaler # noqa: E501 @@ -794,13 +817,9 @@ def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kw returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - return data + return self.patch_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler # noqa: E501 partially update the specified HorizontalPodAutoscaler # noqa: E501 @@ -824,17 +843,23 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp local_var_params = locals() - all_params = ['name', 'namespace', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_namespaced_horizontal_pod_autoscaler" % key + f"Got an unexpected keyword argument '{key}' to method patch_namespaced_horizontal_pod_autoscaler" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -851,8 +876,6 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_namespaced_horizontal_pod_autoscaler`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -869,18 +892,20 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -888,6 +913,7 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}', 'PATCH', path_params, @@ -904,7 +930,7 @@ def patch_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namesp _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): # noqa: E501 + def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler_status # noqa: E501 partially update status of the specified HorizontalPodAutoscaler # noqa: E501 @@ -926,13 +952,9 @@ def patch_namespaced_horizontal_pod_autoscaler_status(self, name, namespace, bod returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - else: - (data) = self.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - return data + return self.patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(name, namespace, body, **kwargs) # noqa: E501 - def patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 + def patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, namespace, body, **kwargs): # noqa: E501 """patch_namespaced_horizontal_pod_autoscaler_status # noqa: E501 partially update status of the specified HorizontalPodAutoscaler # noqa: E501 @@ -956,17 +978,23 @@ def patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, local_var_params = locals() - all_params = ['name', 'namespace', 'body', 'pretty', 'dry_run', 'field_manager', 'force'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - + all_params = [ + 'name', + 'namespace', + 'body', + 'pretty', + 'dry_run', + 'field_manager', + 'force', + 'async_req', + '_return_http_data_only', + '_preload_content', + '_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 patch_namespaced_horizontal_pod_autoscaler_status" % key + f"Got an unexpected keyword argument '{key}' to method patch_namespaced_horizontal_pod_autoscaler_status" ) local_var_params[key] = val del local_var_params['kwargs'] @@ -983,8 +1011,6 @@ def patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, local_var_params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `patch_namespaced_horizontal_pod_autoscaler_status`") # noqa: E501 - collection_formats = {} - path_params = {} if 'name' in local_var_params: path_params['name'] = local_var_params['name'] # noqa: E501 @@ -1001,18 +1027,20 @@ def patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, if 'force' in local_var_params: query_params.append(('force', local_var_params['force'])) # noqa: E501 - header_params = {} - form_params = [] local_var_files = {} body_params = None - if 'body' in local_var_params: - body_params = local_var_params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501 - + body_params = local_var_params['body'] + header_params = { + 'Accept': self.api_client.select_header_accept( + [ + 'application/json', + 'application/yaml', + 'application/vnd.kubernetes.protobuf', + ] + ) + } # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json']) # noqa: E501 @@ -1020,6 +1048,7 @@ def patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, # Authentication setting auth_settings = ['BearerToken'] # noqa: E501 + collection_formats = {} return self.api_client.call_api( '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status', 'PATCH', path_params, @@ -1036,7 +1065,7 @@ def patch_namespaced_horizontal_pod_autoscaler_status_with_http_info(self, name, _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) - def read_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): # noqa: E501 + def read_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): # noqa: E501 """read_namespaced_horizontal_pod_autoscaler # noqa: E501 read the specified HorizontalPodAutoscaler # noqa: E501 @@ -1056,11 +1085,7 @@ def read_namespaced_horizontal_pod_autoscaler(self, name, namespace, **kwargs): returns the request thread. """ kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.read_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - else: - (data) = self.read_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 - return data + return self.read_namespaced_horizontal_pod_autoscaler_with_http_info(name, namespace, **kwargs) # noqa: E501 def read_namespaced_horizontal_pod_autoscaler_with_http_info(self, name, namespace, **kwargs): # noqa: E501 """read_namespaced_horizontal_pod_autoscaler # noqa: E501 diff --git a/kubernetes/client/api_client.py b/kubernetes/client/api_client.py index fde1a17f48..e1f6975afd 100644 --- a/kubernetes/client/api_client.py +++ b/kubernetes/client/api_client.py @@ -268,12 +268,12 @@ def __deserialize(self, data, klass): if type(klass) == str: if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + sub_kls = re.match(r'list\[(.*)\]', klass)[1] return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('dict('): - sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass)[2] return {k: self.__deserialize(v, sub_kls) for k, v in six.iteritems(data)} @@ -452,11 +452,7 @@ def prepare_post_parameters(self, post_params=None, files=None): :param files: File parameters. :return: Form parameters with files. """ - params = [] - - if post_params: - params = post_params - + params = post_params or [] if files: for k, v in six.iteritems(files): if not v: @@ -468,8 +464,7 @@ def prepare_post_parameters(self, post_params=None, files=None): filedata = f.read() mimetype = (mimetypes.guess_type(filename)[0] or 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) + params.append((k, (filename, filedata, mimetype))) return params @@ -516,8 +511,7 @@ def update_params_for_auth(self, headers, querys, auth_settings): return for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: + if auth_setting := self.configuration.auth_settings().get(auth): if not auth_setting['value']: continue elif auth_setting['in'] == 'header': @@ -542,10 +536,10 @@ def __deserialize_file(self, response): os.close(fd) os.remove(path) - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + if content_disposition := response.getheader("Content-Disposition"): + filename = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition + )[1] path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -638,7 +632,6 @@ def __deserialize_model(self, data, klass): instance = klass(**kwargs) if hasattr(instance, 'get_real_child_model'): - klass_name = instance.get_real_child_model(data) - if klass_name: + if klass_name := instance.get_real_child_model(data): instance = self.__deserialize(data, klass_name) return instance diff --git a/kubernetes/client/configuration.py b/kubernetes/client/configuration.py index a11a357a3a..7dccf6c42b 100644 --- a/kubernetes/client/configuration.py +++ b/kubernetes/client/configuration.py @@ -23,17 +23,17 @@ class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None + def __init__(self, name, bases, dct): + super(TypeWithDefault, self).__init__(name, bases, dct) + self._default = None - def __call__(cls): - if cls._default is None: - cls._default = type.__call__(cls) - return copy.copy(cls._default) + def __call__(self): + if self._default is None: + self._default = type.__call__(self) + return copy.copy(self._default) - def set_default(cls, default): - cls._default = copy.copy(default) + def set_default(self, default): + self._default = copy.copy(default) class Configuration(six.with_metaclass(TypeWithDefault, object)): @@ -61,8 +61,7 @@ def __init__(self): self.password = "" # Logging Settings - self.logger = {} - self.logger["package_logger"] = logging.getLogger("client") + self.logger = {"package_logger": logging.getLogger("client")} self.logger["urllib3_logger"] = logging.getLogger("urllib3") # Log format self.logger_format = '%(asctime)s %(levelname)s %(message)s' @@ -191,11 +190,11 @@ def get_api_key_with_prefix(self, identifier): :param identifier: The identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] + if self.api_key.get(identifier): + if self.api_key_prefix.get(identifier): + return f'{self.api_key_prefix[identifier]} {self.api_key[identifier]}' + else: + return self.api_key[identifier] def get_basic_auth_token(self): """Gets HTTP basic authentication header (string). @@ -203,7 +202,7 @@ def get_basic_auth_token(self): :return: The token for basic HTTP authentication. """ return urllib3.util.make_headers( - basic_auth=self.username + ':' + self.password + basic_auth=f'{self.username}:{self.password}' ).get('authorization') def auth_settings(self): diff --git a/kubernetes/client/rest.py b/kubernetes/client/rest.py index a28e12387c..7f0d8de241 100644 --- a/kubernetes/client/rest.py +++ b/kubernetes/client/rest.py @@ -59,18 +59,9 @@ def __init__(self, configuration, pools_size=4, maxsize=None): # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - + cert_reqs = ssl.CERT_REQUIRED if configuration.verify_ssl else ssl.CERT_NONE # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - + ca_certs = configuration.ssl_ca_cert or certifi.where() addition_pool_args = {} if configuration.assert_hostname is not None: addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 @@ -153,15 +144,16 @@ def request(self, method, url, query_params=None, headers=None, # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: if query_params: - url += '?' + urlencode(query_params) + url += f'?{urlencode(query_params)}' if re.search('json', headers['Content-Type'], re.IGNORECASE): - if headers['Content-Type'] == 'application/json-patch+json': - if not isinstance(body, list): - headers['Content-Type'] = \ + if headers[ + 'Content-Type' + ] == 'application/json-patch+json' and not isinstance( + body, list + ): + headers['Content-Type'] = \ 'application/strategic-merge-patch+json' - request_body = None - if body is not None: - request_body = json.dumps(body) + request_body = json.dumps(body) if body is not None else None r = self.pool_manager.request( method, url, body=request_body, @@ -188,9 +180,6 @@ def request(self, method, url, query_params=None, headers=None, preload_content=_preload_content, timeout=timeout, headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form elif isinstance(body, str): request_body = body r = self.pool_manager.request( @@ -205,7 +194,6 @@ def request(self, method, url, query_params=None, headers=None, arguments. Please check that your arguments match declared content type.""" raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` else: r = self.pool_manager.request(method, url, fields=query_params, diff --git a/setup.py b/setup.py index d920d45749..ca2a9d7e0f 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ line = line.strip() if ';' in line: requirement, _, specifier = line.partition(';') - for_specifier = EXTRAS.setdefault(':{}'.format(specifier), []) + for_specifier = EXTRAS.setdefault(f':{specifier}', []) for_specifier.append(requirement) else: REQUIRES.append(line) @@ -57,15 +57,22 @@ install_requires=REQUIRES, tests_require=TESTS_REQUIRES, extras_require=EXTRAS, - packages=['kubernetes', 'kubernetes.client', 'kubernetes.config', - 'kubernetes.watch', 'kubernetes.client.api', - 'kubernetes.stream', 'kubernetes.client.models', - 'kubernetes.utils', 'kubernetes.client.apis', - 'kubernetes.dynamic'], + packages=[ + 'kubernetes', + 'kubernetes.client', + 'kubernetes.config', + 'kubernetes.watch', + 'kubernetes.client.api', + 'kubernetes.stream', + 'kubernetes.client.models', + 'kubernetes.utils', + 'kubernetes.client.apis', + 'kubernetes.dynamic', + ], include_package_data=True, long_description="Python client for kubernetes http://kubernetes.io/", classifiers=[ - "Development Status :: %s" % DEVELOPMENT_STATUS, + f"Development Status :: {DEVELOPMENT_STATUS}", "Topic :: Utilities", "Intended Audience :: Developers", "Intended Audience :: Information Technology",